led: add led api
Change-Id: I6d124e6ad583e897adb22371cac6a695eec3b0cb
diff --git a/mbtk/mbtk_ril/src/mbtk_info_server.c b/mbtk/mbtk_ril/src/mbtk_info_server.c
index 861c64b..3fc1a86 100755
--- a/mbtk/mbtk_ril/src/mbtk_info_server.c
+++ b/mbtk/mbtk_ril/src/mbtk_info_server.c
@@ -19,6 +19,7 @@
#include "mbtk_utils.h"
#include "mbtk_ifc.h"
#include "info_data.h"
+#include "mbtk_led.h"
static int sock_listen_fd = -1;
static int epoll_fd = -1;
@@ -5306,7 +5307,45 @@
}
break;
}
+ case MBTK_INFO_ID_LED_REQ:
+ {
+ if(pack->data_len == 0 || pack->data == NULL)
+ {
+ err = MBTK_INFO_ERR_UNSUPPORTED;
+ LOGE("led param is error.");
+ }
+ else
+ {
+ char type = pack->data[0];
+ char status = pack->data[1];
+ LOGE("[set_led] = [%d], [status_led] = [%d].", type, status);
+ if(type == MBTK_LED_TYPE_NET)
+ {
+ if(status == MBTK_LED_STATUS_CLOSE)
+ {
+ mbtk_net_led_set(MBTK_NET_LED_CLOSE);
+ }
+ else
+ {
+ mbtk_net_led_set(MBTK_NET_LED_OPEN);
+ }
+ }
+ else
+ {
+ if(status == MBTK_LED_STATUS_CLOSE)
+ {
+ status_led_set(MBTK_STATUS_LED_CLOSE);
+ }
+ else
+ {
+ status_led_set(MBTK_STATUS_LED_OPEN);
+ }
+ }
+ pack_rsp_send(cli_info->fd, MBTK_INFO_ID_LED_RSP, NULL, 0);
+ }
+ break;
+ }
default:
{
err = MBTK_INFO_ERR_REQ_UNKNOWN;