pass.h
Go to the documentation of this file.
1
56 #ifndef __PASS_H__
57 #define __PASS_H__
58
59 #include "gr55xx_sys.h"
60 #include "custom_config.h"
61 #include <stdint.h>
62 #include <stdbool.h>
63
68 #define PASS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
69 10 : CFG_MAX_CONNECTIONS)
70 #define PASS_ALERT_STATUS_VAL_LEN 1
71 #define PASS_RINGER_SET_VAL_LEN 1
72 #define PASS_RINGER_CTRL_PT_VAL_LEN 1
79 #define PASS_CHAR_MANDATORY 0x003f
80 #define PASS_CHAR_RING_CTRL_PT_SUP 0x0180
81 #define PASS_CHAR_FULL 0x01ff
89 #define PASS_NO_STATE_ACTIVE (0x00)
90 #define PASS_RINGER_ACTIVE (0x01 << 0)
91 #define PASS_VIBRATE_ACTIVE (0x01 << 1)
92 #define PASS_DISPLAY_ALERT_ACTIVE (0x01 << 2)
93 #define PASS_ALL_STATE_ACTIVE (0x07)
101 #define PASS_RINGER_SET_SILENT 0
102 #define PASS_RINGER_SET_NORMAL 1
111 typedef enum
112 {
113 PASS_CTRL_PT_SILENT_MODE = 0x01,
114 PASS_CTRL_PT_MUTE_ONCE,
115 PASS_CTRL_PT_CANCEL_SLIENT_MODE,
116 } pass_ringer_ctrl_pt_t;
117
119 typedef enum
120 {
121 PASS_EVT_INVALID,
122 PASS_EVT_ALERT_STATUS_NTF_ENABLE,
123 PASS_EVT_ALERT_STATUS_NTF_DISABLE,
124 PASS_EVT_RINGER_SET_NTF_ENABLE,
125 PASS_EVT_RINGER_SET_NTF_DISABLE,
126 PASS_EVT_SILENT_MODE_SET,
127 PASS_EVT_MUTE_ONCE_SET,
128 PASS_EVT_SILENT_MODE_CANCEL,
129 } pass_evt_type_t;
137 typedef struct
138 {
139 uint8_t conn_idx;
140 pass_evt_type_t evt_type;
141 } pass_evt_t;
149 typedef void (*pass_evt_handler_t)(pass_evt_t *p_evt);
157 typedef struct
158 {
159 pass_evt_handler_t evt_handler;
160 uint16_t char_mask;
161 uint8_t alert_status;
162 uint8_t ringer_setting;
163 } pass_init_t;
179 sdk_err_t pass_service_init(pass_init_t *p_pass_init);
180
188 uint8_t pass_ringer_setting_get(void);
189
198 void pass_ringer_setting_set(uint8_t conn_idx, uint8_t new_setting);
199
208 void pass_alert_status_set(uint8_t conn_idx, uint8_t new_status);
211 #endif
212
pass_ringer_ctrl_pt_t
pass_ringer_ctrl_pt_t
Phone Alert Status Service Ringer Control Point.
Definition: pass.h:112
PASS_EVT_RINGER_SET_NTF_ENABLE
@ PASS_EVT_RINGER_SET_NTF_ENABLE
Definition: pass.h:124
PASS_CTRL_PT_MUTE_ONCE
@ PASS_CTRL_PT_MUTE_ONCE
Definition: pass.h:114
PASS_EVT_RINGER_SET_NTF_DISABLE
@ PASS_EVT_RINGER_SET_NTF_DISABLE
Definition: pass.h:125
PASS_EVT_ALERT_STATUS_NTF_DISABLE
@ PASS_EVT_ALERT_STATUS_NTF_DISABLE
Definition: pass.h:123
pass_init_t
Phone Alert Status Service init stucture. This contains all option and data needed for initialization...
Definition: pass.h:158
pass_ringer_setting_get
uint8_t pass_ringer_setting_get(void)
Get Ringer Setting value.
pass_evt_t
Phone Alert Status Service event.
Definition: pass.h:138
pass_evt_t::conn_idx
uint8_t conn_idx
Definition: pass.h:139
pass_init_t::alert_status
uint8_t alert_status
Definition: pass.h:161
gr55xx_sys.h
GR55XX System API.
PASS_EVT_INVALID
@ PASS_EVT_INVALID
Definition: pass.h:121
PASS_CTRL_PT_CANCEL_SLIENT_MODE
@ PASS_CTRL_PT_CANCEL_SLIENT_MODE
Definition: pass.h:115
pass_evt_handler_t
void(* pass_evt_handler_t)(pass_evt_t *p_evt)
Phone Alert Status Service event handler type.
Definition: pass.h:149
pass_evt_t::evt_type
pass_evt_type_t evt_type
Definition: pass.h:140
PASS_EVT_MUTE_ONCE_SET
@ PASS_EVT_MUTE_ONCE_SET
Definition: pass.h:127
PASS_EVT_SILENT_MODE_SET
@ PASS_EVT_SILENT_MODE_SET
Definition: pass.h:126
PASS_EVT_SILENT_MODE_CANCEL
@ PASS_EVT_SILENT_MODE_CANCEL
Definition: pass.h:128
pass_init_t::evt_handler
pass_evt_handler_t evt_handler
Definition: pass.h:159
pass_ringer_setting_set
void pass_ringer_setting_set(uint8_t conn_idx, uint8_t new_setting)
Set Ringer Setting value.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
pass_alert_status_set
void pass_alert_status_set(uint8_t conn_idx, uint8_t new_status)
Set Alert Status value.
pass_init_t::char_mask
uint16_t char_mask
Definition: pass.h:160
PASS_EVT_ALERT_STATUS_NTF_ENABLE
@ PASS_EVT_ALERT_STATUS_NTF_ENABLE
Definition: pass.h:122
pass_evt_type_t
pass_evt_type_t
Phone Alert Status Service event type.
Definition: pass.h:120
pass_init_t::ringer_setting
uint8_t ringer_setting
Definition: pass.h:162
pass_service_init
sdk_err_t pass_service_init(pass_init_t *p_pass_init)
Initialize a Phone Alert Status Service instance and add in the DB.
PASS_CTRL_PT_SILENT_MODE
@ PASS_CTRL_PT_SILENT_MODE
Definition: pass.h:113