InPlay API
in_ble_prf_hogp.h
1 
13 #ifndef IN_BLE_PRF_HOGP_H
14 #define IN_BLE_PRF_HOGP_H
15 
24 #include "ble/in_ble_evt.h"
25 #include "ble/in_ble_prf.h"
26 /*
27  * Defines
28  ****************************************************************************************
29  */
30 
32 #define BLE_HOGPRH_NB_HIDS_INST_MAX (2)
33 #define BLE_HOGPRH_NB_REPORT_INST_MAX (5)
35 #define BLE_HOGPRH_REPORT_MAP_MAX_LEN (512)
37 
40 #define BLE_HOGPD_NB_HIDS_INST_MAX (2)
41 #define BLE_HOGPD_NB_REPORT_INST_MAX (5)
43 
44 /*
45  * Enumerations
46  ****************************************************************************************
47  */
48 
49 /*
50  * Events
51  ****************************************************************************************
52  */
53 
56  HOGPBH_EVT_CODE = HOGP_EVT_CODE +1,
57 
60 
61  HOGPRH_EVT_CODE = (HOGP_EVT_CODE + 0x10),
62 
65 
66  HOGPD_EVT_CODE = (HOGP_EVT_CODE + 0x20),
67 
76 };
77 
78 /*
79  * HOGP Common
80  ****************************************************************************************
81  */
82 
85 {
90 };
91 
94 {
99 };
100 
103 {
108 };
109 
110 /*
111  * HOG Boot Host profile
112  ****************************************************************************************
113  */
114 
117 {
126 
127  BLE_HOGPBH_CHAR_MAX,
128 };
129 
132 {
137 
138  BLE_HOGPBH_DESC_MAX,
139 };
140 
143 {
152 
157 
158  BLE_HOGPBH_INFO_MAX,
159 };
160 
161 /*
162  * HOG Device profile
163  ****************************************************************************************
164  */
165 
168 {
181 
184 
187 };
188 
191 {
196  //HOGPD_CFG_REPORT_FEAT can be used as a mask to check Report type
201 };
202 
205 {
216 };
217 
220 {
229 };
230 
231 /*
232  * HOG Report host profile
233  ****************************************************************************************
234  */
235 
236 
239 {
250 
252 };
253 
256 {
263 
265 };
266 
269 {
276 
287 
288  BLE_HOGPRH_INFO_MAX,
289 };
290 
291 /*
292  * Structures
293  ****************************************************************************************
294  */
295 
296 /*
297  * HOG Boot Host profile
298  ****************************************************************************************
299  */
300 
302 typedef struct
303 {
305  uint8_t length;
307  uint8_t value[];
309 
310 typedef union
311 {
314  uint8_t proto_mode;
318  uint16_t ntf_cfg;
319 
325 } ble_hogpbh_data_t;
326 
327 typedef struct
328 {
330  uint8_t info;
332  uint8_t hid_idx;
334  ble_hogpbh_data_t data;
335 } ble_hogpbh_read_info_rsp_t;
336 
337 typedef struct
338 {
339  ble_svc_t svc;
340  ble_char_inf_t chars[BLE_HOGPBH_CHAR_MAX];
341  ble_char_desc_inf_t descs[BLE_HOGPBH_DESC_MAX];
342 
343 } ble_hogpbh_content_t;
344 
345 typedef struct
346 {
348  uint8_t conidx;
350  uint8_t info;
352  uint8_t hid_idx;
355 } ble_evt_hogpbh_boot_report_ind_t;
356 
357 /*
358  * HOG Device profile
359  ****************************************************************************************
360  */
361 
363 typedef struct
364 {
366  uint16_t bcdHID;
368  uint8_t bCountryCode;
370  uint8_t flags;
372 
374 typedef struct
375 {
377  uint16_t inc_svc_hdl;
379  uint16_t rep_ref_uuid;
381 
383 typedef struct
384 {
386  uint8_t svc_features;
388  uint8_t report_nb;
390  uint8_t report_char_cfg[BLE_HOGPD_NB_REPORT_INST_MAX];
392  uint8_t report_id[BLE_HOGPD_NB_REPORT_INST_MAX];
398 
399 typedef struct
400 {
402  bool multi_instance;
403 
404  /*The following params are for HOGPD only*/
405 
407  bool check_enc_key_size;
408 
410  enum ble_att_perm sec_lvl;
411 
413  uint8_t hids_nb;
416 } ble_hogp_prf_t;
417 
419 typedef struct
420 {
422  uint8_t hid_idx;
424  uint8_t type;
426  uint16_t length;
428  uint8_t idx;
430  uint8_t value[];
432 
433 typedef struct
434 {
436  uint8_t conidx;
438  uint8_t operation;
441 } ble_evt_hogpd_report_req_ind_t;
442 
444 typedef struct
445 {
447  uint8_t conidx;
449  uint8_t operation;
451  uint8_t hid_idx;
453  uint8_t proto_mode;
455 
456 typedef struct
457 {
459  uint8_t conidx;
460 
462  uint16_t ntf_cfg[BLE_HOGPD_NB_HIDS_INST_MAX];
463 } ble_evt_hogpd_ntf_cfg_ind_t;
464 
465 typedef struct
466 {
468  uint8_t conidx;
470  uint8_t hid_idx;
472  uint8_t hid_ctnl_pt;
473 } ble_evt_hogpd_ctnl_pt_ind_t;
474 
475 /*
476  * HOG Report host profile
477  ****************************************************************************************
478  */
479 
481 typedef struct
482 {
485 
488 
490  ble_char_inf_t chars[BLE_HOGPRH_CHAR_MAX];
491 
493  ble_char_desc_inf_t descs[BLE_HOGPRH_DESC_MAX];
494 
496  uint8_t report_nb;
498 
500 typedef struct
501 {
503  uint8_t length;
505  uint8_t value[];
507 
509 typedef struct
510 {
512  uint8_t id;
514  uint8_t type;
516 
518 typedef struct
519 {
521  uint16_t length;
523  uint8_t value[];
525 
527 typedef struct
528 {
530  uint8_t uuid_len;
532  uint8_t uuid[];
534 
535 typedef union
536 {
539  uint8_t proto_mode;
540 
543  ble_hogpd_info_t hid_info;
544 
547  uint8_t hid_ctnl_pt;
548 
551  ble_hogprh_report_t report;
552 
555  uint16_t report_cfg;
556 
559  ble_hogprh_report_ref_t report_ref;
560 
563  ble_hogprh_report_map_t report_map;
564 
567  ble_hogprh_report_map_ref_t report_map_ref;
568 } ble_hogprh_data_t;
569 
570 typedef struct
571 {
573  uint8_t info;
575  uint8_t hid_idx;
580  uint8_t report_idx;
581 } ble_hogprh_read_info_req_t;
582 
583 typedef struct
584 {
586  uint8_t info;
588  uint8_t hid_idx;
593  uint8_t report_idx;
595  ble_hogprh_data_t data;
596 } ble_hogprh_read_info_rsp_t;
597 
598 typedef struct
599 {
601  uint8_t info;
603  uint8_t hid_idx;
607  uint8_t report_idx;
610  bool wr_cmd;
612  ble_hogprh_data_t data;
613 } ble_hogprh_write_req_t;
614 
615 
617 typedef struct
618 {
620  uint8_t conidx;
622  uint8_t hid_idx;
624  uint8_t report_idx;
628 
629 /*
630  * APIs
631  ****************************************************************************************
632  */
633 
634 /*
635  * HOGPBH FUNCTIONS
636  ****************************************************************************************
637  */
638 
651 int in_ble_hogpbh_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback);
652 
669 int in_ble_hogpbh_enable(void *hdl, int conidx, int con_type, uint8_t hids_nb, ble_hogpbh_content_t cont[], comp_cb callback);
670 
684 int in_ble_hogpbh_read_info_req(void *hdl, int conidx, int hid_idx, int info, ble_hogpbh_read_info_rsp_t *p_rsp, comp_cb callback);
685 
702 int in_ble_hogpbh_write_req(void *hdl, int conidx, int hid_idx, int info, int wr_cmd, ble_hogpbh_data_t *p_data, comp_cb callback);
703 
704 /*
705  * HOGPD FUNCTIONS
706  ****************************************************************************************
707  */
708 
721 int in_ble_hogpd_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback);
722 
735 int in_ble_hogpd_enable(void *hdl, int conidx, uint16_t ntf_cfg[], comp_cb callback);
736 
748 int in_ble_hogpd_report_upd_req(void *hdl, int conidx, ble_hogpd_report_info_t *p_info, comp_cb callback);
749 
764 int in_ble_hogpd_report_req_cfm(void *hdl, int conidx, int operation, int status, ble_hogpd_report_info_t *p_info);
765 
781 int in_ble_hogpd_proto_mode_req_cfm(void *hdl, int conidx, int status, int hid_idx, int proto_mode);
782 
783 /*
784  * HOGPRH FUNCTIONS
785  ****************************************************************************************
786  */
787 
800 int in_ble_hogprh_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback);
801 
818 int in_ble_hogprh_enable(void *hdl, int conidx, int con_type, int hids_nb, ble_hogprh_content_t cont[], comp_cb callback);
819 
832 int in_ble_hogprh_read_info_req(void *hdl, int conidx, ble_hogprh_read_info_req_t *p_req, ble_hogprh_read_info_rsp_t *p_rsp, comp_cb callback);
833 
845 int in_ble_hogprh_write_req(void *hdl, int conidx, ble_hogprh_write_req_t *p_req, comp_cb callback) ;
846 
848 #endif
849 
The Report characteristic is used to exchange data between a HID Device and a HID Host...
Definition: in_ble_prf_hogp.h:207
characteristic description
Definition: in_ble_prf.h:208
int in_ble_hogpbh_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
Add HOGPBH profile.
Report Map Char. External Report Reference Descriptor.
Definition: in_ble_prf_hogp.h:258
int in_ble_hogpbh_enable(void *hdl, int conidx, int con_type, uint8_t hids_nb, ble_hogpbh_content_t cont[], comp_cb callback)
Enable HOGPBH profile.
uint8_t conidx
Connection index.
Definition: in_ble_prf_hogp.h:620
Boot Keyboard Report write capability.
Definition: in_ble_prf_hogp.h:178
Boot Keyboard Input Report.
Definition: in_ble_prf_hogp.h:147
Boot Mouse Input Report.
Definition: in_ble_prf_hogp.h:125
Boot Report value (after Read Request or Notification),.
Definition: in_ble_prf_hogp.h:59
HID Information.
Definition: in_ble_prf_hogp.h:243
HID report MAP info.
Definition: in_ble_prf_hogp.h:518
ble_att_perm
Definition: in_ble_att.h:63
uint16_t inc_svc_hdl
External Report Reference - Included Service.
Definition: in_ble_prf_hogp.h:377
Boot Keyboard Input Report Client Config.
Definition: in_ble_prf_hogp.h:154
uint8_t length
Report Length.
Definition: in_ble_prf_hogp.h:503
Exit suspend.
Definition: in_ble_prf_hogp.h:98
Read report value.
Definition: in_ble_prf_hogp.h:224
uint16_t length
Report MAP Length.
Definition: in_ble_prf_hogp.h:521
uint8_t idx
Report Instance - 0 for boot reports and report map.
Definition: in_ble_prf_hogp.h:428
uint8_t proto_mode
New Protocol Mode Characteristic Value.
Definition: in_ble_prf_hogp.h:453
ble_hogpd_info_t hid_info
HID Information Char. Values.
Definition: in_ble_prf_hogp.h:394
int in_ble_hogpd_proto_mode_req_cfm(void *hdl, int conidx, int status, int hid_idx, int proto_mode)
Confirm if the new protocol mode value.
Mouse Device.
Definition: in_ble_prf_hogp.h:172
Boot Keyboard Input Report.
Definition: in_ble_prf_hogp.h:121
ble_hogprh_report_t report
Report data.
Definition: in_ble_prf_hogp.h:626
int in_ble_hogpd_report_upd_req(void *hdl, int conidx, ble_hogpd_report_info_t *p_info, comp_cb callback)
Request sending of a report to the host - notification.
int in_ble_hogpd_report_req_cfm(void *hdl, int conidx, int operation, int status, ble_hogpd_report_info_t *p_info)
Confirmation for peer device for Reading or Updating a report value.
ble_hogp_boot_prot_mode
Protocol Mode Char. value Keys.
Definition: in_ble_prf_hogp.h:102
characteristic info
Definition: in_ble_prf.h:195
uint8_t operation
Operation requested (update protocol mode.
Definition: in_ble_prf_hogp.h:449
HID report MAP reference.
Definition: in_ble_prf_hogp.h:527
Report.
Definition: in_ble_prf_hogp.h:249
Modify/Set report value.
Definition: in_ble_prf_hogp.h:226
#define BLE_HOGPD_NB_REPORT_INST_MAX
Maximal number of Report Char. that can be added in the DB for one HIDS - Up to 11.
Definition: in_ble_prf_hogp.h:42
Protocol Mode.
Definition: in_ble_prf_hogp.h:145
Input report with Write capabilities.
Definition: in_ble_prf_hogp.h:200
Report value (after Notification),.
Definition: in_ble_prf_hogp.h:64
No operation.
Definition: in_ble_prf_hogp.h:222
HID Information.
Definition: in_ble_prf_hogp.h:278
service handles
Definition: in_ble_prf.h:171
HID Control Point.
Definition: in_ble_prf_hogp.h:245
uint16_t rep_ref_uuid
External Report Reference - Characteristic UUID.
Definition: in_ble_prf_hogp.h:379
int in_ble_hogprh_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
Add HOGPRH profile.
uint8_t report_idx
HID Report Index.
Definition: in_ble_prf_hogp.h:624
ble_hogpd_op
type of operation requested by peer device
Definition: in_ble_prf_hogp.h:219
Inform that HID Control Point Characteristic Value has been written on Device,.
Definition: in_ble_prf_hogp.h:75
ble_hogpd_report_cfg
Report Char. Configuration Flag Values.
Definition: in_ble_prf_hogp.h:190
Request from peer device to Read or update a report value,.
Definition: in_ble_prf_hogp.h:69
ble_hogp_info_bit
HID Information bit values.
Definition: in_ble_prf_hogp.h:84
Boot Keyboard Output Report.
Definition: in_ble_prf_hogp.h:149
ble_hogp_ctnl_pt
HID Control Point Characteristic value keys.
Definition: in_ble_prf_hogp.h:93
Report Client Config.
Definition: in_ble_prf_hogp.h:262
Inform Device that Protocol Mode Characteristic Value has been written on Device,.
Definition: in_ble_prf_hogp.h:71
uint8_t hid_idx
HIDS Instance.
Definition: in_ble_prf_hogp.h:451
Boot Keyboard Input Report.
Definition: in_ble_prf_hogp.h:211
Boot Mouse Input Report Client Config.
Definition: in_ble_prf_hogp.h:136
Device capable of providing wake-up signal to a HID host.
Definition: in_ble_prf_hogp.h:87
int in_ble_hogprh_write_req(void *hdl, int conidx, ble_hogprh_write_req_t *p_req, comp_cb callback)
Write info to peer.
uint16_t length
Report Length (uint8_t)
Definition: in_ble_prf_hogp.h:426
HID Control Point.
Definition: in_ble_prf_hogp.h:280
ble_hogpd_report_type
Type of reports.
Definition: in_ble_prf_hogp.h:204
Boot Mouse Input Report Client Config.
Definition: in_ble_prf_hogp.h:156
int in_ble_hogpbh_write_req(void *hdl, int conidx, int hid_idx, int info, int wr_cmd, ble_hogpbh_data_t *p_data, comp_cb callback)
Write info to peer.
The Report Map characteristic.
Definition: in_ble_prf_hogp.h:209
Protocol Mode.
Definition: in_ble_prf_hogp.h:119
uint16_t bcdHID
bcdHID
Definition: in_ble_prf_hogp.h:366
Suspend.
Definition: in_ble_prf_hogp.h:96
uint8_t bCountryCode
bCountryCode
Definition: in_ble_prf_hogp.h:368
HOGP Boot Host HID boot report info.
Definition: in_ble_prf_hogp.h:302
ble_hogprh_descs
Characteristic descriptors.
Definition: in_ble_prf_hogp.h:255
Report Map.
Definition: in_ble_prf_hogp.h:241
Report Char. Report Reference.
Definition: in_ble_prf_hogp.h:284
#define BLE_HOGPD_NB_HIDS_INST_MAX
Definition: in_ble_prf_hogp.h:40
Feature Report.
Definition: in_ble_prf_hogp.h:198
Report Protocol Mode.
Definition: in_ble_prf_hogp.h:107
Parameters of the HOGPRH_BOOT_REPORT_IND message.
Definition: in_ble_prf_hogp.h:617
ble_hogpbh_descs
HOGP Boot Host Characteristic descriptors.
Definition: in_ble_prf_hogp.h:131
Database Creation Service Instance Configuration structure.
Definition: in_ble_prf_hogp.h:383
Structure containing the characteristics handles, value handles and descriptors.
Definition: in_ble_prf_hogp.h:481
ble_hogpd_ext_ref_t ext_ref
External Report Reference.
Definition: in_ble_prf_hogp.h:396
uint8_t hid_idx
HIDS Instance.
Definition: in_ble_prf_hogp.h:422
Keyboard Device.
Definition: in_ble_prf_hogp.h:170
uint8_t length
Report Length.
Definition: in_ble_prf_hogp.h:305
ble_hogpd_cfg
HOGPD config.
Definition: in_ble_prf_hogp.h:167
Boot Mouse Input Report.
Definition: in_ble_prf_hogp.h:215
uint8_t flags
Flags,.
Definition: in_ble_prf_hogp.h:370
Input Report.
Definition: in_ble_prf_hogp.h:193
Report Notification Enabled (to be shift for each report index)
Definition: in_ble_prf_hogp.h:186
Modify Protocol mode.
Definition: in_ble_prf_hogp.h:228
uint8_t hid_idx
HIDS Instance.
Definition: in_ble_prf_hogp.h:622
uint8_t report_nb
Number of Report Char. instances to add in the database.
Definition: in_ble_prf_hogp.h:388
Boot Keyboard Input Report Client Config.
Definition: in_ble_prf_hogp.h:134
Boot Mouse Report write capability.
Definition: in_ble_prf_hogp.h:180
int in_ble_hogpbh_read_info_req(void *hdl, int conidx, int hid_idx, int info, ble_hogpbh_read_info_rsp_t *p_rsp, comp_cb callback)
Read peer info.
service handles
Definition: in_ble_prf.h:180
ble_hogpbh_info
HOGP Boot Host Peer HID service info that can be read/write.
Definition: in_ble_prf_hogp.h:142
Boot Keyboard Output Report.
Definition: in_ble_prf_hogp.h:123
uint8_t id
Report ID.
Definition: in_ble_prf_hogp.h:512
HID Report Info.
Definition: in_ble_prf_hogp.h:419
Valid Feature mask.
Definition: in_ble_prf_hogp.h:183
ble_hogprh_info
Peer HID service info that can be read/write.
Definition: in_ble_prf_hogp.h:268
Inform Device APP that Protocol Mode Characteristic Value has been written on Device.
Definition: in_ble_prf_hogp.h:444
Output Report.
Definition: in_ble_prf_hogp.h:195
HID report info.
Definition: in_ble_prf_hogp.h:500
int in_ble_hogpd_enable(void *hdl, int conidx, uint16_t ntf_cfg[], comp_cb callback)
Enable HOGPBH profile.
External Report Reference.
Definition: in_ble_prf_hogp.h:374
Report Notification config.
Definition: in_ble_prf_hogp.h:286
ble_hogpbh_chars
HOGP Boot Host Characteristics.
Definition: in_ble_prf_hogp.h:116
ble_hogprh_chars
HOG profile report host Characteristics.
Definition: in_ble_prf_hogp.h:238
HID Information structure.
Definition: in_ble_prf_hogp.h:363
Boot Keyboard Output Report.
Definition: in_ble_prf_hogp.h:213
Inform Device that a Client Characteristic Configuration has been modified,.
Definition: in_ble_prf_hogp.h:73
#define BLE_HOGPRH_NB_REPORT_INST_MAX
Maximal number of Report Char. that can be added in the DB for one HIDS - Up to 11.
Definition: in_ble_prf_hogp.h:34
Report Map.
Definition: in_ble_prf_hogp.h:273
int in_ble_hogprh_read_info_req(void *hdl, int conidx, ble_hogprh_read_info_req_t *p_req, ble_hogprh_read_info_rsp_t *p_rsp, comp_cb callback)
Read peer info.
ble_incl_svc_t incl_svc
Included service info.
Definition: in_ble_prf_hogp.h:487
uint8_t type
Report Type.
Definition: in_ble_prf_hogp.h:514
Report Char. Report Reference.
Definition: in_ble_prf_hogp.h:260
uint8_t conidx
Connection Index.
Definition: in_ble_prf_hogp.h:447
int in_ble_hogpd_add(void *hdl, ble_hogp_prf_t *p_prf, comp_cb callback)
Add HOGPD profile.
Extended Reference Present.
Definition: in_ble_prf_hogp.h:176
int in_ble_hogprh_enable(void *hdl, int conidx, int con_type, int hids_nb, ble_hogprh_content_t cont[], comp_cb callback)
Enable HOGPRH profile.
Normally connectable support bit.
Definition: in_ble_prf_hogp.h:89
Boot Mouse Input Report.
Definition: in_ble_prf_hogp.h:151
Report.
Definition: in_ble_prf_hogp.h:282
uint8_t type
type of report (
Definition: in_ble_prf_hogp.h:424
ble_svc_t svc
Service info.
Definition: in_ble_prf_hogp.h:484
uint8_t uuid_len
Reference UUID length.
Definition: in_ble_prf_hogp.h:530
uint8_t report_nb
Number of Report Char. that have been found.
Definition: in_ble_prf_hogp.h:496
HID report Reference.
Definition: in_ble_prf_hogp.h:509
Protocol Mode present.
Definition: in_ble_prf_hogp.h:174
ble_hog_evt_code
Event code.
Definition: in_ble_prf_hogp.h:55
Protocol Mode.
Definition: in_ble_prf_hogp.h:247
Report Map Char. External Report Reference Descriptor.
Definition: in_ble_prf_hogp.h:275
uint8_t svc_features
Service Features (.
Definition: in_ble_prf_hogp.h:386
Protocol Mode.
Definition: in_ble_prf_hogp.h:271
Boot Protocol Mode.
Definition: in_ble_prf_hogp.h:105