Fix mbtk from v1265 GSW
Change-Id: I5d8d395616f284bc74c8b9448cfa347164b5a668
diff --git a/mbtk/test/libgsw_lib/gsw_at_test.c b/mbtk/test/libgsw_lib/gsw_at_test.c
new file mode 100755
index 0000000..6c06efb
--- /dev/null
+++ b/mbtk/test/libgsw_lib/gsw_at_test.c
@@ -0,0 +1,56 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <stdint.h>
+
+typedef void(*AT_CALLBACK)(char input[],char output[],int out_max_size);
+int32_t (*gsw_reg_atcmd)(const char *atcmd,AT_CALLBACK);
+void *dlHandle_at;
+char *lynqLib_at = "/lib/libgsw_lib.so";
+
+void lynq_test_example(char input[], char output[], int out_max_size)
+{
+ if(!strcmp(input, "AT+TEST1"))
+ {
+ memcpy(output, input, strlen(input));
+ }
+ else if(!strcmp(input, "AT+TEST2"))
+ {
+ memcpy(output, input, strlen(input));
+ }
+ else if(!strcmp(input, "AT+TEST3"))
+ {
+ memcpy(output, input, strlen(input));
+ }
+ else if(!strcmp(input, "AT+TEST4"))
+ {
+ memcpy(output, input, strlen(input));
+ }
+ else if(!strcmp(input, "AT+TEST5"))
+ {
+ memcpy(output, input, strlen(input));
+ }
+ return;
+}
+
+
+int main(void)
+{
+ int ret;
+ dlHandle_at = dlopen(lynqLib_at, RTLD_NOW);
+ gsw_reg_atcmd=(int32_t(*)(const char *atcmd,AT_CALLBACK))dlsym(dlHandle_at, "gsw_reg_atcmd");
+ ret = gsw_reg_atcmd("AT+TEST1;AT+TEST2;AT+TEST3;AT+TEST4;AT+TEST5",lynq_test_example);
+ if (ret == 0)
+ printf("at add ok\n");
+ else
+ printf("at add fail\n");
+ while (1)
+ {
+ getchar();
+ }
+ dlclose(dlHandle_at);
+ dlHandle_at = NULL;
+ return 0;
+
+}
\ No newline at end of file