ias_c.h
Go to the documentation of this file.
1
56 #ifndef __IAS_C_H__
57 #define __IAS_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 IAS_C_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
70 10 : CFG_MAX_CONNECTIONS)
78 typedef enum
79 {
80 IAS_C_ALERT_NONE,
81 IAS_C_ALERT_MILD,
82 IAS_C_ALERT_HIGH,
83 } ias_c_alert_level_t;
84
86 typedef enum
87 {
88 IAS_C_EVT_INVALID,
89 IAS_C_EVT_DISCOVERY_COMPLETE,
90 IAS_C_EVT_DISCOVERY_FAIL,
91 IAS_C_EVT_ALERT_LEVEL_SET_SUCCESS,
92 IAS_C_EVT_ALERT_LEVEL_SET_ERR,
93 } ias_c_evt_type_t;
101 typedef struct
102 {
103 uint16_t ias_srvc_start_handle;
104 uint16_t ias_srvc_end_handle;
105 uint16_t ias_alert_level_handle;
106 } ias_c_handles_t;
107
109 typedef struct
110 {
111 uint8_t conn_idx;
112 ias_c_evt_type_t evt_type;
113 } ias_c_evt_t;
121 typedef void (*ias_c_evt_handler_t)(ias_c_evt_t *p_evt);
137 sdk_err_t ias_client_init(ias_c_evt_handler_t evt_handler);
138
148 sdk_err_t ias_c_disc_srvc_start(uint8_t conn_idx);
149
160 sdk_err_t ias_c_alert_level_set(uint8_t conn_idx, ias_c_alert_level_t alert_level);
161
164 #endif
165
ias_c_alert_level_set
sdk_err_t ias_c_alert_level_set(uint8_t conn_idx, ias_c_alert_level_t alert_level)
Enable or disable peer Alert Level characteristic notify.
ias_c_evt_handler_t
void(* ias_c_evt_handler_t)(ias_c_evt_t *p_evt)
Immediate Alert Service Client event handler type.
Definition: ias_c.h:121
IAS_C_EVT_ALERT_LEVEL_SET_SUCCESS
@ IAS_C_EVT_ALERT_LEVEL_SET_SUCCESS
Definition: ias_c.h:91
gr55xx_sys.h
GR55XX System API.
ias_c_handles_t::ias_alert_level_handle
uint16_t ias_alert_level_handle
Definition: ias_c.h:105
ias_c_evt_t
Immediate Alert Service Client event.
Definition: ias_c.h:110
ias_c_handles_t::ias_srvc_end_handle
uint16_t ias_srvc_end_handle
Definition: ias_c.h:104
ias_c_evt_t::evt_type
ias_c_evt_type_t evt_type
Definition: ias_c.h:112
IAS_C_EVT_DISCOVERY_COMPLETE
@ IAS_C_EVT_DISCOVERY_COMPLETE
Definition: ias_c.h:89
IAS_C_ALERT_HIGH
@ IAS_C_ALERT_HIGH
Definition: ias_c.h:82
IAS_C_EVT_INVALID
@ IAS_C_EVT_INVALID
Definition: ias_c.h:88
IAS_C_ALERT_MILD
@ IAS_C_ALERT_MILD
Definition: ias_c.h:81
IAS_C_EVT_ALERT_LEVEL_SET_ERR
@ IAS_C_EVT_ALERT_LEVEL_SET_ERR
Definition: ias_c.h:92
ble_prf_types.h
Profile/Service Common Types.
ias_c_alert_level_t
ias_c_alert_level_t
Immediate Alert Service Alert levels.
Definition: ias_c.h:79
IAS_C_ALERT_NONE
@ IAS_C_ALERT_NONE
Definition: ias_c.h:80
ias_c_handles_t
Handles on the connected peer device needed to interact with it.
Definition: ias_c.h:102
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
ias_c_disc_srvc_start
sdk_err_t ias_c_disc_srvc_start(uint8_t conn_idx)
Discovery Immediate Alert Service on peer.
ias_c_evt_type_t
ias_c_evt_type_t
Immediate Alert Service Client event type.
Definition: ias_c.h:87
ias_client_init
sdk_err_t ias_client_init(ias_c_evt_handler_t evt_handler)
Register IAS Client event handler.
IAS_C_EVT_DISCOVERY_FAIL
@ IAS_C_EVT_DISCOVERY_FAIL
Definition: ias_c.h:90
ias_c_evt_t::conn_idx
uint8_t conn_idx
Definition: ias_c.h:111
ias_c_handles_t::ias_srvc_start_handle
uint16_t ias_srvc_start_handle
Definition: ias_c.h:103