Bug 87189[led]
Change-Id: I5434465443ef666b64585c237b51a36adfad55a8
diff --git a/mbtk/mbtk_rild/src/main.c b/mbtk/mbtk_rild/src/main.c
index 5e81f2c..6d65374 100644
--- a/mbtk/mbtk_rild/src/main.c
+++ b/mbtk/mbtk_rild/src/main.c
@@ -431,25 +431,47 @@
|| strStartsWith(s, "+CEREG:")) // LTE data registed.
{
char* tmp_s = s + 7;
+ static bool net_led_gms_wcdma = FALSE;
+ static bool net_led_lte = FALSE;
while(*tmp_s && *tmp_s == ' ')
tmp_s++;
uint8 data[2];
data[0] = (uint8)atoi(tmp_s); // Reg State.
- if(strStartsWith(s, "+CGREG:")) {
- data[1] = 0; // GMS/WCDMA
- } else {
- data[1] = 1; // LTE
- if(data[0] == 1)
- {
- mbtk_net_led_set(MBTK_NET_LED_NET_CONNECT);
-
- mbtk_net_ready();
- }
- else
- {
- mbtk_net_led_set(MBTK_NET_LED_SEARCH_NETWORK);
- }
+ if(strStartsWith(s, "+CGREG:"))
+ {
+ data[1] = 0; // GMS/WCDMA
+ if(data[0] == 1)
+ {
+ net_led_gms_wcdma = TRUE;
+ }
+ else
+ {
+ net_led_gms_wcdma = FALSE;
+ }
+
+ }
+ else
+ {
+ data[1] = 1; // LTE
+ if(data[0] == 1)
+ {
+ net_led_lte = TRUE;
+ }
+ else
+ {
+ net_led_lte = FALSE;
+ }
+ }
+
+ if(FALSE == net_led_gms_wcdma && FALSE == net_led_lte)
+ {
+ mbtk_net_led_set(MBTK_NET_LED_SEARCH_NETWORK);
+ }
+ else
+ {
+ mbtk_net_led_set(MBTK_NET_LED_NET_CONNECT);
+ mbtk_net_ready();
}
urc_msg_distribute(true, INFO_URC_MSG_NET_PS_REG_STATE, data, sizeof(data));