blob: 8218d485d09fbbadcaa8c5320308e56e3adab34b [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef CONFIG_MIN_8M_VERSION
2#include "ext_regist.h"
3#include "at_utils.h"
4#include "softap_api.h"
5
6static int ext_kwatcholw_fun(int at_fd, char *at_paras, void ** res_msg, int *res_msglen)
7{
8 char *at_str = malloc(32);
9 assert(at_str);
10 memset(at_str, 0x00, 32);
11
12 system("/bin/kwatch_ctrl -m 1 &");
13
14 sprintf(at_str, "\r\nOK\r\n");
15
16 *res_msg = at_str;
17 *res_msglen = strlen(at_str);
18 return AT_END;
19}
20static int ext_kwatchftw_fun(int at_fd, char *at_paras, void ** res_msg, int *res_msglen)
21{
22 char *at_str = malloc(32);
23 assert(at_str);
24 memset(at_str, 0x00, 32);
25
26 system("/bin/kwatch_ctrl -m 2 &");
27
28 sprintf(at_str, "\r\nOK\r\n");
29
30 *res_msg = at_str;
31 *res_msglen = strlen(at_str);
32 return AT_END;
33}
34
35int ext_kwatchtest_regist(void)
36{
37 register_serv_func2("kwatchtest-owl", MODULE_ID_KWATCH_CTRL, 0, 0, ext_kwatcholw_fun, NULL);
38 register_serv_func2("kwatchtest-ftw", MODULE_ID_KWATCH_CTRL, 0, 0, ext_kwatchftw_fun, NULL);
39 return 0;
40}
41#endif
42