MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / server_cli_parser

Function server_cli_parser

components/net/at/src/at_cli.c:109–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static void server_cli_parser(void)
110{
111 extern at_server_t at_get_server(void);
112
113 at_server_t server = at_get_server();
114 rt_base_t level;
115 static rt_device_t device_bak;
116 static rt_err_t (*getchar_bak)(struct at_server *server, char *ch, rt_int32_t timeout);
117
118 /* backup server device and getchar function */
119 {
120 level = rt_hw_interrupt_disable();
121
122 device_bak = server->device;
123 getchar_bak = server->get_char;
124
125 /* setup server device as console device */
126 server->device = rt_console_get_device();
127 server->get_char = at_server_console_getchar;
128
129 rt_hw_interrupt_enable(level);
130 }
131
132 if (server)
133 {
134 rt_kprintf("======== Welcome to using RT-Thread AT command server cli ========\n");
135 rt_kprintf("Input your at command for test server. Press 'ESC' to exit.\n");
136 server->parser_entry(server);
137 }
138 else
139 {
140 rt_kprintf("AT client not initialized\n");
141 }
142
143 /* restore server device and getchar function */
144 {
145 level = rt_hw_interrupt_disable();
146
147 server->device = device_bak;
148 server->get_char = getchar_bak;
149
150 rt_hw_interrupt_enable(level);
151 }
152}
153#endif /* AT_USING_SERVER */
154
155#ifdef AT_USING_CLIENT

Callers 1

atFunction · 0.85

Calls 5

at_get_serverFunction · 0.85
rt_console_get_deviceFunction · 0.85
rt_kprintfFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected