Airoha M0 BLE API  1.0.5.4
ble_gatt_server.h
1 /******************************************************************************
2 Copyright (c) Airoha 2016 - All rights reserved
3 
4 FILE NAME
5  ble_gatt_server.h
6 DESCRIPTION
7 NOTES
8 ********************************************************************************/
9 #ifndef _BLE_GATT_SERVER_H_
10 #define _BLE_GATT_SERVER_H_
11 
21 #include <stdint.h>
22 #include <stddef.h>
23 #include <stdbool.h>
24 #include "ble_att.h"
25 
26 
30 typedef enum
31 {
32  primary_service = 0x2800,
33  secondary_service = 0x2801,
35 
41 typedef enum
42 {
54 
55 
59 typedef enum
60 {
61  C_BCAST = 0x01,
62  C_READ = 0x02,
63  C_WRITE_NO_RSP = 0x04,
64  C_WRITE = 0x08,
65  C_NOTIFY = 0x10,
66  C_INDICATE = 0x20,
67  C_AUTHEN = 0x40,
68  C_EXTENDED = 0x80,
70 
74 typedef struct
75 {
78  uint8_t UUID[16];
80 
84 typedef struct
85 {
88 
92 typedef struct
93 {
95  uint8_t UUID[16];
96  uint8_t property;
97  uint8_t permission;
100  uint8_t * char_data;
103 
107 typedef struct
108 {
110  uint8_t UUID[16];
111  uint8_t permission;
114  uint8_t * desc_data;
117 
127 
137 
145 
153 
154 
162 
173 
177 #endif
att_handle BLE_gatt_add_charact(gatt_add_charact_para *para)
API for declaring a GATT Characteristic in last added service.
Definition: ble_gatt_server.h:46
uint8_t permission
Definition: ble_gatt_server.h:111
UUID_size size
Definition: ble_gatt_server.h:94
Definition: ble_gatt_server.h:32
API parameter for creating a GATT characteristic.
Definition: ble_gatt_server.h:92
att_handle BLE_gatt_add_service(gatt_add_service_para *para)
API for adding a GATT Service declaration into the attribute server database.
uint16_t att_handle
attribute handle.
Definition: ble_att.h:52
Definition: ble_gatt_server.h:47
uint8_t * desc_data
Definition: ble_gatt_server.h:114
att_handle BLE_gatt_add_include(gatt_add_include_para *para)
API for including another GATT Service in last added service.
ATTCB cb
Definition: ble_gatt_server.h:115
bool BLE_gatt_charact_indicate(att_handle char_handle, NOTIFY_INDICATE_LINK_SEL sel, INDI_CB cb)
API for sending a characteristic value indication to the selected target(s).
uint16_t data_initial_length
Definition: ble_gatt_server.h:98
att_handle service_handle
Definition: ble_gatt_server.h:86
void(* ATTCB)(ATT_CB_TYPE type, uint8_t linkindex, uint16_t handle)
attribute value accessed call back function.
Definition: ble_att.h:111
Definition: ble_gatt_server.h:49
UUID_size size
Definition: ble_gatt_server.h:109
service_type type
Definition: ble_gatt_server.h:76
uint8_t * char_data
Definition: ble_gatt_server.h:100
uint16_t data_maximum_length
Definition: ble_gatt_server.h:99
API parameter for creating a GATT characteristic descriptor.
Definition: ble_gatt_server.h:107
Definition: ble_gatt_server.h:45
UUID_size size
Definition: ble_gatt_server.h:77
uint8_t permission
Definition: ble_gatt_server.h:97
void BLE_gatt_charact_notify(att_handle char_handle, NOTIFY_INDICATE_LINK_SEL sel)
API for sending a characteristic value notification to the selected target(s).
API parameter for creating a GATT service.
Definition: ble_gatt_server.h:74
service_type
GATT service type.
Definition: ble_gatt_server.h:30
att_handle BLE_gatt_add_descrip(gatt_add_descrip_para *para)
API for declaring a GATT descriptor in last added characteristic.
Definition: ble_gatt_server.h:52
Definition: ble_gatt_server.h:44
API parameter for including a GATT service in another.
Definition: ble_gatt_server.h:84
NOTIFY_INDICATE_LINK_SEL
GATT Notification/Indication target link selection.
Definition: ble_gatt_server.h:41
uint8_t property
Definition: ble_gatt_server.h:96
uint16_t data_maximum_length
Definition: ble_gatt_server.h:113
uint16_t data_initial_length
Definition: ble_gatt_server.h:112
CHAR_PROPERTY
GATT characteristic Property.
Definition: ble_gatt_server.h:59
Definition: ble_gatt_server.h:43
Definition: ble_gatt_server.h:33
Definition: ble_gatt_server.h:48
void(* INDI_CB)(uint8_t link_index)
characteristic value indication confirmed call back function.
Definition: ble_att.h:118
ATTCB cb
Definition: ble_gatt_server.h:101
UUID_size
UUID size in bytes.
Definition: ble_att.h:58
Definition: ble_gatt_server.h:50