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

Function _long_handle_first

components/utilities/rt-link/src/rtlink.c:463–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static void _long_handle_first(struct rt_link_frame *receive_frame)
464{
465 if (receive_frame->extend.parameter % RT_LINK_MAX_DATA_LENGTH == 0)
466 {
467 receive_frame->total = receive_frame->extend.parameter / RT_LINK_MAX_DATA_LENGTH;
468 }
469 else
470 {
471 receive_frame->total = receive_frame->extend.parameter / RT_LINK_MAX_DATA_LENGTH + 1;
472 }
473
474 rt_link_scb->rx_record.total = receive_frame->total;
475 rt_link_scb->rx_record.dataspace = rt_malloc(receive_frame->extend.parameter);
476 if (rt_link_scb->rx_record.dataspace == RT_NULL)
477 {
478 LOG_W("long data (%dB) alloc failed.", receive_frame->extend.parameter);
479 }
480}
481
482static void _long_handle_second(struct rt_link_frame *receive_frame)
483{

Callers 1

rt_link_long_handleFunction · 0.85

Calls 1

rt_mallocFunction · 0.85

Tested by

no test coverage detected