F439_CPP_TX-RX_LoRa_Project

Loading...
Searching...
No Matches
Functions | Variables
radio_link.c File Reference
Firmware Architecture » RadioLink Protocol Layer

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

  out | Output frame buffer.
  outMax | Size of the output frame buffer in bytes.
  nodeId | Source node identifier.
  sessionSeqId | Session sequence identifier.
  msgCounter | Monotonic message counter.
  plain | Plaintext payload buffer.
  plainLen | Plaintext payload length in bytes.
  outLen | Output 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

  rx | Pointer to the received frame bytes.
  rxLen | Number of bytes in the received frame.
  outPlain | Output plaintext buffer.
  outPlainMax | Size of the output plaintext buffer in bytes.
  outPlainLen | Output 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