F439_CPP_TX-RX_LoRa_Project
Loading...
Searching...
No Matches
radio_link.c File Reference

RadioLink framing, crypto, replay, and persistence implementation. More...

#include "radio_link.h"
#include "stdio.h"
#include "memory.h"
Include dependency graph for radio_link.c:

Functions

bool RadioLink_BuildWireV3Frame (uint8_t *out, uint8_t outMax, uint8_t nodeId, uint32_t sessionSeqId, uint32_t msgCounter, const uint8_t *plain, uint8_t plainLen, uint8_t *outLen)
 Build a Wire v3 frame from plaintext input.
 
bool RadioLink_ParseWireV3Frame (const uint8_t *rx, uint8_t rxLen, uint8_t *outPlain, uint8_t outPlainMax, uint8_t *outPlainLen)
 Parse, authenticate, replay-check, and decrypt a Wire v3 frame.
 
bool RadioLink_SendString (SX1262_Handle *sx, const char *s)
 Send a string through RadioLink framing and crypto.
 
bool RadioLink_TryDecodeToString (const uint8_t *rx, uint8_t rx_len, char *out, uint8_t out_max)
 Decode a received Wire v3 frame into a NUL-terminated string.
 
bool RadioLink_SendBytes (SX1262_Handle *sx, const uint8_t *buf, uint8_t len)
 Send a raw byte payload through RadioLink framing and crypto.
 

Variables

CRYP_HandleTypeDef hcryp
 

Detailed Description

RadioLink framing, crypto, replay, and persistence implementation.

Function Documentation

◆ RadioLink_BuildWireV3Frame()

bool RadioLink_BuildWireV3Frame ( uint8_t * out,
uint8_t outMax,
uint8_t nodeId,
uint32_t sessionSeqId,
uint32_t msgCounter,
const uint8_t * plain,
uint8_t plainLen,
uint8_t * outLen )

Build a Wire v3 frame from plaintext input.

Parameters
outOutput frame buffer.
outMaxSize of the output frame buffer in bytes.
nodeIdSource node identifier.
sessionSeqIdSession sequence identifier.
msgCounterMonotonic message counter.
plainPlaintext payload buffer.
plainLenPlaintext payload length in bytes.
outLenOutput pointer for the final frame length.
Returns
true if the frame was built successfully, otherwise false.

◆ RadioLink_ParseWireV3Frame()

bool RadioLink_ParseWireV3Frame ( const uint8_t * rx,
uint8_t rxLen,
uint8_t * outPlain,
uint8_t outPlainMax,
uint8_t * outPlainLen )

Parse, authenticate, replay-check, and decrypt a Wire v3 frame.

Parameters
rxPointer to the received frame bytes.
rxLenNumber of bytes in the received frame.
outPlainOutput plaintext buffer.
outPlainMaxSize of the output plaintext buffer in bytes.
outPlainLenOutput pointer for the plaintext length.
Returns
true if the frame was accepted and decrypted, otherwise false.

◆ RadioLink_SendBytes()

bool RadioLink_SendBytes ( SX1262_Handle * sx,
const uint8_t * buf,
uint8_t len )

Send a raw byte payload through RadioLink framing and crypto.

Encrypt, authenticate, and send a raw byte payload.

◆ RadioLink_SendString()

bool RadioLink_SendString ( SX1262_Handle * sx,
const char * s )

Send a string through RadioLink framing and crypto.

Encrypt, authenticate, and send a string payload.

◆ RadioLink_TryDecodeToString()

bool RadioLink_TryDecodeToString ( const uint8_t * rx,
uint8_t rx_len,
char * out,
uint8_t out_max )

Decode a received Wire v3 frame into a NUL-terminated string.

Parse and decrypt a received Wire v3 frame into a string buffer.

Variable Documentation

◆ hcryp

CRYP_HandleTypeDef hcryp
extern