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

Function _chn0_echo_with

components/vbus/vbus.c:611–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609}
610
611static rt_err_t _chn0_echo_with(rt_uint8_t prefix,
612 rt_uint32_t dsize,
613 unsigned char *dp)
614{
615 rt_err_t err;
616 unsigned char *resp;
617
618 resp = rt_malloc(dsize+1);
619 if (!resp)
620 return -RT_ENOMEM;
621 *resp = prefix;
622 rt_memcpy(resp+1, dp, dsize);
623 vbus_verbose("%s --> remote\n", dump_cmd_pkt(resp, dsize+1));
624
625 err = _chn0_post(resp, dsize+1, RT_WAITING_FOREVER);
626
627 rt_free(resp);
628
629 return err;
630}
631
632static rt_err_t _chn0_nak(rt_uint32_t dsize, unsigned char *dp)
633{

Callers 2

_chn0_nakFunction · 0.85
_chn0_ackFunction · 0.85

Calls 5

rt_mallocFunction · 0.85
rt_memcpyFunction · 0.85
dump_cmd_pktFunction · 0.85
_chn0_postFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected