| #include <stdio.h> |
| #include <unistd.h> |
| #include <stdlib.h> |
| #include <pthread.h> |
| #include <include/lynq_sim.h> |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| /*Quick accept array*/ |
| void * thread_test(void * arg) |
| { |
| FILE *fp; |
| char buf[1024*3] = {0}; |
| sprintf(buf, "echo 11 | emdlogger_ctrl 2>&1"); |
| fp=popen(buf, "r"); |
| if(!fp){ |
| perror("popen:"); |
| } |
| while(fgets(buf, 4072, fp) != NULL){} |
| pclose(fp); |
| return 0; |
| } |
| |
| int main(void){ |
| lynq_sim_init(2022); |
| pthread_t thid = -1; |
| int ret = pthread_create(&thid, NULL, thread_test, NULL); |
| if(ret != 0){ |
| printf("pthread_create error!!!"); |
| return ret; |
| } |
| system("mdlogctl stop"); |
| system("echo mem > /sys/power/autosleep"); |
| system("echo 0 > /dev/wmtWifi"); |
| system("echo 7 9 0 > /proc/driver/wmt_dbg"); |
| /*Notify the modem to disable some URC reporting */ |
| ret = lynq_screen(0); |
| printf("ret %d\n", ret); |
| /*Notify the modem to disable some URC reporting */ |
| system("disown -a"); |
| if(thid == -1) |
| { |
| return -1; |
| } |
| ret = pthread_join(thid,NULL); |
| if(ret != 0){ |
| printf("pthread_join error!!!"); |
| return ret; |
| } |
| return 0; |
| } |
| #ifdef __cplusplus |
| } |
| #endif |