[Feature][ZXW-86][ZXW-87]add status&net api2
Only Configure:No,
Affected branch:master,
Affected module:LED
Is it affected on both ZXIC and MTK:only ZXIC,
Self-test:Yes,
Doc Update:NO.
Change-Id: I7ca2fd30c8e2ff1406380604bcf140c6af78a1b7
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c
index a4f9a38..6f6f916 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c
+++ b/cap/zx297520v3/src/lynq/framework/lynq-led-sev/lynq_led_sev.c
@@ -8,6 +8,7 @@
#define BUF_LEN 8
+#define GPIO_LED 100
#define LYNQ_UCI_SECTION "lynq_led"
#define LYNQ_UCI_KEY "lynq_statusled_on"
@@ -15,14 +16,16 @@
int main(int argc, const char *argv[])
{
char led_enable[BUF_LEN] = "";
+ char com_val[GPIO_LED] = "";
system("/usr/bin/lynq-default");
lynq_get_value(LYNQ_UCI_FILE, LYNQ_UCI_SECTION, LYNQ_UCI_KEY, led_enable);
if(atoi(led_enable))
{
+ sprintf(com_val, "echo %d > /sys/class/gpio/gpio127/value",led_enable);
system("echo 127 > /sys/class/gpio/export");
system("echo out > /sys/class/gpio/gpio127/direction");//92 net_Status,127 status
- system("echo 127 > /sys/class/gpio/gpio127/value");
+ system(com_val);
}
return 0;
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
index 95577f1..b3eb4bc 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
@@ -29,4 +29,4 @@
option status '0'
config lynq_led_rw 'lynq_led'
- option lynq_statusled_on '1'
\ No newline at end of file
+ option lynq_statusled_on '0'
\ No newline at end of file
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
new file mode 100755
index 0000000..706aa6f
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/lynq_led-demo.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <strings.h>
+#include<stdlib.h>
+#include <include/lynq_uci.h>
+
+
+
+
+int main(int argc, const char *argv[])
+{
+ int ret = 0;
+ ret = lynq_set_netled_on(1);
+ if(ret){
+ printf("[%s-%d] lynq_set_netled_on error\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+ ret = lynq_set_statusled_on(1);
+ if(ret){
+ printf("[%s-%d] lynq_set_statusled_on error\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile
new file mode 100755
index 0000000..bfab13c
--- /dev/null
+++ b/cap/zx297520v3/src/lynq/packages/apps/lynq-led-demo/makefile
@@ -0,0 +1,48 @@
+SHELL = /bin/sh
+RM = rm -f
+
+LOCAL_CFLAGS := -Wall \
+ -g -Os \
+ -flto \
+ -fpermissive \
+ -fPIC \
+
+ifeq ($(strip $(TARGET_PLATFORM)), T106)
+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
+endif
+
+LOCAL_CFLAGS += -DLYNQ_SW_INSIDE_VERSION=\"$(LYNQ_CONFIG_VERSION)\"
+LOCAL_CFLAGS += -DLYNQ_SW_VERSION=\"$(LYNQ_CONFIG_SW_VERSION)\"
+
+LOCAL_PATH = .
+
+LOCAL_C_INCLUDES = \
+ -I. \
+
+
+
+
+
+LOCAL_LIBS := \
+ -L. \
+ -ldl \
+ -lpthread \
+ -llynq-uci \
+ -llynq-led \
+
+SOURCES = $(wildcard *.c)
+
+EXECUTABLE = lynq-led-demo
+
+OBJECTS=$(SOURCES:.c=.o)
+all: $(EXECUTABLE)
+
+$(EXECUTABLE): $(OBJECTS)
+ $(CXX) $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
+
+%.o : %.c
+ $(CC) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
+
+.PHONY: clean
+clean:
+ $(RM) $(OBJECTS) $(EXECUTABLE)