ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
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... | |
#define RT_COMM_ID_STRLEN (24U) |
Definition at line 25 of file ruuvi_task_communication.h.
#define RT_COMM_MAC_STRLEN (18U) |
Definition at line 24 of file ruuvi_task_communication.h.
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.
[out] | id_str | 24-character array |
[in] | id_len | Length of id_str, must be at least 24. |
RD_SUCCESS | if id buffer was written |
RD_ERROR_NULL | if id_buffer was NULL |
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".
[out] | mac_str | 18-character array. |
[in] | mac_len | Length of mac_str, must be at least 18. |
RD_SUCCESS | if mac_str was written. |
RD_ERROR_NULL | if mac_str was NULL. |
RD_ERROR_INVALID_STATE | if radio is not initialized. |