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

Function at_recvpkt_put

components/net/at/at_socket/at_socket.c:119–137  ·  view source on GitHub ↗

get a block to the AT socket receive list*/

Source from the content-addressed store, hash-verified

117
118/* get a block to the AT socket receive list*/
119static rt_err_t at_recvpkt_put(rt_slist_t *rlist, const char *ptr, size_t length)
120{
121 at_recv_pkt_t pkt = RT_NULL;
122
123 pkt = (at_recv_pkt_t) rt_calloc(1, sizeof(struct at_recv_pkt));
124 if (pkt == RT_NULL)
125 {
126 LOG_E("No memory for receive packet table!");
127 return -RT_ENOMEM;
128 }
129
130 pkt->bfsz_totle = length;
131 pkt->bfsz_index = 0;
132 pkt->buff = (char *) ptr;
133
134 rt_slist_append(rlist, &pkt->list);
135
136 return RT_EOK;
137}
138
139/* delete and free all receive buffer list */
140static int at_recvpkt_all_delete(rt_slist_t *rlist)

Callers 2

at_connect_notice_cbFunction · 0.85
at_recv_notice_cbFunction · 0.85

Calls 2

rt_callocFunction · 0.85
rt_slist_appendFunction · 0.85

Tested by

no test coverage detected