blob: 4d5c7ee1015e0353584a25fb23bbd8ea9860b9e6 [file] [log] [blame]
llb52a49f2022-09-05 00:23:18 -07001#include <stdio.h>
2#include <sys/types.h>
3#include <sys/socket.h>
4#include <arpa/inet.h>
5#include <string.h>
6#include <unistd.h>
7#include <binder/Parcel.h>
8#include <log/log.h>
9#include <cutils/jstring.h>
10#include <pthread.h>
11#include <sys/socket.h>
12#include <netinet/in.h>
13#include <arpa/inet.h>
14#include <errno.h>
15#include "lynq_timer.h"
jb.qia7620e72023-09-02 01:35:17 -070016#include <include/lynq_uci.h>
17
llb52a49f2022-09-05 00:23:18 -070018
19#define DEST_PORT 8088
20#define DSET_IP_ADDRESS "127.0.0.1"
ll892b6ef2022-09-08 06:45:34 -070021#define RIL_REQUEST_DEVICE_IDENTITY 98
llb52a49f2022-09-05 00:23:18 -070022#define MAX_LEN 1024
jb.qi3d1d9a42023-05-16 06:55:53 -070023#define TIMER 30
llb52a49f2022-09-05 00:23:18 -070024
jb.qia1a08a92023-10-16 02:32:00 -070025
26#define LOG_UCI_FILE "lynq_uci"
27#define LOG_UCI_MODULE "debug_mode"
28
llb52a49f2022-09-05 00:23:18 -070029using ::android::Parcel;
30
31static pthread_mutex_t g_lynq_sim_sendto_mutex;
32
33typedef struct{
34 int uToken;
35 int request;
36 int paramLen;
37 char param[MAX_LEN];
38}lynq_client_t;
39
jb.qia7620e72023-09-02 01:35:17 -070040int num = 0;
41
llb52a49f2022-09-05 00:23:18 -070042static int get_md_sta(void)
43{
44 FILE *fp;
jb.qia7620e72023-09-02 01:35:17 -070045 char buffer[64]={};
llb52a49f2022-09-05 00:23:18 -070046 fp = popen("cat /sys/kernel/ccci/boot","r");
47 if(fp == NULL)
48 {
ll892b6ef2022-09-08 06:45:34 -070049 RLOGD("function %s fp is null\n", __FUNCTION__);
ll2f5e1c82022-09-07 00:01:43 -070050 return 0;
51 }
llb52a49f2022-09-05 00:23:18 -070052 fgets(buffer,sizeof(buffer),fp);
ll892b6ef2022-09-08 06:45:34 -070053 if(!strlen(buffer))
54 {
55 RLOGD("function %s line %d\n", __FUNCTION__, __LINE__);
56 pclose(fp);
57 return 0;
58 }
llb52a49f2022-09-05 00:23:18 -070059 if(buffer[4] == '4')
60 {
61 pclose(fp);
62 return 1;
63 }
ll892b6ef2022-09-08 06:45:34 -070064 RLOGD("function %s line %d\n", __FUNCTION__, __LINE__);
llb52a49f2022-09-05 00:23:18 -070065 pclose(fp);
66 return 0;
67}
68
69static int check_service(const char *service)
70{
71 FILE *fp;
72 char buffer[1024]={};
73 if(!strcmp(service, "/usr/sbin/mtkfusionrild"))
74 {
75 fp = popen("ps -ef|grep rild","r");
76 }
77 else if(!strcmp(service, "lynq-ril-service"))
78 {
79 fp = popen("ps -ef|grep ril-service","r");
80 }
81 if(fp == NULL)
82 {
ll892b6ef2022-09-08 06:45:34 -070083 RLOGD("function %s fp is null\n", __FUNCTION__);
llb52a49f2022-09-05 00:23:18 -070084 return 0;
85 }
86 while(NULL != fgets(buffer,sizeof(buffer),fp))
87 {
88 if(strstr(buffer,service))
89 {
90 pclose(fp);
ll88c42532023-02-01 15:34:52 +080091 RLOGD("check_service 1\n");
llb52a49f2022-09-05 00:23:18 -070092 return 1;
93 }
94 }
ll88c42532023-02-01 15:34:52 +080095 RLOGD("check_service 0\n");
llb52a49f2022-09-05 00:23:18 -070096 pclose(fp);
97 return 0;
98}
99
100/**
jb.qi3d1d9a42023-05-16 06:55:53 -0700101 * @brief 30s request imei
llb52a49f2022-09-05 00:23:18 -0700102 *
103 * @param arg
104 * @return void*
105 */
106void * timer_request_imei(void * arg)
107{
108 int sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
109 if (-1 == sock_fd)
110 {
111 RLOGD("__FUNCTION__ %s create sock_fd failed %s\n", __FUNCTION__, strerror(errno));
112 /*set uci*/
113 /*socket abnormal*/
114 system("uci set lynq_uci.sdk_ready='3'");
115 /*set uci*/
116 return NULL;
117 }
lh8d290112023-10-22 20:53:06 -0700118 struct sockaddr_in liblynq_data_socket;
119 bzero(&liblynq_data_socket, sizeof(liblynq_data_socket));
120 //set this lib socket config
121 liblynq_data_socket.sin_family = AF_INET;
122 liblynq_data_socket.sin_addr.s_addr = inet_addr(DSET_IP_ADDRESS);
123 int ret = bind(sock_fd, (struct sockaddr *)&liblynq_data_socket, sizeof(liblynq_data_socket));
124 if (-1 == ret)
125 {
126 RLOGE("liblynq_data_socket bind fail,errno:%d",errno);
127 return NULL;
128 }
129
llb52a49f2022-09-05 00:23:18 -0700130 struct timeval timeOut;
131 timeOut.tv_sec = 3;//timeout time 3s
132 timeOut.tv_usec = 0;
133 if (setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, &timeOut, sizeof(timeOut)) < 0)
134 {
135 RLOGD("__FUNCTION__ %s time out setting failed %s\n", __FUNCTION__, strerror(errno));
136 /*set uci*/
137 /*socket abnormal*/
138 system("uci set lynq_uci.sdk_ready='3'");
139 /*set uci*/
140 return NULL;
141 }
jb.qi3d1d9a42023-05-16 06:55:53 -0700142 struct sockaddr_in addr_serv;
143 memset(&addr_serv, 0, sizeof(addr_serv));
144 addr_serv.sin_family = AF_INET;
145 addr_serv.sin_addr.s_addr = inet_addr(DSET_IP_ADDRESS);
146 addr_serv.sin_port = htons(DEST_PORT);
147 int len_addr_serv = sizeof(addr_serv);
llb52a49f2022-09-05 00:23:18 -0700148 int send_num = -1;
149 int recv_num = -1;
150 int resp_type = -1;
151 int request = -1;
152 int slot_id = -1;
llf0936572022-09-15 19:06:10 +0800153 int token = -1;
llb52a49f2022-09-05 00:23:18 -0700154 int res_error = -1;
155 lynq_client_t client_t;
156 char res_data[MAX_LEN] = {0};
ll892b6ef2022-09-08 06:45:34 -0700157 client_t.request = RIL_REQUEST_DEVICE_IDENTITY;
llb52a49f2022-09-05 00:23:18 -0700158 client_t.paramLen = 0;
159 client_t.uToken = 999;
160 memset(client_t.param, 0, sizeof(client_t.param));
161 while (1)
162 {
llb52a49f2022-09-05 00:23:18 -0700163 bzero(res_data, MAX_LEN);
164 pthread_mutex_lock(&g_lynq_sim_sendto_mutex);
jb.qi3d1d9a42023-05-16 06:55:53 -0700165 send_num = sendto(sock_fd, &client_t, sizeof(client_t), 0, (struct sockaddr *)&addr_serv, len_addr_serv);
ll88c42532023-02-01 15:34:52 +0800166 RLOGD("send_num %d\n", send_num);
llb52a49f2022-09-05 00:23:18 -0700167 if(send_num == 0)
168 {
169 RLOGD("__FUNCTION__ %s Close to end %s\n", __FUNCTION__, strerror(errno));
170 //unknow
171 system("uci set lynq_uci.sdk_ready='4'");
172 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
173 continue;
174 }
175 if(send_num < 0)
176 {
177 RLOGD("__FUNCTION__ %s sendto error %s\n", __FUNCTION__, strerror(errno));
178 //unknow
179 system("uci set lynq_uci.sdk_ready='4'");
180 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
181 continue;
182 }
183 //get data msg
jb.qi3d1d9a42023-05-16 06:55:53 -0700184 recv_num = recvfrom(sock_fd,res_data,sizeof(char)*MAX_LEN,0,(struct sockaddr *)&addr_serv,(socklen_t*)&len_addr_serv);
ll88c42532023-02-01 15:34:52 +0800185 RLOGD("recv_num %d\n", recv_num);
llb52a49f2022-09-05 00:23:18 -0700186 if(recv_num == 0)
187 {
188 RLOGD("__FUNCTION__ %s Close to end\n", __FUNCTION__);
189 //unknow
190 system("uci set lynq_uci.sdk_ready='4'");
191 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
lhcd37b7a2023-12-05 18:54:33 +0800192 continue;;
llb52a49f2022-09-05 00:23:18 -0700193 }
194 if(recv_num == -1 && errno == EAGAIN)
195 {
196 RLOGD("__FUNCTION__ %srecvfrom fail because timeout\n", __FUNCTION__);
197 /*set uci*/
198 if(!get_md_sta())
199 {
200 system("uci set lynq_uci.sdk_ready='1'");
201 }
202 else
203 {
204 if(check_service("/usr/sbin/mtkfusionrild"))//rild work
205 {
206 if(!check_service("lynq-ril-service"))//not find,must be socket error
207 {
208 system("uci set lynq_uci.sdk_ready='3'");
209 }
210 else
211 {
212 //unknow error
213 system("uci set lynq_uci.sdk_ready='4'");
214 }
215
216 }
217 else//rild no work
218 {
219 //unknow
220 system("uci set lynq_uci.sdk_ready='4'");
221 }
222 }
223 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
lhcd37b7a2023-12-05 18:54:33 +0800224 continue;;
llb52a49f2022-09-05 00:23:18 -0700225 }
226 if(recv_num < 0)
227 {
228 RLOGD("__FUNCTION__ %srecvfrom fail %s\n", __FUNCTION__, strerror(errno));
229 //unknow
230 system("uci set lynq_uci.sdk_ready='4'");
231 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
lhcd37b7a2023-12-05 18:54:33 +0800232 continue;;
llb52a49f2022-09-05 00:23:18 -0700233 }
234 Parcel p;
235 p.setData((uint8_t *)res_data,sizeof(char)*recv_num);
236 p.setDataPosition(0);
237 if(p.dataAvail() > 0)
238 {
239 p.readInt32(&resp_type);
llf0936572022-09-15 19:06:10 +0800240 p.readInt32(&token);
llb52a49f2022-09-05 00:23:18 -0700241 p.readInt32(&request);
242 p.readInt32(&slot_id);
243 p.readInt32(&res_error);
244 }
245 /*judge the res_error*/
246 if(!res_error)
247 {
ll892b6ef2022-09-08 06:45:34 -0700248 system("uci set lynq_uci.sdk_ready='0'");
llb52a49f2022-09-05 00:23:18 -0700249 }
250 else
251 {
ll892b6ef2022-09-08 06:45:34 -0700252 system("uci set lynq_uci.sdk_ready='2'"); //Md configurations are inconsistent with AP configurations
llb52a49f2022-09-05 00:23:18 -0700253 }
254 RLOGD("__FUNCTION__ %s res_error %d\n", __FUNCTION__, res_error);
255 /*judge the res_error*/
256 pthread_mutex_unlock(&g_lynq_sim_sendto_mutex);
ll2f5e1c82022-09-07 00:01:43 -0700257 sleep(TIMER);
llb52a49f2022-09-05 00:23:18 -0700258 }
259 return NULL;
260}
261
262
qjbd37f0902023-08-04 04:08:52 -0700263void delete_enter(char data[])
264{
265 char *find = strchr(data, '\n');
266 if(find)
267 *find = '\0';
268 return ;
qjbdeea8452023-08-03 06:35:43 -0700269}
270
jb.qia1a08a92023-10-16 02:32:00 -0700271
qjbdeea8452023-08-03 06:35:43 -0700272void *check(void * arg)
273{
274
275 char pid[200][8];
qjbd37f0902023-08-04 04:08:52 -0700276 char ffd[200][4];
qjbdeea8452023-08-03 06:35:43 -0700277 char buf[64];
278 char check_time[4];
279 char timebuf[32];
qjbd37f0902023-08-04 04:08:52 -0700280 int num = 1;
281 int i=0;
qjbdeea8452023-08-03 06:35:43 -0700282 int j;
283 FILE *fp,*fp_1;
284 int ret;
285
286 RLOGD("check cpu/pid/interrupts/fd!!!\n");
qjbd37f0902023-08-04 04:08:52 -0700287 system("mkdir /media/check_file");
qjbdeea8452023-08-03 06:35:43 -0700288 system("touch /media/check_time");
289 fp_1 = popen("cat /media/check_time","r");
290 if(fgets(check_time, 4, fp_1) != NULL)
291 {
292 num = atoi(check_time);
293 }
294 pclose(fp_1);
295 while(1)
296 {
297 i = 0;
298 system("date >>/media/check_file/cpu_moniter.txt");
299 ret = system("top -b |head -n 25 >>/media/check_file/cpu_moniter.txt");
300 RLOGD("cpu ret %d", ret);
301 system("date >>/media/check_file/inter_moniter.txt");
qjbd37f0902023-08-04 04:08:52 -0700302 ret = system("cat /proc/interrupts |grep -v \": 0 0\" >>/media/check_file/inter_moniter.txt");
qjbdeea8452023-08-03 06:35:43 -0700303 RLOGD("interrupts ret %d", ret);
jb.qibad810e2023-08-29 03:55:18 -0700304
qjbdeea8452023-08-03 06:35:43 -0700305 system("date >>/media/check_file/pid_moniter.txt");
306 ret = system("ps -eo \"%p %a\" | grep -v \"\\[\" >>/media/check_file/pid_moniter.txt");
307 RLOGD("pid ret %d", ret);
qjbdeea8452023-08-03 06:35:43 -0700308
jb.qibad810e2023-08-29 03:55:18 -0700309 system("date >>/media/check_file/meminfo_moniter.txt");
310 ret = system("cat /proc/meminfo >>/media/check_file/meminfo_moniter.txt");
311 RLOGD("meminfo ret %d", ret);
312
313 system("date >>/media/check_file/buddyinfo_moniter.txt");
314 ret = system("cat /proc/buddyinfo >>/media/check_file/buddyinfo_moniter.txt");
315 RLOGD("buddyinfo ret %d", ret);
316
317 system("date >>/media/check_file/ps_auxw_moniter.txt");
318 ret = system("ps -auxw|grep -v \"0.0 0.0\"|grep -v \"0.1 0.0\"|grep -v \"0.0 0.1\" >>/media/check_file/ps_auxw_moniter.txt");
319 RLOGD("ps_auxw ret %d", ret);
320
321 system("date >>/media/check_file/cur_freq_moniter.txt");
322 ret = system("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq >>/media/check_file/cur_freq_moniter.txt");
323 RLOGD("cur_freq ret %d", ret);
324
325 system("date >>/media/check_file/available_frequencies_moniter.txt");
326 ret = system("cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies >>/media/check_file/available_frequencies_moniter.txt");
327 RLOGD("available_frequencies ret %d", ret);
328
329 system("date >>/media/check_file/fd_moniter.txt");
qjbdeea8452023-08-03 06:35:43 -0700330 fp = popen("ps -eo \"%p %a\" | grep -v \"\\[\"|awk '{print $1}'","r");
331 while(fgets(pid[i], 8, fp) != NULL)
332 {
333 delete_enter(pid[i]);
334 i++;
335 }
336 pclose(fp);
337
338 for(j=1;j<i;j++)
339 {
340 sprintf(buf, "ls /proc/%s/fd | wc -l", pid[j]);
341 fp = popen(buf, "r");
342 fgets(ffd[j], 4, fp);
343 sprintf(buf,"echo \"pid: %s, fd_num: %s\" >>/media/check_file/fd_moniter.txt",pid[j], ffd[j]);
344 system(buf);
345 pclose(fp);
346 }
qjbd37f0902023-08-04 04:08:52 -0700347
jb.qibad810e2023-08-29 03:55:18 -0700348 if(num > 228)
qjbd37f0902023-08-04 04:08:52 -0700349 {
350 system("cp /media/check_file/cpu_moniter.txt /media/check_file/cpu_moniter_1.txt");
jb.qibad810e2023-08-29 03:55:18 -0700351 system("cp /media/check_file/inter_moniter.txt /media/check_file/inter_moniter_1.txt");
qjbd37f0902023-08-04 04:08:52 -0700352 system("cp /media/check_file/pid_moniter.txt /media/check_file/pid_moniter_1.txt");
353 system("cp /media/check_file/fd_moniter.txt /media/check_file/fd_moniter_1.txt");
jb.qibad810e2023-08-29 03:55:18 -0700354 system("cp /media/check_file/fd_moniter.txt /media/check_file/meminfo_moniter_1.txt");
355 system("cp /media/check_file/fd_moniter.txt /media/check_file/buddyinfo_moniter_1.txt");
356 system("cp /media/check_file/fd_moniter.txt /media/check_file/ps_auxw_moniter_1.txt");
357 system("cp /media/check_file/fd_moniter.txt /media/check_file/cur_freq_moniter_1.txt");
358 system("cp /media/check_file/fd_moniter.txt /media/check_file/available_frequencies_moniter_1.txt");
359
360
qjbd37f0902023-08-04 04:08:52 -0700361 system("rm -rf /media/check_file/cpu_moniter.txt");
362 system("rm -rf /media/check_file/inter_moniter.txt");
363 system("rm -rf /media/check_file/pid_moniter.txt");
364 system("rm -rf /media/check_file/fd_moniter.txt");
jb.qibad810e2023-08-29 03:55:18 -0700365 system("rm -rf /media/check_file/meminfo_moniter.txt");
366 system("rm -rf /media/check_file/buddyinfo_moniter.txt");
367 system("rm -rf /media/check_file/ps_auxw_moniter.txt");
368 system("rm -rf /media/check_file/cur_freq_moniter.txt");
369 system("rm -rf /media/check_file/available_frequencies_moniter.txt");
370
qjbd37f0902023-08-04 04:08:52 -0700371 num = 0;
372 }
qjbdeea8452023-08-03 06:35:43 -0700373 num++;
374 sprintf(timebuf, "echo \"%d\" >/media/check_time", num);
375 ret = system(timebuf);
qjbdeea8452023-08-03 06:35:43 -0700376 sleep(300);
qjbdeea8452023-08-03 06:35:43 -0700377 }
jb.qia1a08a92023-10-16 02:32:00 -0700378 return NULL;
qjbdeea8452023-08-03 06:35:43 -0700379
qjbdeea8452023-08-03 06:35:43 -0700380}
jb.qia1a08a92023-10-16 02:32:00 -0700381
qjbdeea8452023-08-03 06:35:43 -0700382
jb.qia7620e72023-09-02 01:35:17 -0700383void *check_uci(void * arg)
384{
385 int ret[6];
386 int result = 0;
387 int flag = 0;
388
389 char uci_0[]="/etc/config/lynq_uci";
390 char uci_1[]="/etc/config/lynq_uci_ro";
391 char uci_2[]="/etc/config/mdlog";
392 char uci_3[]="/etc/config/radio_property";
393 char uci_4[]="/etc/config/service";
394 char uci_5[]="/etc/config/usb";
395 RLOGD("start check uci\n");
396 while(num++ < 4)
397 {
398 RLOGD("@@@@@@@num=%d\n", num);
399 flag = 0;
jb.qi23d0d4b2023-11-20 03:25:08 -0800400 ret[0] = system("uci show | grep \"lynq_uci.lynq_ril\" > /dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700401 if(ret[0] != 0)
402 {
403 RLOGD("lynq_uci unload\n");
404 flag = 1;
405 }
406
jb.qi23d0d4b2023-11-20 03:25:08 -0800407 ret[1] = system("uci show | grep \"^lynq_uci_ro\.\" > /dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700408 if(ret[1] != 0)
409 {
410 RLOGD("lynq_uci_ro unload\n");
411 flag = 1;
412 }
413
414 ret[2] = system("uci show | grep \"^mdlog\.\"");
415 if(ret[2] != 0)
416 {
417 RLOGD("mdlog unload\n");
418 flag = 1;
419 }
420
jb.qi23d0d4b2023-11-20 03:25:08 -0800421 ret[3] = system("uci show | grep \"^radio_property\.\" > /dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700422 if(ret[3] != 0)
423 {
424 RLOGD("radio_property unload\n");
425 flag = 1;
426 }
427
jb.qi23d0d4b2023-11-20 03:25:08 -0800428 ret[4] = system("uci show | grep \"^service\.\" > /dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700429 if(ret[4] != 0)
430 {
431 RLOGD("service unload\n");
432 flag = 1;
433 }
434
jb.qi23d0d4b2023-11-20 03:25:08 -0800435 ret[5] = system("uci show | grep \"^usb\.\" > /dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700436 if(ret[5] != 0)
437 {
438 RLOGD("usb unload\n");
439 flag = 1;
440 }
441
442 RLOGD("flag=%d\n",flag);
443 if(flag != 0)
444 {
445 RLOGD("config reload\n");
446 result = chdir("/data_backup/");
jb.qi23d0d4b2023-11-20 03:25:08 -0800447 result =system("tar -zxvf userdata.tar.gz -C /STATE/ >/dev/null");
jb.qia7620e72023-09-02 01:35:17 -0700448 if(result!= 0)
449 {
450 RLOGD("cp config fail\n");
451 }
452 if(ret[0] != 0)
453 {
454 lynq_load_config(uci_0);
455 RLOGD("reload lynq_uci\n");
456 system("systemctl start autosuspend");
457 }
458 if(ret[1] != 0)
459 {
460 lynq_load_config(uci_1);
461 RLOGD("reload lynq_uci_ro\n");
462 }
463 if(ret[2] != 0)
464 {
465 lynq_load_config(uci_2);
466 RLOGD("reload mdlog\n");
467 }
468 if(ret[3] != 0)
469 {
470 lynq_load_config(uci_3);
471 RLOGD("reload radio_property\n");
472 system("systemctl restart mtkfusionrild");
473 }
474 if(ret[4] != 0)
475 {
476 lynq_load_config(uci_4);
477 RLOGD("reload service\n");
478 }
479 if(ret[5] != 0)
480 {
481 lynq_load_config(uci_5);
482 RLOGD("reload usb\n");
483 }
484 }
485 else
486 {
487 RLOGD("uci check success, exit check!\n");
488 break;
489 }
490 sleep(2);
491 }
jb.qia1a08a92023-10-16 02:32:00 -0700492 return NULL;
jb.qia7620e72023-09-02 01:35:17 -0700493}
494
495
jb.qibad810e2023-08-29 03:55:18 -0700496
llb52a49f2022-09-05 00:23:18 -0700497void start_timer_request(void)
498{
jb.qia7620e72023-09-02 01:35:17 -0700499 pthread_t thid,thid_1,thid_2;
llb52a49f2022-09-05 00:23:18 -0700500 pthread_attr_t a;
501 pthread_attr_init(&a);
502 pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
qjbdeea8452023-08-03 06:35:43 -0700503
jb.qia1a08a92023-10-16 02:32:00 -0700504 char tmp[20];
505 int debug_mode;
506 int ret;
507
508 ret = pthread_create(&thid, &a, timer_request_imei, NULL);
llb52a49f2022-09-05 00:23:18 -0700509 if(ret != 0){
510 RLOGD("pthread_create error!!!");
511 return;
512 }
jb.qieb2cc522023-08-18 01:45:07 +0800513 sleep(20);
jb.qia1a08a92023-10-16 02:32:00 -0700514 ret = lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "sysinfo_debug_status", tmp);
515 RLOGD("ret =%d, tmp is %s\n", ret, tmp);
516 debug_mode=atoi(tmp);
517 RLOGD("debug_mode is %d!!!\n", debug_mode);
518 if(debug_mode == 1)
519 {
520 RLOGD("debug_mode is 1, pthread_create start!!!\n");
521 ret = pthread_create(&thid_1, NULL, check, NULL);
522 if(ret != 0)
523 {
524 RLOGD("pthread_create error!!!");
525 return;
526 }
527
qjbdeea8452023-08-03 06:35:43 -0700528 }
jb.qia1a08a92023-10-16 02:32:00 -0700529
530
jb.qia7620e72023-09-02 01:35:17 -0700531
532 ret = pthread_create(&thid_2,NULL,check_uci,NULL);
533 if(ret != 0){
534 RLOGD("pthread_create error!!!");
535 return;
536 }
537 pthread_detach(thid_2);
llb52a49f2022-09-05 00:23:18 -0700538 return;
539}
540