| 1082 | } |
| 1083 | |
| 1084 | int at_client_deInit(const char *dev_name) |
| 1085 | { |
| 1086 | int result = RT_EOK; |
| 1087 | at_client_t client = RT_NULL; |
| 1088 | |
| 1089 | RT_ASSERT(dev_name); |
| 1090 | |
| 1091 | client = at_client_get(dev_name); |
| 1092 | if (client == RT_NULL) |
| 1093 | { |
| 1094 | return RT_EOK; |
| 1095 | } |
| 1096 | |
| 1097 | rt_base_t level = rt_hw_interrupt_disable(); |
| 1098 | rt_slist_remove(&g_at_client_list, &client->list); |
| 1099 | rt_hw_interrupt_enable(level); |
| 1100 | |
| 1101 | rt_event_send(&client->event, at_client_deInit_event); |
| 1102 | rt_event_recv(&client->event, at_client_deInit_over_event, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, NULL); |
| 1103 | |
| 1104 | rt_event_detach(&client->event); |
| 1105 | rt_mutex_detach(&client->lock); |
| 1106 | |
| 1107 | result = rt_device_close(client->device); |
| 1108 | |
| 1109 | rt_free(client); |
| 1110 | return result; |
| 1111 | } |
| 1112 | #endif /* AT_USING_CLIENT */ |
nothing calls this directly
no test coverage detected