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

Function at_do_event_changes

components/net/at/at_socket/at_socket.c:241–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void at_do_event_changes(struct at_socket *sock, at_event_t event, rt_bool_t is_plus)
242{
243 switch (event)
244 {
245 case AT_EVENT_SEND:
246 {
247 if (is_plus)
248 {
249 sock->sendevent = 1;
250
251#ifdef SAL_USING_POSIX
252 rt_wqueue_wakeup(&sock->wait_head, (void*) POLLOUT);
253#endif
254 }
255 else if (sock->sendevent)
256 {
257 sock->sendevent = 0;
258 }
259 break;
260 }
261 case AT_EVENT_RECV:
262 {
263 if (is_plus)
264 {
265 sock->rcvevent++;
266
267#ifdef SAL_USING_POSIX
268 rt_wqueue_wakeup(&sock->wait_head, (void*) POLLIN);
269#endif
270 }
271 else if (sock->rcvevent)
272 {
273 sock->rcvevent --;
274 }
275 break;
276 }
277 case AT_EVENT_ERROR:
278 {
279 if (is_plus)
280 {
281 sock->errevent++;
282
283#ifdef SAL_USING_POSIX
284 rt_wqueue_wakeup(&sock->wait_head, (void*) POLLERR);
285#endif
286 }
287 else if (sock->errevent)
288 {
289 sock->errevent --;
290 }
291 break;
292 }
293 default:
294 LOG_E("Not supported event (%d)", event);
295 }
296}
297
298static void at_do_event_clean(struct at_socket *sock, at_event_t event)

Callers 8

at_connect_notice_cbFunction · 0.85
at_recv_notice_cbFunction · 0.85
at_closed_notice_cbFunction · 0.85
at_listenFunction · 0.85
at_connectFunction · 0.85
at_acceptFunction · 0.85
at_recvfromFunction · 0.85
at_sendtoFunction · 0.85

Calls 1

rt_wqueue_wakeupFunction · 0.85

Tested by

no test coverage detected