ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ri_comm_message_t Struct Reference

Application message structure used for communication. More...

#include <ruuvi_interface_communication.h>

Public Member Functions

 _Static_assert (RI_COMM_MESSAGE_MAX_LENGTH<=UINT8_MAX, "Data length must fit in uint8_t")
 

Data Fields

uint8_t data [RI_COMM_MESSAGE_MAX_LENGTH]
 Data payload. More...
 
uint8_t data_length
 Length of data. More...
 
uint8_t repeat_count
 Number of times to repeat the message,. More...
 

Detailed Description

Application message structure used for communication.

This structure is used for both UART and BLE messages.

Note
When data is sent over UART, the data is sent in the encoded format, which includes a 20 byte overhead for the ADV_RPRT2 message. See ruuvi.endpoints.c library, function re_ca_uart_encode for details.
The length of messages for BLE should not exceed RI_COMM_BLE_PAYLOAD_MAX_LENGTH.

The structure includes a static assertion to ensure the data length fits within a uint8_t type.

Definition at line 79 of file ruuvi_interface_communication.h.

Member Function Documentation

◆ _Static_assert()

_Static_assert ( RI_COMM_MESSAGE_MAX_LENGTH<=  UINT8_MAX,
"Data length must fit in uint8_t"   
)

Field Documentation

◆ data

Data payload.

Definition at line 83 of file ruuvi_interface_communication.h.

◆ data_length

uint8_t data_length

Length of data.

Definition at line 84 of file ruuvi_interface_communication.h.

◆ repeat_count

uint8_t repeat_count

Number of times to repeat the message,.

Definition at line 85 of file ruuvi_interface_communication.h.


The documentation for this struct was generated from the following file: