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

Function at_client_deInit

components/net/at/src/at_client.c:1084–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1082}
1083
1084int 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 */

Callers

nothing calls this directly

Calls 10

at_client_getFunction · 0.85
rt_slist_removeFunction · 0.85
rt_event_sendFunction · 0.85
rt_event_recvFunction · 0.85
rt_event_detachFunction · 0.85
rt_mutex_detachFunction · 0.85
rt_device_closeFunction · 0.85
rt_freeFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected