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

Function rt_link_short_handle

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

Source from the content-addressed store, hash-verified

436}
437
438static rt_err_t rt_link_short_handle(struct rt_link_frame *receive_frame)
439{
440 LOG_D("Seq(%d) short data", receive_frame->head.sequence);
441 rt_link_scb->rx_record.dataspace = rt_malloc(receive_frame->data_len);
442 if (rt_link_scb->rx_record.dataspace != RT_NULL)
443 {
444 if (receive_frame->head.ack)
445 {
446 rt_link_command_frame_send(receive_frame->head.service,
447 receive_frame->head.sequence,
448 RT_LINK_CONFIRM_FRAME, RT_NULL);
449 }
450 rt_link_scb->rx_record.rx_seq = receive_frame->head.sequence;
451 rt_link_hw_copy(rt_link_scb->rx_record.dataspace, receive_frame->real_data, receive_frame->data_len);
452 rt_link_recv_finish(receive_frame->head.service, rt_link_scb->rx_record.dataspace, receive_frame->data_len);
453 rt_link_scb->rx_record.dataspace = RT_NULL;
454 }
455 else
456 {
457 LOG_W("short data %dB alloc failed", receive_frame->data_len);
458 }
459 receive_frame->real_data = RT_NULL;
460 return 0;
461}
462
463static void _long_handle_first(struct rt_link_frame *receive_frame)
464{

Callers 1

rt_link_parse_frameFunction · 0.85

Calls 4

rt_mallocFunction · 0.85
rt_link_hw_copyFunction · 0.85
rt_link_recv_finishFunction · 0.85

Tested by

no test coverage detected