Airoha M0 BLE API  1.0.5.4
hci_h4_parser.h
1 /******************************************************************************
2 Copyright (c) Airoha 2016 - All rights reserved
3 
4 FILE NAME
5  hci_h4_parser.h
6 DESCRIPTION
7 NOTES
8 ********************************************************************************/
9 #ifndef __HCI_H4_PARSER_HH_
10 #define __HCI_H4_PARSER_HH_
11 #include <stdint.h>
12 #include <stdbool.h>
13 #include "hci_packet.h"
14 /******************************************************************************
15  * Macro
16  ******************************************************************************/
17 /* HC H4 PACKET ID */
18 typedef uint8_t HCI_H4_PKT_ID;
19 #define HCI_H4_PKT_ID_COMMAND (HCI_H4_PKT_ID)1
20 #define HCI_H4_PKT_ID_ACL_DATA (HCI_H4_PKT_ID)2
21 #define HCI_H4_PKT_ID_SCO_DATA (HCI_H4_PKT_ID)3
22 #define HCI_H4_PKT_ID_EVENT (HCI_H4_PKT_ID)4
23 
24 /******************************************************************************
25  * Prototypes
26  ******************************************************************************/
27 uint8_t hci_h4_encode_cmd(uint16_t op, uint8_t *parm, uint8_t len, uint8_t **buf, uint16_t *rlen);
28 uint8_t hci_h4_encode_dat(uint16_t handle, uint8_t *parm, uint16_t len, uint8_t **buf, uint16_t *rlen);
29 uint16_t hci_h4_decode(uint8_t *buf, uint16_t len, hci_rx_packet **pkt);
30 
31 #endif