lls_c.h
Go to the documentation of this file.
1
56 #ifndef __LLS_C_H__
57 #define __LLS_C_H__
58
59 #include "gr55xx_sys.h"
60 #include "ble_prf_types.h"
61 #include "custom_config.h"
62 #include <stdint.h>
63 #include <stdbool.h>
64
69 #define LLS_C_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
70 10 : CFG_MAX_CONNECTIONS)
78 typedef enum
79 {
80 LLS_C_ALERT_LEVEL_NO_ALERT,
81 LLS_C_ALERT_LEVEL_MILD_ALERT,
82 LLS_C_ALERT_LEVEL_HIGH_ALERT,
83 } lls_c_alert_level_t;
84
86 typedef enum
87 {
88 LLS_C_EVT_INVALID,
89 LLS_C_EVT_DISCOVERY_COMPLETE,
90 LLS_C_EVT_DISCOVERY_FAIL,
91 LLS_C_EVT_ALERT_LEVEL_SET_SUCCESS,
92 LLS_C_EVT_ALERT_LEVEL_SET_ERR,
93 LLS_C_EVT_ALERT_LEVEL_RECEIVE,
94 } lls_c_evt_type_t;
102 typedef struct
103 {
104 uint16_t lls_srvc_start_handle;
105 uint16_t lls_srvc_end_handle;
106 uint16_t lls_alert_level_handle;
107 } lls_c_handles_t;
108
110 typedef struct
111 {
112 uint8_t conn_idx;
113 lls_c_evt_type_t evt_type;
114 lls_c_alert_level_t alert_level;
115 } lls_c_evt_t;
123 typedef void (*lls_c_evt_handler_t)(lls_c_evt_t *p_evt);
139 sdk_err_t lls_client_init(lls_c_evt_handler_t evt_handler);
140
150 sdk_err_t lls_c_disc_srvc_start(uint8_t conn_idx);
151
162 sdk_err_t lls_c_alert_level_set(uint8_t conn_idx, lls_c_alert_level_t alert_level);
163
173 sdk_err_t lls_c_alert_level_read(uint8_t conn_idx);
176 #endif
177
lls_c_evt_type_t
lls_c_evt_type_t
Link Loss Service Client event type.
Definition: lls_c.h:87
LLS_C_EVT_ALERT_LEVEL_RECEIVE
@ LLS_C_EVT_ALERT_LEVEL_RECEIVE
Definition: lls_c.h:93
lls_c_evt_t::conn_idx
uint8_t conn_idx
Definition: lls_c.h:112
lls_client_init
sdk_err_t lls_client_init(lls_c_evt_handler_t evt_handler)
Register LLS Client event handler.
lls_c_evt_handler_t
void(* lls_c_evt_handler_t)(lls_c_evt_t *p_evt)
Link Loss Service Client event handler type.
Definition: lls_c.h:123
LLS_C_EVT_ALERT_LEVEL_SET_ERR
@ LLS_C_EVT_ALERT_LEVEL_SET_ERR
Definition: lls_c.h:92
gr55xx_sys.h
GR55XX System API.
LLS_C_ALERT_LEVEL_MILD_ALERT
@ LLS_C_ALERT_LEVEL_MILD_ALERT
Definition: lls_c.h:81
lls_c_alert_level_read
sdk_err_t lls_c_alert_level_read(uint8_t conn_idx)
Read Alert Level characteristic value.
LLS_C_EVT_ALERT_LEVEL_SET_SUCCESS
@ LLS_C_EVT_ALERT_LEVEL_SET_SUCCESS
Definition: lls_c.h:91
LLS_C_EVT_INVALID
@ LLS_C_EVT_INVALID
Definition: lls_c.h:88
lls_c_disc_srvc_start
sdk_err_t lls_c_disc_srvc_start(uint8_t conn_idx)
Discovery Link Loss Service on peer.
lls_c_alert_level_t
lls_c_alert_level_t
Link Loss Service Client alert levels.
Definition: lls_c.h:79
lls_c_evt_t::alert_level
lls_c_alert_level_t alert_level
Definition: lls_c.h:114
lls_c_handles_t::lls_srvc_start_handle
uint16_t lls_srvc_start_handle
Definition: lls_c.h:104
ble_prf_types.h
Profile/Service Common Types.
LLS_C_EVT_DISCOVERY_FAIL
@ LLS_C_EVT_DISCOVERY_FAIL
Definition: lls_c.h:90
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
lls_c_evt_t::evt_type
lls_c_evt_type_t evt_type
Definition: lls_c.h:113
LLS_C_ALERT_LEVEL_NO_ALERT
@ LLS_C_ALERT_LEVEL_NO_ALERT
Definition: lls_c.h:80
LLS_C_ALERT_LEVEL_HIGH_ALERT
@ LLS_C_ALERT_LEVEL_HIGH_ALERT
Definition: lls_c.h:82
lls_c_handles_t::lls_alert_level_handle
uint16_t lls_alert_level_handle
Definition: lls_c.h:106
lls_c_handles_t
Handles on the connected peer device needed to interact with it.
Definition: lls_c.h:103
LLS_C_EVT_DISCOVERY_COMPLETE
@ LLS_C_EVT_DISCOVERY_COMPLETE
Definition: lls_c.h:89
lls_c_alert_level_set
sdk_err_t lls_c_alert_level_set(uint8_t conn_idx, lls_c_alert_level_t alert_level)
Set peer Alert Level.
lls_c_evt_t
Link Loss Service Client event.
Definition: lls_c.h:111
lls_c_handles_t::lls_srvc_end_handle
uint16_t lls_srvc_end_handle
Definition: lls_c.h:105