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

Function at_recvpkt_node_delete

components/net/at/at_socket/at_socket.c:169–192  ·  view source on GitHub ↗

delete and free specified list block */

Source from the content-addressed store, hash-verified

167
168/* delete and free specified list block */
169static int at_recvpkt_node_delete(rt_slist_t *rlist, rt_slist_t *node)
170{
171 at_recv_pkt_t pkt = RT_NULL;
172
173 if (rt_slist_isempty(rlist))
174 {
175 return 0;
176 }
177
178 rt_slist_remove(rlist, node);
179
180 pkt = rt_slist_entry(node, struct at_recv_pkt, list);
181 if (pkt && pkt->buff)
182 {
183 rt_free(pkt->buff);
184 }
185 if (pkt)
186 {
187 rt_free(pkt);
188 pkt = RT_NULL;
189 }
190
191 return 0;
192}
193
194/* get a block from AT socket receive buffer list */
195static size_t at_recvpkt_get(rt_slist_t *rlist, char *mem, size_t len)

Callers 1

at_recvpkt_getFunction · 0.85

Calls 3

rt_slist_isemptyFunction · 0.85
rt_slist_removeFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected