Host Communication Protocol  2.0
fpc_com_link.h File Reference

Communication link interface. More...

#include <stdbool.h>
#include <stdint.h>
#include "fpc_com_result.h"
#include "fpc_com_chain.h"
Include dependency graph for fpc_com_link.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
uint16_t fpc_com_link_get_overhead (uint16_t *offset)
 Returns the overhead of the layer. More...
 

Detailed Description

Communication link interface.

Definition in file fpc_com_link.h.

Function Documentation

uint16_t fpc_com_link_get_overhead ( uint16_t *  offset)

Returns the overhead of the layer.

Parameters
[out]offsetThe offset to the packet data.
Returns
Overhead size in bytes.

Definition at line 126 of file fpc_com_link.c.

References fpc_com_packet_link::channel, fpc_com_packet_link::crc, and fpc_com_packet_link::size.

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.

Parameters
[in]packetPacket to transmit.
[in]chainThe communication chain to use.
Returns
fpc_com_result_t

Definition at line 27 of file fpc_com_link.c.

References fpc_com_packet_link::channel, fpc_com_packet_link::crc, fpc_com_chain::crc_calc, fpc_com_packet_link::data, FPC_COM_ACK, FPC_COM_CHAIN_TX, fpc_com_link_get_overhead(), FPC_COM_RESULT_INVALID_ARGUMENT, FPC_COM_RESULT_IO_ERROR, FPC_COM_RESULT_OK, FPC_COM_RESULT_TIMEOUT, fpc_com_chain::phy_mtu_buffer, fpc_com_chain::phy_rx, fpc_com_chain::phy_timeout_rx, fpc_com_chain::phy_timeout_tx, fpc_com_chain::phy_tx, fpc_com_chain::session, and fpc_com_packet_link::size.

Here is the call graph for this function: