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

Function recv_cb

components/utilities/rt-link/src/rtlink_dev.c:198–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198static void recv_cb(struct rt_link_service *service, void *data, rt_size_t size)
199{
200 RT_ASSERT(service != RT_NULL);
201 struct rt_link_device *rtlink = (struct rt_link_device *)service->user_data;
202
203 if (rtlink)
204 {
205 struct rtlink_recv_list *node = rt_malloc(sizeof(struct rtlink_recv_list));
206 node->data = data;
207 node->size = size;
208 node->index = 0;
209 rt_slist_append(&rtlink->recv_head, &node->list);
210 rt_link_event_send(service);
211
212 if (rtlink->parent.rx_indicate)
213 {
214 rtlink->parent.rx_indicate(&rtlink->parent, size);
215 }
216 }
217 else
218 {
219 rt_free(data);
220 }
221}
222
223rt_err_t rt_link_dev_init(rt_device_t dev)
224{

Callers

nothing calls this directly

Calls 4

rt_mallocFunction · 0.85
rt_slist_appendFunction · 0.85
rt_link_event_sendFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected