ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_task_gatt.h
Go to the documentation of this file.
1 
14 #ifndef RUUVI_TASK_GATT_H
15 #define RUUVI_TASK_GATT_H
16 
17 #include "ruuvi_driver_error.h"
20 
21 #ifdef CEEDLING
22 // Assist function for unit tests.
23 void rt_gatt_mock_state_reset();
24 
25 // Expose callback to Ceedling
26 rd_status_t rt_gatt_on_nus_isr (ri_comm_evt_t evt,
27  void * p_data, size_t data_len);
28 
29 #endif
30 
45 
61 
79 
98 
112 rd_status_t rt_gatt_init (const char * const name);
113 
130 
142 
154 
160 bool rt_gatt_is_init();
161 
168 
179 
189 
199 
209 
218 void rt_gatt_set_on_sent_isr (const ri_comm_cb_t cb);
219 
220 #endif
uint32_t rd_status_t
bitfield for representing errors
Ruuvi error codes and error check function.
void(* ri_comm_cb_t)(void *p_data, size_t data_len)
ri_comm_evt_t
Communication event type.
bool rt_gatt_nus_is_connected()
check if NUS is connected, i.e. central has registered to TX notifications.
rd_status_t rt_gatt_dfu_init(void)
Initialize Device Firmware Update service.
rd_status_t rt_gatt_uninit(void)
Uninitialize GATT.
void rt_gatt_set_on_disconn_isr(const ri_comm_cb_t cb)
Setup disconnection event handler.
rd_status_t rt_gatt_adv_enable()
Start advertising GATT connection to devices.
rd_status_t rt_gatt_dis_init(const ri_comm_dis_init_t *const dis)
Initialize Device Information Update service.
rd_status_t rt_gatt_adv_disable()
Stop advertising GATT connection to devices.
rd_status_t rt_gatt_init(const char *const name)
Initialize GATT. Must be called as a first function in rt_gatt.
void rt_gatt_set_on_sent_isr(const ri_comm_cb_t cb)
Setup data sent event handler.
bool rt_gatt_is_init()
check if GATT task is initialized
void rt_gatt_set_on_connected_isr(const ri_comm_cb_t cb)
Setup connection event handler.
bool rt_gatt_is_nus_enabled()
Check if Nordic UART Service is enabled.
rd_status_t rt_gatt_send_asynchronous(ri_comm_message_t *const msg)
Send given message via NUS.
rd_status_t rt_gatt_nus_init()
Initialize Nordic UART Service.
void rt_gatt_set_on_received_isr(const ri_comm_cb_t cb)
Setup data received event handler.
Application message structure used for communication.