Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
Enumerations | |
enum | Encrypt { ENCRYPT_NEVER = 0 , ENCRYPT_IF_ENABLED = 1 , ENCRYPT_OR_FAIL = 2 , ENCRYPT_ACCORDING_TO_TYPE = 3 } |
Option whether a UART message should be encrypted. More... | |
Functions | |
constexpr bool | mustBeEncryptedRx (UartOpcodeRx opCode) |
Whether a received UART message must be encrypted when "encryption required" is true (when a UART key is set). More... | |
constexpr bool | mustBeEncryptedTx (UartOpcodeTx opCode) |
Whether a written UART message must be encrypted when "encryption required" is true (when a UART key is set). More... | |
void | escape (uint8_t &val) |
Escape a value: converts a value to the an escaped version. More... | |
void | unEscape (uint8_t &val) |
Unescape a value: converts an escaped value back to the original value. More... | |
uint16_t | crc16 (const uint8_t *data, uint16_t size) |
Calculate the CRC of given data. More... | |
void | crc16 (const uint8_t *data, const uint16_t size, uint16_t &crc) |
Calculate the CRC of given data, with given CRC as start. More... | |
void UartProtocol::crc16 | ( | const uint8_t * | data, |
const uint16_t | size, | ||
uint16_t & | crc | ||
) |
Calculate the CRC of given data, with given CRC as start.
uint16_t UartProtocol::crc16 | ( | const uint8_t * | data, |
uint16_t | size | ||
) |
Calculate the CRC of given data.
void UartProtocol::escape | ( | uint8_t & | val | ) |
Escape a value: converts a value to the an escaped version.
|
constexpr |
Whether a received UART message must be encrypted when "encryption required" is true (when a UART key is set).
Optionals should return false.
|
constexpr |
Whether a written UART message must be encrypted when "encryption required" is true (when a UART key is set).
Optionals should return true.
void UartProtocol::unEscape | ( | uint8_t & | val | ) |
Unescape a value: converts an escaped value back to the original value.