[nw]Bug 86872
Change-Id: I54f1c68b4d6aa303ecf2715787c5158f463efc8a
diff --git a/mbtk/liblynq_lib/src/lynq_network.c b/mbtk/liblynq_lib/src/lynq_network.c
old mode 100755
new mode 100644
index d550efd..f53c8dc
--- a/mbtk/liblynq_lib/src/lynq_network.c
+++ b/mbtk/liblynq_lib/src/lynq_network.c
@@ -310,19 +310,19 @@
//msg_buf.gsm_sig_info_valid = TRUE;//signalstrength.gw_sig_valid;
msg_buf.gsm_sig_info.rssi = *(net_data + 1);//signalstrength.rssi;
- printf("rssi = %d\n", *(net_data + 1));
+ //printf("rssi = %d\n", *(net_data + 1));
//msg_buf.wcdma_sig_info_valid = TRUE;//.wcdma_sig_valid;
msg_buf.wcdma_sig_info.rssi = *(net_data + 4);//signalstrength.rscp;
- printf("rscp = %d\n", *(net_data + 4));
+ //printf("rscp = %d\n", *(net_data + 4));
msg_buf.wcdma_sig_info.ecio = *(net_data + 5);//signalstrength.ecno;
- printf("ecno = %d\n", *(net_data + 5));
+ //printf("ecno = %d\n", *(net_data + 5));
msg_buf.tdscdma_sig_info_valid = FALSE;
//msg_buf.lte_sig_info_valid = TRUE;//signalstrength.lte_sig_valid;
msg_buf.lte_sig_info.rssi = -125;
msg_buf.lte_sig_info.rsrp = *(net_data + 7);//signalstrength.rsrp;
- printf("rsrp = %d\n", *(net_data + 7));
+ //printf("rsrp = %d\n", *(net_data + 7));
msg_buf.lte_sig_info.rsrq = *(net_data + 6);//signalstrength.rsrq;
- printf("rsrq = %d\n", *(net_data + 6));
+ //printf("rsrq = %d\n", *(net_data + 6));
msg_buf.lte_sig_info.snr = 0x7FFFFFFFF; //signalstrength.rssnr;(当前mbtk没有该参数)
msg_buf.cdma_sig_info_valid = FALSE;
msg_buf.hdr_sig_info_valid = FALSE;
@@ -338,6 +338,9 @@
if(lynq_func_cb_handle.handlerPtr != NULL)
{
lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_SIGNAL_STRENGTH_EVENT_IND_FLAG, ind_msg_buf, sizeof (msg_buf), lynq_func_cb_handle.contextPtr);
+ lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_VOICE_REG_EVENT_IND_FLAG, NULL, 0, lynq_func_cb_handle.contextPtr);
+ lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_DATA_REG_EVENT_IND_FLAG, NULL, 0, lynq_func_cb_handle.contextPtr);
+ lynq_func_cb_handle.handlerPtr(g_nw_val, NW_IND_IMS_REG_EVENT_IND_FLAG, NULL, 0, lynq_func_cb_handle.contextPtr);
}
}
else
@@ -878,6 +881,21 @@
return 0;
}
+void net_state_change_cb(const void* data, int data_len)
+{
+ printf("Recv event indication : NET REG EVENT\n");
+ if(data && data_len > 0) {
+ const uint8 *ptr = (const uint8*)data;
+ if(*ptr == 0) { // CS
+ printf("CS:act=%d, mode=%d\n", *(ptr + 1), *(ptr + 2));
+ } else { // PS
+ printf("PS[%s]:act=%d, mode=%d\n", *(ptr + 3) == 0 ? "GSM/WCDMA" : "LTE", *(ptr + 1), *(ptr + 2));
+ }
+ } else
+ LOGD("ind is NULL");
+}
+
+
int qser_nw_add_rx_msg_handler (nw_client_handle_type h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr, void* contextPtr)
{
//UNUSED(h_nw);
@@ -900,6 +918,7 @@
lynq_func_cb_handle.contextPtr = contextPtr;
mbtk_signal_state_change_cb_reg(lynq_nw_info_handle, lynq_signal_state_change_cb);
+ mbtk_net_state_change_cb_reg(lynq_nw_info_handle, net_state_change_cb);
return 0;
}
diff --git a/mbtk/mbtk_rild/src/main.c b/mbtk/mbtk_rild/src/main.c
old mode 100755
new mode 100644
index 4faeced..5e81f2c
--- a/mbtk/mbtk_rild/src/main.c
+++ b/mbtk/mbtk_rild/src/main.c
@@ -453,6 +453,7 @@
}
urc_msg_distribute(true, INFO_URC_MSG_NET_PS_REG_STATE, data, sizeof(data));
+ urc_msg_distribute(true, INFO_URC_MSG_NET_STATE_LOG, NULL, 0);
}
// +CREG: 1, "8010", "000060a5", 0, 2, 0
// +CREG: 1, "8330", "06447347", 7, 2, 0
@@ -500,6 +501,7 @@
urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
}
urc_msg_distribute(false, INFO_URC_MSG_NET_CS_REG_STATE, data, sizeof(data));
+ urc_msg_distribute(true, INFO_URC_MSG_NET_STATE_LOG, NULL, 0);
CREG_EXIT:
free(free_ptr);
}
diff --git a/mbtk/test/liblynq_lib/lynq_nw_test.c b/mbtk/test/liblynq_lib/lynq_nw_test.c
index 39bc5a0..57f9c47 100644
--- a/mbtk/test/liblynq_lib/lynq_nw_test.c
+++ b/mbtk/test/liblynq_lib/lynq_nw_test.c
@@ -182,7 +182,8 @@
}
case NW_IND_IMS_REG_EVENT_IND_FLAG:
{
- printf("Recv event indication : IMS REG EVENT\n");
+ printf("Recv event indication : IMS REG EVENT\n");
+ printf("ind is NULL\n");
break;
}