38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#ifndef BLE_ADVERTISER_H
|
|
#define BLE_ADVERTISER_H
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/bluetooth/assigned_numbers.h>
|
|
#include <zephyr/bluetooth/bluetooth.h>
|
|
|
|
#include "error_code.h"
|
|
#include "window_status.h"
|
|
|
|
/**
|
|
* @brief Initialise the ble module
|
|
* @return init_failed upon any error occuring during init
|
|
* @return success otherwise
|
|
*/
|
|
enum error_code ble_init();
|
|
|
|
/**
|
|
* @brief Sets the given values as data and broadcast the BLE frame
|
|
* @param window_value : window opening status in {open/closed}
|
|
* @param hygro_value : humidity percentage [%]
|
|
* @param thermo_value : temperature in [d°C]
|
|
* @param co2_lvl_value : co2 level in [ppm]
|
|
* @param battery_percent_value : battery current level of charge [%]
|
|
* @return write_failed if any problem occur during the BLE broadcast
|
|
* @return success otherwise
|
|
* @note The broadcast is stopped at the return time
|
|
*/
|
|
enum error_code ble_advertise(
|
|
enum window_status window_value,
|
|
int hygro_value,
|
|
int thermo_value,
|
|
int co2_lvl_value,
|
|
int batt_value
|
|
);
|
|
|
|
#endif //BLE_ADVERTISER_H
|