1 #ifndef RUUVI_INTERFACE_COMMUNICATION_BLE_ADVERTISING_H
2 #define RUUVI_INTERFACE_COMMUNICATION_BLE_ADVERTISING_H
20 # define RUUVI_NRF5_SDK15_ADV_ENABLED RUUVI_NRF5_SDK15_ENABLED
21 # define RUUVI_NRF5_SDK15_ADV_EXTENDED_ENABLED RI_ADV_EXTENDED_ENABLED
24 #define RUUVI_COMM_BLE_ADV_MAX_LENGTH (RI_COMM_BLE_PAYLOAD_MAX_LENGTH)
25 #define RUUVI_COMM_BLE_ADV_SCAN_LENGTH (RUUVI_COMM_BLE_ADV_MAX_LENGTH)
26 #define RUUVI_COMM_BLE_ADV_SCAN_BUFFER (RUUVI_COMM_BLE_ADV_MAX_LENGTH)
29 #define BLE_MAC_ADDRESS_LENGTH 6
91 const bool is_le_2m_phy_enabled,
92 const bool is_le_coded_phy_enabled);
200 const bool advertise_nus);
255 const uint32_t window_size_ms);
287 const size_t data_length);
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
uint16_t ri_adv_parse_manuid(uint8_t *const data, const size_t data_length)
Parse Manufacturer ID from given Bluetooth scan data.
rd_status_t ri_adv_channels_set(const ri_radio_channels_t channels)
Set channels to use on radio. This has effect only on BLE advertising.
rd_status_t ri_adv_scan_start(const uint32_t window_interval_ms, const uint32_t window_size_ms)
setup scan window interval and window size.
ri_adv_type_t
Allowed advertisement types.
@ NONCONNECTABLE_SCANNABLE
Nonconnectable, scannable.
@ CONNECTABLE_NONSCANNABLE
Connectable, nonscannable.
@ NONCONNECTABLE_NONSCANNABLE
Nonconnectable, nonscannable.
@ CONNECTABLE_SCANNABLE
Connectable, scannable.
void ri_adv_rx_set_max_advertisement_data_length(const uint8_t max_adv_length)
Set maximum advertisement data length. This is used to limit the size of extended advertisement data.
rd_status_t ri_adv_tx_power_get(int8_t *dbm)
Get radio TX power.
rd_status_t ri_adv_manufacturer_id_set(const uint16_t id)
Set manufacturer ID of manufacturer specific advertisement.
rd_status_t ri_adv_init(ri_comm_channel_t *const channel)
Initialize Advertising module and scanning module.
rd_status_t ri_adv_scan_response_setup(const char *const name, const bool advertise_nus)
Configure advertising data with a scan response.
rd_status_t ri_adv_channels_enable(const ri_radio_channels_t channel)
Select active channels.
void ri_adv_set_service_uuid(const uint16_t uuid)
Configure Bluetooth GATT Service UUID to advertise in primary advertisement packet.
rd_status_t ri_adv_tx_interval_get(uint32_t *ms)
Getter for broadcast advertisement interval.
rd_status_t ri_adv_stop(void)
Stop ongoing advertisements.
rd_status_t ri_adv_uninit(ri_comm_channel_t *const channel)
rd_status_t ri_adv_type_set(ri_adv_type_t type)
Configure the type of advertisement.
rd_status_t ri_adv_tx_interval_set(const uint32_t ms)
rd_status_t ri_adv_tx_power_set(int8_t *dbm)
Set radio TX power.
#define RUUVI_COMM_BLE_ADV_SCAN_LENGTH
void ri_adv_enable_uuid(const bool enable_uuid)
Set to true to enable advertising 16-bit service UUID in primary advertisement packet.
rd_status_t ri_adv_scan_stop(void)
Stop ongoing scanning.
#define BLE_MAC_ADDRESS_LENGTH
void ri_adv_rx_ble_phy_enabled_set(const bool is_le_1m_phy_enabled, const bool is_le_2m_phy_enabled, const bool is_le_coded_phy_enabled)
Set BLE PHYs enabled or disabled for scanning.
int8_t rssi
RSSI of advertisement.
bool is_coded_phy
True if Coded PHY was used.
size_t data_len
Length of received data.
control API for communication via outside world
Bitfield to describe related sensor data.