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

Function dump_cmd_pkt

components/vbus/vbus.c:587–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585
586static char _cmd_dump_buf[64];
587static char* dump_cmd_pkt(unsigned char *dp, size_t dsize)
588{
589 size_t len;
590
591 if (dp[0] == RT_VBUS_CHN0_CMD_ACK || dp[0] == RT_VBUS_CHN0_CMD_NAK )
592 {
593 len = rt_snprintf(_cmd_dump_buf, sizeof(_cmd_dump_buf),
594 "%s ", rt_vbus_cmd2str[dp[0]]);
595 len += __dump_naked_cmd(_cmd_dump_buf+len, sizeof(_cmd_dump_buf)-len,
596 dp+1, dsize-1);
597 }
598 else
599 {
600 len = __dump_naked_cmd(_cmd_dump_buf, sizeof(_cmd_dump_buf),
601 dp, dsize);
602 }
603
604 if (len > sizeof(_cmd_dump_buf) - 1)
605 len = sizeof(_cmd_dump_buf) - 1;
606
607 _cmd_dump_buf[len] = '\0';
608 return _cmd_dump_buf;
609}
610
611static rt_err_t _chn0_echo_with(rt_uint8_t prefix,
612 rt_uint32_t dsize,

Callers 6

rt_vbus_data_pushFunction · 0.85
rt_vbus_data_popFunction · 0.85
_chn0_echo_withFunction · 0.85
_chn0_actorFunction · 0.85
rt_vbus_request_chnFunction · 0.85
rt_vbus_close_chnFunction · 0.85

Calls 2

rt_snprintfFunction · 0.85
__dump_naked_cmdFunction · 0.85

Tested by

no test coverage detected