| 436 | } |
| 437 | |
| 438 | static 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 | |
| 463 | static void _long_handle_first(struct rt_link_frame *receive_frame) |
| 464 | { |
no test coverage detected