| Airoha M0 BLE API 1.0.5.4

service_human_interface_device.h
1 /******************************************************************************
2 Copyright (c) Airoha 2016 - All rights reserved
3
4 FILE NAME
5 service_human_interface_device.h
6 DESCRIPTION
7 NOTES
8 ********************************************************************************/
9 #ifndef _HID_SERVICE_H_
10 #define _HID_SERVICE_H_
11
19 #include "ble_gatt_server.h"
20
21
27 #define MAX_EXT_REP_REF_NUM 5
28 #define MAX_INCLUDED_SERVICE_NUM 3
34 typedef struct
35 {
36 uint8_t * data;
37 uint16_t data_len;
38 uint16_t ext_rep_ref_uuid[MAX_EXT_REP_REF_NUM];
39 uint16_t included_service_handle[MAX_INCLUDED_SERVICE_NUM];
40 uint8_t ext_rep_ref_uuid_num;
41 uint8_t included_service_num;
42 }hids_char_report_map_t;
43
47 typedef struct
48 {
49 uint16_t bcdHID;
50 uint8_t bCountryCode;
51 uint8_t flags;
52 }hids_char_hid_information_t;
53
57 typedef struct
58 {
59 uint8_t * data;
60 ATTCB cb;
61 }hids_char_hid_control_point_t;
62
66 typedef struct
67 {
68 hids_char_report_map_t rmap;
69 hids_char_hid_information_t hid_info;
70 hids_char_hid_control_point_t hid_cp;
71 }hids_init_para;
72
76 typedef enum
77 {
79 HID_REPORT_INPUT = 1,
81 HID_REPORT_OUTPUT = 2,
83 HID_REPORT_FEATURE = 3,
84 }HIDS_REPORT_TYPE;
85
89 typedef struct
90 {
91 HIDS_REPORT_TYPE report_type;
92 uint8_t report_ID;
93 uint8_t * data;
94 uint16_t data_len;
95 ATTCB cb;
96 }hids_report_para;
97
98
104 void HIDS_init(hids_init_para * para);
105
113 att_handle HIDS_add_report(hids_report_para * para);
114
115
116
117 // not supported yet
118 //att_handle hids_add_protocol_mode(void);
119 //att_handle hids_add_boot_keyboard_report(void);
120 //att_handle hids_add_boot_mouse_report(void);
121
122
123
124
125
130 #endif
hids_char_hid_information_t::bcdHID
uint16_t bcdHID
Definition: service_human_interface_device.h:49
hids_char_hid_information_t::bCountryCode
uint8_t bCountryCode
Definition: service_human_interface_device.h:50
hids_char_report_map_t::data_len
uint16_t data_len
Definition: service_human_interface_device.h:37
HID_REPORT_INPUT
Definition: service_human_interface_device.h:79
att_handle
uint16_t att_handle
attribute handle.
Definition: ble_att.h:52
MAX_INCLUDED_SERVICE_NUM
#define MAX_INCLUDED_SERVICE_NUM
Definition: service_human_interface_device.h:28
hids_report_para::report_ID
uint8_t report_ID
Definition: service_human_interface_device.h:92
HIDS_REPORT_TYPE
HIDS_REPORT_TYPE
HID report type.
Definition: service_human_interface_device.h:76
ATTCB
void(* ATTCB)(ATT_CB_TYPE type, uint8_t linkindex, uint16_t handle)
attribute value accessed call back function.
Definition: ble_att.h:111
HIDS_init
void HIDS_init(hids_init_para *para)
Initialization function of human interface device service.
hids_init_para::hid_cp
hids_char_hid_control_point_t hid_cp
Definition: service_human_interface_device.h:70
hids_char_report_map_t::data
uint8_t * data
Definition: service_human_interface_device.h:36
hids_char_report_map_t::included_service_num
uint8_t included_service_num
Definition: service_human_interface_device.h:41
hids_report_para::cb
ATTCB cb
Definition: service_human_interface_device.h:95
HIDS_add_report
att_handle HIDS_add_report(hids_report_para *para)
Initialization function of human interface device service.
hids_init_para::hid_info
hids_char_hid_information_t hid_info
Definition: service_human_interface_device.h:69
hids_char_report_map_t
Report map characteristic initialization parameters.
Definition: service_human_interface_device.h:34
hids_char_hid_information_t
HID information characteristic initialization parameters.
Definition: service_human_interface_device.h:47
MAX_EXT_REP_REF_NUM
#define MAX_EXT_REP_REF_NUM
Definition: service_human_interface_device.h:27
hids_char_hid_control_point_t
HID control point characteristic initialization parameters.
Definition: service_human_interface_device.h:57
hids_report_para
HID report characteristic initialization parameter.
Definition: service_human_interface_device.h:89
hids_init_para::rmap
hids_char_report_map_t rmap
Definition: service_human_interface_device.h:68
hids_report_para::report_type
HIDS_REPORT_TYPE report_type
Definition: service_human_interface_device.h:91
hids_report_para::data_len
uint16_t data_len
Definition: service_human_interface_device.h:94
HID_REPORT_FEATURE
Definition: service_human_interface_device.h:83
hids_report_para::data
uint8_t * data
Definition: service_human_interface_device.h:93
HID_REPORT_OUTPUT
Definition: service_human_interface_device.h:81
hids_char_hid_control_point_t::cb
ATTCB cb
Definition: service_human_interface_device.h:60
hids_char_report_map_t::ext_rep_ref_uuid_num
uint8_t ext_rep_ref_uuid_num
Definition: service_human_interface_device.h:40
hids_char_hid_information_t::flags
uint8_t flags
Definition: service_human_interface_device.h:51
hids_init_para
Human information service initialization parameters.
Definition: service_human_interface_device.h:66
hids_char_hid_control_point_t::data
uint8_t * data
Definition: service_human_interface_device.h:59