KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
SRP or Simple Retransmission Protocol is a protocol which retransmits packets if they have not been confirmed within a predefined time. More...
Go to the source code of this file.
Data Structures | |
struct | SrpHeader |
Header used by SRP protocol. More... | |
Macros | |
#define | SRP_MAX_SIZE 1028 |
Maximum size of one SRP message. More... | |
#define | SRP_TX_QUEUE_SIZE ( SRP_MAX_SIZE * 3 ) |
Transmit queue buffer size. More... | |
#define | SRP_TX_MAX_QUEUE 32 |
Allow up to 32 items on the TX queue. | |
#define | SRP_RESEND_TIMEOUT 200 |
Resend time-out in ms. | |
#define | SRP_RESEND_MAX 6 |
Max number of resends. | |
#define | SRP_RX_MAX_CACHE 48 |
Max receive confirms. | |
#define | SRP_FLG_MSG BIT(0) |
Contains message. | |
#define | SRP_FLG_DONTACK BIT(1) |
No ack required. | |
#define | SRP_FLG_ACK_SHIFT 4 |
Shift for the number of acks. | |
#define | SRP_FLG_ACK_MASK 0x30 |
Mask for the number of acks. | |
#define | SRP_MAX_PAYLOAD ( SRP_MAX_SIZE - sizeof(SrpHeader) ) |
maximum size of the payload of a SRP message. | |
#define | SRP_MAX_ACKS 2 |
Maximum number of acknowledges. More... | |
Functions | |
void | srpDumpStatus () |
Outputs SRP status information. | |
void | _srpUdpTx (SockAddr *txAddr, uint8_t *udpPayload, int len) |
Transmit UDP packet. More... | |
void | _srpRx (SockAddr *rxAddr, uint8_t *message, int len) |
Process a received SRP packet. More... | |
void | _srpLost (SockAddr *addr, uint8_t msgId) |
Stub, invoked when an SRP message is lost. More... | |
void | srpInit () |
Initializes the SRP protocol engine. More... | |
void | srpUdpRx (SockAddr *rxAddr, uint8_t *udpPayload, int len) |
Invoked by UDP stack for receiving a SRP packet. More... | |
bool | srpTx (SockAddr *txAddr, uint8_t *message, int len) |
Invoked by application for sending an SRP packet. More... | |
void | srpProcess () |
Should be called periodically to process any pending requests. | |
SRP or Simple Retransmission Protocol is a protocol which retransmits packets if they have not been confirmed within a predefined time.
When a packet is lost, i.e. it has not been confirmed within a certain time, after multiple sends, it will notify the sender that the packet did not make it.
SRP is an asynchronous protocol, multiple packets may be in processing, being send but not confirmed. when replying the acknowledge of the sender may be in the receiving packets.
Definition in file srp.h.
#define SRP_TX_QUEUE_SIZE ( SRP_MAX_SIZE * 3 ) |
void _srpLost | ( | SockAddr * | addr, |
uint8_t | msgId | ||
) |
void _srpRx | ( | SockAddr * | addr, |
uint8_t * | message, | ||
int | len | ||
) |
Process a received SRP packet.
Invoked by SRP when a SRP packet has been received.
This is a callback and must be implemented by the protocol stack.
rxAddr | The address of the sender. |
message | The message to parse. |
len | The length of the message. |
Process a received SRP packet.
void _srpUdpTx | ( | SockAddr * | txAddr, |
uint8_t * | udpPayload, | ||
int | len | ||
) |
Transmit UDP packet.
Invoked by SRP when its done formatting a packet.
This is a callback and must be implemented by the protocol stack.
txAddr | The addresss to send to. |
udpPayload | The payload to transmit. |
len | The length of the payload. |
Transmit UDP packet.
void srpInit | ( | ) |
bool srpTx | ( | SockAddr * | txAddr, |
uint8_t * | message, | ||
int | len | ||
) |
void srpUdpRx | ( | SockAddr * | rxAddr, |
uint8_t * | udpPayload, | ||
int | len | ||
) |