|
F439_CPP_TX-RX_LoRa_Project
|
RadioLink framing, crypto, replay, and persistence interface. More...
#include <main.h>#include <stdint.h>#include <stdbool.h>#include "ada1897_mb85rs64b.h"#include "sx1262.h"#include "radio_wire.h"

Go to the source code of this file.
Data Structures | |
| struct | radioLinkCryptoCtx_t |
| Runtime crypto context for RadioLink key material. More... | |
Macros | |
| #define | RADIOLINK_CRYPTO_ENABLE (1) |
| #define | RADIOLINK_DEBUG_TAMPER_ENABLE 0 |
| #define | RADIOLINK_DEBUG_REPLAY_REJECT_ENABLE 0 |
| #define | RADIOLINK_DEBUG_TX_REPLAY_ONESHOT_ENABLE 0 |
| #define | RL_PERSIST_ENABLE 1 |
| #define | RL_PERSIST_DISABLE_WHEN_DEBUGGER 1 |
| #define | RADIOLINK_WIRE_V3_HDR_LEN (RADIOLINK_WIRE_V3_HDR_LEN_DERIVED) |
| Fixed Wire v3 header length in bytes. | |
| #define | RADIOLINK_W3_VERSION (RADIOLINK_WIRE_V3_VERSION) |
| #define | RADIOLINK_W3_HDR_LEN (RADIOLINK_WIRE_V3_HDR_LEN_DERIVED) |
| #define | RADIOLINK_W3_TAG_LEN (RADIOLINK_WIRE_V3_TAG_LEN) |
Typedefs | |
| typedef struct radioLinkCryptoCtx_t | radioLinkCryptoCtx_t |
| Runtime crypto context for RadioLink key material. | |
Functions | |
| bool | RadioLink_SendString (SX1262_Handle *sx, const char *s) |
| Encrypt, authenticate, and send a string payload. | |
| bool | RadioLink_TryDecodeToString (const uint8_t *rx, uint8_t rx_len, char *out, uint8_t out_max) |
| Parse and decrypt a received Wire v3 frame into a string buffer. | |
| bool | RadioLink_SendBytes (SX1262_Handle *sx, const uint8_t *buf, uint8_t len) |
| Encrypt, authenticate, and send a raw byte payload. | |
| 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. | |
RadioLink framing, crypto, replay, and persistence interface.
| #define RADIOLINK_CRYPTO_ENABLE (1) |
| #define RADIOLINK_DEBUG_REPLAY_REJECT_ENABLE 0 |
| #define RADIOLINK_DEBUG_TAMPER_ENABLE 0 |
| #define RADIOLINK_DEBUG_TX_REPLAY_ONESHOT_ENABLE 0 |
| #define RADIOLINK_W3_HDR_LEN (RADIOLINK_WIRE_V3_HDR_LEN_DERIVED) |
| #define RADIOLINK_W3_TAG_LEN (RADIOLINK_WIRE_V3_TAG_LEN) |
| #define RADIOLINK_W3_VERSION (RADIOLINK_WIRE_V3_VERSION) |
| #define RADIOLINK_WIRE_V3_HDR_LEN (RADIOLINK_WIRE_V3_HDR_LEN_DERIVED) |
Fixed Wire v3 header length in bytes.
| #define RL_PERSIST_DISABLE_WHEN_DEBUGGER 1 |
| #define RL_PERSIST_ENABLE 1 |
| typedef struct radioLinkCryptoCtx_t radioLinkCryptoCtx_t |
Runtime crypto context for RadioLink key material.
| 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.
| 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. |
| 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.
| 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. |
| bool RadioLink_SendBytes | ( | SX1262_Handle * | sx, |
| const uint8_t * | buf, | ||
| uint8_t | len ) |
Encrypt, authenticate, and send a raw byte payload.
| sx | SX1262 driver handle used for transmission. |
| buf | Payload buffer. |
| len | Payload length in bytes. |
Encrypt, authenticate, and send a raw byte payload.
| bool RadioLink_SendString | ( | SX1262_Handle * | sx, |
| const char * | s ) |
Encrypt, authenticate, and send a string payload.
| sx | SX1262 driver handle used for transmission. |
| s | NUL-terminated string payload. |
Encrypt, authenticate, and send a string payload.
| bool RadioLink_TryDecodeToString | ( | const uint8_t * | rx, |
| uint8_t | rx_len, | ||
| char * | out, | ||
| uint8_t | out_max ) |
Parse and decrypt a received Wire v3 frame into a string buffer.
| rx | Pointer to the received frame bytes. |
| rx_len | Number of bytes in the received frame. |
| out | Output string buffer. |
| out_max | Size of the output buffer in bytes. |
Parse and decrypt a received Wire v3 frame into a string buffer.