ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_communication_ble_gatt.h
Go to the documentation of this file.
1 
7 #ifndef RUUVI_INTERFACE_COMMUNICATION_BLE4_GATT_H
8 #define RUUVI_INTERFACE_COMMUNICATION_BLE4_GATT_H
9 #include "ruuvi_driver_error.h"
13 
14 #if RI_GATT_ENABLED
15 # define RUUVI_NRF5_SDK15_GATT_ENABLED RUUVI_NRF5_SDK15_ENABLED
16 #endif
17 
18 // Apple guideline: 2 s. ≤ CONN_SUP_TIMEOUT ≤ 6 s.
19 #define RI_GATT_CONN_SUP_TIMEOUT_MS (6000U)
20 
21 // Apple guideline: Slave Latency ≤ 30
22 // Apple guideline: MAX_CONN_INTERVAL * (SLAVE_LATENCY + 1) <= 2 s.
23 #define RI_GATT_SLAVE_LATENCY_TURBO (0U)
24 #define RI_GATT_SLAVE_LATENCY_STANDARD (1U)
25 #define RI_GATT_SLAVE_LATENCY_LOW_POWER (0U)
26 
27 // Apple guideline: min interval >= 15 ms, max interval >= min interval + 15 ms
28 #define RI_GATT_MIN_INTERVAL_TURBO_MS (15U)
29 #define RI_GATT_MAX_INTERVAL_TURBO_MS (30U)
30 #define RI_GATT_MIN_INTERVAL_STANDARD_MS (480U)
31 #define RI_GATT_MAX_INTERVAL_STANDARD_MS (510U)
32 #define RI_GATT_MIN_INTERVAL_LOW_POWER_MS (1950U)
33 #define RI_GATT_MAX_INTERVAL_LOW_POWER_MS (1980U)
34 
43 
53 
64 
73 
81 
90 
91 
106  const uint16_t delay_ms);
107 
108 #endif
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
rd_status_t ri_gatt_init(void)
Initializes GATT stack. Uses default values from sdk_config.h, these can be overridden in nrf5_sdk15_...
rd_status_t ri_gatt_nus_uninit(ri_comm_channel_t *const _channel)
Uninitialize Nordic UART Service as a communication channel.
rd_status_t ri_gatt_dfu_init(void)
Initialize BLE4 Device firmware update service.
rd_status_t ri_gatt_uninit(void)
Uninitializes GATT stack.
rd_status_t ri_gatt_nus_init(ri_comm_channel_t *const channel)
Initialize Nordic UART Service as a communication channel. ri_communication_radio_init(RI_COMMUNICATI...
rd_status_t ri_gatt_params_request(const ri_gatt_params_t params, const uint16_t delay_ms)
Request connection parameter update for current connection.
rd_status_t ri_gatt_dis_init(const ri_comm_dis_init_t *const dis)
Initialize BLE4 Device Information service.
control API for communication via outside world