48 memcpy(packet->
data + packet->
size, &packet->
crc,
sizeof(packet->
crc));
77 const uint8_t header_size =
sizeof(packet->
channel) +
sizeof(packet->
size);
99 < (header_size + packet->
size +
sizeof(packet->
crc))) {
112 memcpy(&packet->
crc, packet->
data + packet->
size,
sizeof(packet->
crc));
129 static const uint16_t internal_offset =
sizeof(packet->
channel) +
sizeof(packet->
size);
132 *offset = internal_offset;
134 return internal_offset +
sizeof(packet->
crc);
fpc_com_result_t fpc_com_link_transmit(fpc_com_packet_link_t *packet, fpc_com_chain_t *chain)
Sends a packet over the physical link in blocking mode.
uint8_t * phy_mtu_buffer[2]
fpc_com_result_t(* phy_rx)(uint16_t size, uint8_t *buffer, uint32_t timeout, void *session)
void * session
User session pointer. User private stuff, to be able to pass necessary info from the layer that calls...
uint32_t(* crc_calc)(uint32_t start, const void *data, uint32_t size)
uint16_t fpc_com_link_get_overhead(uint16_t *offset)
Returns the overhead of the layer.
fpc_com_result_t(* phy_tx)(uint16_t size, const uint8_t *buffer, uint32_t timeout, void *session)
fpc_com_channel_t channel
uint16_t fpc_com_channel_t
Communication link interface.
fpc_com_result_t fpc_com_link_receive(fpc_com_packet_link_t *packet, fpc_com_chain_t *chain)
Receives a packet from the physical link.