[Bugfix][T106ZXW-91][Network] add qser_nw_get_signal_strength API in demo
Affected branch: unknown
Affected module: unknown
Is it affected on both ZXIC and MTK:ZXIC only
Self-test: Yes
Doc Update: No
Change-Id: I3a3ba5e6c2ff9ff9d66778ce8bc933febd52f068
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp
index dabfb0e..8ef97ca 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-network-demo/files/lynq-qser-network-demo.cpp
@@ -20,6 +20,7 @@
int (*qser_nw_get_operator_name_p)(nw_client_handle_type h_nw, QSER_NW_OPERATOR_NAME_INFO_T *pt_info );
int (*qser_nw_get_reg_status_p)(nw_client_handle_type h_nw, QSER_NW_REG_STATUS_INFO_T *pt_info);
int (*qser_nw_add_rx_msg_handler_p)(nw_client_handle_type h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr,void* contextPtr);
+int (*qser_nw_get_signal_strength_p)(nw_client_handle_type h_nw,QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info);
int getFunc()
{
@@ -37,6 +38,7 @@
qser_nw_set_config_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_CONFIG_INFO_T *pt_info))dlsym(handle_network,"qser_nw_set_config");
qser_nw_get_operator_name_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_OPERATOR_NAME_INFO_T *pt_info ))dlsym(handle_network,"qser_nw_get_operator_name");
qser_nw_get_reg_status_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_REG_STATUS_INFO_T *pt_info))dlsym(handle_network,"qser_nw_get_reg_status");
+ qser_nw_get_signal_strength_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info))dlsym(handle_network,"qser_nw_get_signal_strength");
qser_nw_add_rx_msg_handler_p = (int (*)(nw_client_handle_type h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr,void* contextPtr))dlsym(handle_network,"qser_nw_add_rx_msg_handler");
if(qser_nw_client_deinit_p==NULL || qser_nw_client_init_p==NULL || qser_nw_set_config_p ==NULL ||
@@ -74,8 +76,9 @@
{1, "qser_nw_set_config"},
{2, "qser_nw_get_operator_name"},
{3, "qser_nw_get_reg_status"},
- {4, "qser_nw_client_deinit"},
- {5, "qser_nw_add_rx_msg_handler"},
+ {4, "qser_nw_add_rx_msg_handler"},
+ {5, "qser_nw_get_signal_strength"},
+ {6, "qser_nw_client_deinit"},
{-1, "quit"}
};
@@ -311,131 +314,172 @@
}
switch(cmdIdx)
{
- case 0://"qser_nw_client_init"
- {
-
- ret = qser_nw_client_init_p(&h_nw);
- printf("qser_nw_client_init ret = %d\n", ret);
- break;
- }
- case 1://"qser_nw_set_config"
- {
- QSER_NW_CONFIG_INFO_T t_info = {0};
-
- int mask = 0;
- printf("please input decimal format number, whose hex format is (TDSCDMA | LTE | EVDO | CDMA | WCDMA | GSM) : \n");
- scanf("%d", &mask);
- t_info.preferred_nw_mode = mask;
-
- ret = qser_nw_set_config_p(h_nw, &t_info);
- printf("qser_nw_set_config ret = %d\n", ret);
- break;
- }
- case 2://"qser_nw_get_operator_name"
- {
- QSER_NW_OPERATOR_NAME_INFO_T t_info;
- ret = qser_nw_get_operator_name_p(h_nw, &t_info);
- printf("qser_nw_get_operator_name ret = %d, long_eons=%s, short_eons=%s, mcc=%s, mnc=%s\n", ret,
- t_info.long_eons, t_info.short_eons, t_info.mcc, t_info.mnc);
- break;
- }
- case 3://"qser_nw_get_reg_status"
- {
- QSER_NW_REG_STATUS_INFO_T t_info;
-
- memset(&t_info, 0, sizeof(QSER_NW_REG_STATUS_INFO_T));
- ret = qser_nw_get_reg_status_p(h_nw, &t_info);
- printf("qser_nw_get_reg_status ret = %d, detail info:\n", ret);
- if(t_info.voice_registration_valid)
- {
- printf("voice_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n",
- tech_domain[t_info.voice_registration.tech_domain],
- radio_tech[t_info.voice_registration.radio_tech],
- t_info.voice_registration.roaming,
- t_info.voice_registration.registration_state);
- }
- if(t_info.data_registration_valid)
- {
- printf("data_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n",
- tech_domain[t_info.data_registration.tech_domain],
- radio_tech[t_info.data_registration.radio_tech],
- t_info.data_registration.roaming,
- t_info.data_registration.registration_state);
- }
- if(t_info.voice_registration_details_3gpp_valid)
- {
- printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n",
- tech_domain[t_info.voice_registration_details_3gpp.tech_domain],
- radio_tech[t_info.voice_registration_details_3gpp.radio_tech],
- t_info.voice_registration_details_3gpp.mcc,
- t_info.voice_registration_details_3gpp.mnc,
- t_info.voice_registration_details_3gpp.roaming,
- t_info.voice_registration_details_3gpp.forbidden,
- t_info.voice_registration_details_3gpp.cid,
- t_info.voice_registration_details_3gpp.lac,
- t_info.voice_registration_details_3gpp.psc,
- t_info.voice_registration_details_3gpp.tac);
- }
- if(t_info.data_registration_details_3gpp_valid)
- {
- printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n",
- tech_domain[t_info.data_registration_details_3gpp.tech_domain],
- radio_tech[t_info.data_registration_details_3gpp.radio_tech],
- t_info.data_registration_details_3gpp.mcc,
- t_info.data_registration_details_3gpp.mnc,
- t_info.data_registration_details_3gpp.roaming,
- t_info.data_registration_details_3gpp.forbidden,
- t_info.data_registration_details_3gpp.cid,
- t_info.data_registration_details_3gpp.lac,
- t_info.data_registration_details_3gpp.psc,
- t_info.data_registration_details_3gpp.tac);
- }
-
- if(t_info.voice_registration_details_3gpp2_valid)
- {
- printf("voice_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n",
- tech_domain[t_info.voice_registration_details_3gpp2.tech_domain],
- radio_tech[t_info.voice_registration_details_3gpp2.radio_tech],
- t_info.voice_registration_details_3gpp2.mcc,
- t_info.voice_registration_details_3gpp2.mnc,
- t_info.voice_registration_details_3gpp2.roaming,
- t_info.voice_registration_details_3gpp2.forbidden,
- t_info.voice_registration_details_3gpp2.sid,
- t_info.voice_registration_details_3gpp2.nid,
- t_info.voice_registration_details_3gpp2.bsid);
- }
-
- if(t_info.data_registration_details_3gpp2_valid)
- {
- printf("data_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n",
- tech_domain[t_info.data_registration_details_3gpp2.tech_domain],
- radio_tech[t_info.data_registration_details_3gpp2.radio_tech],
- t_info.data_registration_details_3gpp2.mcc,
- t_info.data_registration_details_3gpp2.mnc,
- t_info.data_registration_details_3gpp2.roaming,
- t_info.data_registration_details_3gpp2.forbidden,
- t_info.data_registration_details_3gpp2.sid,
- t_info.data_registration_details_3gpp2.nid,
- t_info.data_registration_details_3gpp2.bsid);
- }
+ case 0://"qser_nw_client_init"
+ {
+
+ ret = qser_nw_client_init_p(&h_nw);
+ printf("qser_nw_client_init ret = %d\n", ret);
+ break;
+ }
+ case 1://"qser_nw_set_config"
+ {
+ QSER_NW_CONFIG_INFO_T t_info = {0};
+
+ int mask = 0;
+ printf("please input decimal format number, whose hex format is (TDSCDMA | LTE | EVDO | CDMA | WCDMA | GSM) : \n");
+ scanf("%d", &mask);
+ t_info.preferred_nw_mode = mask;
+
+ ret = qser_nw_set_config_p(h_nw, &t_info);
+ printf("qser_nw_set_config ret = %d\n", ret);
+ break;
+ }
+ case 2://"qser_nw_get_operator_name"
+ {
+ QSER_NW_OPERATOR_NAME_INFO_T t_info;
+ ret = qser_nw_get_operator_name_p(h_nw, &t_info);
+ printf("qser_nw_get_operator_name ret = %d, long_eons=%s, short_eons=%s, mcc=%s, mnc=%s\n", ret,
+ t_info.long_eons, t_info.short_eons, t_info.mcc, t_info.mnc);
+ break;
+ }
+ case 3://"qser_nw_get_reg_status"
+ {
+ QSER_NW_REG_STATUS_INFO_T t_info;
+
+ memset(&t_info, 0, sizeof(QSER_NW_REG_STATUS_INFO_T));
+ ret = qser_nw_get_reg_status_p(h_nw, &t_info);
+ printf("qser_nw_get_reg_status ret = %d, detail info:\n", ret);
+ if(t_info.voice_registration_valid)
+ {
+ printf("voice_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n",
+ tech_domain[t_info.voice_registration.tech_domain],
+ radio_tech[t_info.voice_registration.radio_tech],
+ t_info.voice_registration.roaming,
+ t_info.voice_registration.registration_state);
+ }
+ if(t_info.data_registration_valid)
+ {
+ printf("data_registration: \ntech_domain=%s, radio_tech=%s, roaming=%d, registration_state=%d\n",
+ tech_domain[t_info.data_registration.tech_domain],
+ radio_tech[t_info.data_registration.radio_tech],
+ t_info.data_registration.roaming,
+ t_info.data_registration.registration_state);
+ }
+ if(t_info.voice_registration_details_3gpp_valid)
+ {
+ printf("voice_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n",
+ tech_domain[t_info.voice_registration_details_3gpp.tech_domain],
+ radio_tech[t_info.voice_registration_details_3gpp.radio_tech],
+ t_info.voice_registration_details_3gpp.mcc,
+ t_info.voice_registration_details_3gpp.mnc,
+ t_info.voice_registration_details_3gpp.roaming,
+ t_info.voice_registration_details_3gpp.forbidden,
+ t_info.voice_registration_details_3gpp.cid,
+ t_info.voice_registration_details_3gpp.lac,
+ t_info.voice_registration_details_3gpp.psc,
+ t_info.voice_registration_details_3gpp.tac);
+ }
+ if(t_info.data_registration_details_3gpp_valid)
+ {
+ printf("data_registration_details_3gpp: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, cid=0x%X, lac=%d, psc=%d, tac=%d\n",
+ tech_domain[t_info.data_registration_details_3gpp.tech_domain],
+ radio_tech[t_info.data_registration_details_3gpp.radio_tech],
+ t_info.data_registration_details_3gpp.mcc,
+ t_info.data_registration_details_3gpp.mnc,
+ t_info.data_registration_details_3gpp.roaming,
+ t_info.data_registration_details_3gpp.forbidden,
+ t_info.data_registration_details_3gpp.cid,
+ t_info.data_registration_details_3gpp.lac,
+ t_info.data_registration_details_3gpp.psc,
+ t_info.data_registration_details_3gpp.tac);
+ }
+
+ if(t_info.voice_registration_details_3gpp2_valid)
+ {
+ printf("voice_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n",
+ tech_domain[t_info.voice_registration_details_3gpp2.tech_domain],
+ radio_tech[t_info.voice_registration_details_3gpp2.radio_tech],
+ t_info.voice_registration_details_3gpp2.mcc,
+ t_info.voice_registration_details_3gpp2.mnc,
+ t_info.voice_registration_details_3gpp2.roaming,
+ t_info.voice_registration_details_3gpp2.forbidden,
+ t_info.voice_registration_details_3gpp2.sid,
+ t_info.voice_registration_details_3gpp2.nid,
+ t_info.voice_registration_details_3gpp2.bsid);
+ }
+
+ if(t_info.data_registration_details_3gpp2_valid)
+ {
+ printf("data_registration_details_3gpp2: \ntech_domain=%s, radio_tech=%s, mcc=%s, mnc=%s, roaming=%d, forbidden=%d, sid=%d, nid=%d, bsid=%d\n",
+ tech_domain[t_info.data_registration_details_3gpp2.tech_domain],
+ radio_tech[t_info.data_registration_details_3gpp2.radio_tech],
+ t_info.data_registration_details_3gpp2.mcc,
+ t_info.data_registration_details_3gpp2.mnc,
+ t_info.data_registration_details_3gpp2.roaming,
+ t_info.data_registration_details_3gpp2.forbidden,
+ t_info.data_registration_details_3gpp2.sid,
+ t_info.data_registration_details_3gpp2.nid,
+ t_info.data_registration_details_3gpp2.bsid);
+ }
+
+ break;
+ }
+ case 6://"qser_nw_client_deinit"
+ {
+ ret = qser_nw_client_deinit_p(h_nw);
+ printf("qser_nw_client_deinit ret = %d\n", ret);
+ break;
+ }
+ case 4 :
+ {
+ ret = qser_nw_add_rx_msg_handler_p(h_nw, nw_event_ind_handler, NULL);
+ printf("qser_nw_add_rx_msg_handler, ret=%d\n", ret);
+ break;
+ }
+ case 5 :
+ {
+ QSER_NW_SIGNAL_STRENGTH_INFO_T t_info;
+ ret = qser_nw_get_signal_strength_p(h_nw, &t_info);
+ printf("qser_nw_get_signal_strength, ret=%d\n", ret);
+ if(ret==0)
+ {
+ printf("qser_solicited_signal_strength gsm_sig_info_valid = %d\n"
+ " gsm_sig_info.rssi = %d\n"
+ " wcdma _sig_info_valid = %d\n"
+ " wcdma_sig_info.rssi = %d\n"
+ " wcdma_sig_info.ecio = %d\n"
+ " tdscdma_sig_info_valid = %d\n"
+ " lte_sig_info_valid = %d\n"
+ " lte_sig_info.rssi = %d\n"
+ " lte_sig_info.rsrp = %d\n"
+ " lte_sig_info.rsrq = %d\n"
+ " lte_sig_info.snr = %d\n"
+ " cdma_sig_info_valid = %d\n"
+ " hdr_sig_info_valid = %d\n"
+ " nr_sig_info_valid = %d\n"
+ " nr_sig_info.ssRsrp = %d\n"
+ " nr_sig_info.ssRsrq = %d\n"
+ " nr_sig_info.ssSinr = %d\n"
+ " nr_sig_info.csiRsrp = %d\n"
+ " nr_sig_info.csiRsrq = %d\n"
+ " nr_sig_info.csiSinr = %d\n",
+ t_info.gsm_sig_info_valid, t_info.gsm_sig_info.rssi,
+ t_info.wcdma_sig_info_valid, t_info.wcdma_sig_info.rssi, t_info.wcdma_sig_info.ecio,
+ t_info.tdscdma_sig_info_valid,
+ t_info.lte_sig_info_valid, t_info.lte_sig_info.rssi, t_info.lte_sig_info.rsrp, t_info.lte_sig_info.rsrq, t_info.lte_sig_info.snr,
+ t_info.cdma_sig_info_valid,
+ t_info.hdr_sig_info_valid,
+ t_info.nr_sig_info_valid, t_info.nr_sig_info.ssRsrp, t_info.nr_sig_info.ssRsrq, t_info.nr_sig_info.ssSinr,
+ t_info.nr_sig_info.csiRsrp, t_info.nr_sig_info.csiRsrq, t_info.nr_sig_info.csiSinr);
- break;
- }
- case 4://"qser_nw_client_deinit"
- {
- ret = qser_nw_client_deinit_p(h_nw);
- printf("qser_nw_client_deinit ret = %d\n", ret);
- break;
- }
- case 5 :
- {
- ret = qser_nw_add_rx_msg_handler_p(h_nw, nw_event_ind_handler, NULL);
- printf("qser_nw_add_rx_msg_handler, ret=%d\n", ret);
- break;
- }
-
- default:
- show_group_help(&t_nw_test);
+ }
+ break;
+ }
+
+ default:
+ {
+ show_group_help(&t_nw_test);
+ }
}
}
return 0;