blob: 1842b2af67a200442a2aa03fd061fdc466abac28 [file] [log] [blame]
liuyangf01f2772024-10-18 16:33:46 +08001#include "sta_cli.h"
2
3#include <stdio.h>
4#include <stdlib.h>
5
6
7#define STA_BUF_SIZE 2048
8
9
10int main(int argc, char *argv[])
11{
12 static char sta_cli_buf[STA_BUF_SIZE] = "OPEN";
13 char reply[STA_BUF_SIZE];
14
15
16 if(sta_cli_cmd_parse(sta_cli_buf, reply, STA_BUF_SIZE)){
17 if(strlen(reply) > 0)
18 {
19 printf("reply data(%s).\n",reply);
20 }else{
21 printf("No reply data(%s).\n",sta_cli_buf);
22 }
23 }else{
24 printf("Parse cmd fail.\n");
25 }
26
27
28 if(sta_cli_cmd_parse("ADD_NETWORK", reply, STA_BUF_SIZE))
29 {
30 if(strlen(reply) > 0)
31 {
32 printf("reply data(%s).\n",reply);
33 }else
34 {
35 printf("No reply data\n");
36 }
37 }
38 else
39 {
40 printf("Parse cmd fail.\n");
41 }
42
43
44 if(sta_cli_cmd_parse("SELECT_NETWORK", reply, STA_BUF_SIZE))
45 {
46 if(strlen(reply) > 0)
47 {
48 printf("reply data(%s).\n",reply);
49 }else
50 {
51 printf("No reply data\n");
52 }
53 }
54 else
55 {
56 printf("Parse cmd fail.\n");
57 }
58
59 if(sta_cli_cmd_parse("ENABLE_NETWORK", reply, STA_BUF_SIZE))
60 {
61 if(strlen(reply) > 0)
62 {
63 printf("reply data(%s).\n",reply);
64 }else
65 {
66 printf("No reply data\n");
67 }
68 }
69 else
70 {
71 printf("Parse cmd fail.\n");
72 }
73
74 system("udhcpc -i wlan0");
75
76
77
78 return 0;
79}
80