ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Sending and receiving data.

Modules

 Advertisement tasks
 Bluetooth Low Energy advertising.
 

Macros

#define RT_COMM_MAC_STRLEN   (18U)
 
#define RT_COMM_ID_STRLEN   (24U)
 

Functions

rd_status_t rt_com_get_mac_str (char *const mac_str, const size_t mac_len)
 Get MAC address of the device from radio driver and write it to given string. More...
 
rd_status_t rt_com_get_id_str (char *const id_str, const size_t id_len)
 Get Unique ID of the device and write it to given string. More...
 

Detailed Description

Macro Definition Documentation

◆ RT_COMM_ID_STRLEN

#define RT_COMM_ID_STRLEN   (24U)

Definition at line 25 of file ruuvi_task_communication.h.

◆ RT_COMM_MAC_STRLEN

#define RT_COMM_MAC_STRLEN   (18U)

Definition at line 24 of file ruuvi_task_communication.h.

Function Documentation

◆ rt_com_get_id_str()

rd_status_t rt_com_get_id_str ( char *const  id_str,
const size_t  id_len 
)

Get Unique ID of the device and write it to given string.

The ID will remain constant even if MAC is changed. The ID must remain same across reboots and firmware updates.

Parameters
[out]id_str24-character array
[in]id_lenLength of id_str, must be at least 24.
Return values
RD_SUCCESSif id buffer was written
RD_ERROR_NULLif id_buffer was NULL

◆ rt_com_get_mac_str()

rd_status_t rt_com_get_mac_str ( char *const  mac_str,
const size_t  mac_len 
)

Get MAC address of the device from radio driver and write it to given string.

The MAC address (or Bluetooth Address) is presented as most significant byte first, if your Bluetooth scanner shows "AA:BB:CC:DD:EE:FF" the mac_str will have "AA:BB:CC:DD:EE:FF".

Parameters
[out]mac_str18-character array.
[in]mac_lenLength of mac_str, must be at least 18.
Return values
RD_SUCCESSif mac_str was written.
RD_ERROR_NULLif mac_str was NULL.
RD_ERROR_INVALID_STATEif radio is not initialized.