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

Function at_client_get

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

* get AT client object by AT device name. * * @dev_name AT client device name * * @return AT client object */

Source from the content-addressed store, hash-verified

671 * @return AT client object
672 */
673at_client_t at_client_get(const char *dev_name)
674{
675 RT_ASSERT(dev_name);
676
677 rt_slist_t *node;
678 at_client_t client;
679
680 rt_base_t level = rt_hw_interrupt_disable();
681 rt_slist_for_each(node, &g_at_client_list)
682 {
683 client = rt_slist_entry(node, struct at_client, list);
684 if (rt_strcmp(client->device->parent.name, dev_name) == 0)
685 {
686 rt_hw_interrupt_enable(level);
687 return client;
688 }
689 }
690 rt_hw_interrupt_enable(level);
691
692 return RT_NULL;
693}
694
695/**
696 * get first AT client object in the table.

Callers 3

at_client_initFunction · 0.85
at_client_deInitFunction · 0.85
atFunction · 0.85

Calls 3

rt_strcmpFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected