| 239 | } |
| 240 | |
| 241 | static 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 | |
| 298 | static void at_do_event_clean(struct at_socket *sock, at_event_t event) |
no test coverage detected