Update LYNQ test
Change-Id: I9e434803f0cce9f24048f2fbc5eed2d26fa33503
diff --git a/mbtk/test/liblynq_lib/lynq-qser-thermal-demo.cpp b/mbtk/test/liblynq_lib/lynq-qser-thermal-demo.cpp
new file mode 100755
index 0000000..03a5926
--- /dev/null
+++ b/mbtk/test/liblynq_lib/lynq-qser-thermal-demo.cpp
@@ -0,0 +1,49 @@
+#include <sys/types.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <dlfcn.h>
+
+#include"lynq-qser-thermal-demo.h"
+
+
+int (*get_thermal_zone)(int *numbers, int size);
+
+
+int main(int argc, char *argv[]){
+ int numbers[MAX_SIZE];
+ int ret = 0;
+ const char *lynq_libpath_thermal = "/lib/liblynq-qser-thermal.so";
+
+ void *dlHandle_thermal = dlopen(lynq_libpath_thermal, RTLD_NOW);
+ if (dlHandle_thermal == NULL)
+ {
+ printf("dlopen dlHandle_thermal failed: %s\n", dlerror());
+ exit(EXIT_FAILURE);
+ }
+ get_thermal_zone = (int(*)(int *numbers, int size))dlsym(dlHandle_thermal,"get_thermal_zone");
+ if(NULL != get_thermal_zone)
+ {
+ ret = get_thermal_zone(numbers, MAX_SIZE);
+ if (ret <= 0) {
+ printf("get_thermal_zone error\n");
+ return -1;
+ }
+ }else{
+ printf("get_thermal_zone dlsym error\n");
+ }
+
+ for (int j = 0; j < ret; ++j) {
+ printf("[%s-%d] temp[%d] = %d \n", __func__, __LINE__, j, numbers[j]);
+ }
+
+ return 0;
+}
+
+
+
+