| Airoha M0 BLE API 1.0.5.4

hci_packet.h
1 /******************************************************************************
2 Copyright (c) Airoha 2016 - All rights reserved
3
4 FILE NAME
5 hci_packet.h
6 DESCRIPTION
7 NOTES
8 ********************************************************************************/
9 #ifndef __HCI_PACKET_HH
10 #define __HCI_PACKET_HH
11 #include <stdint.h>
12 #include "platform.h"
13
14 typedef enum
15 {
16 HCI_PACKET_TYPE_NULL = 0x0,
17 HCI_PACKET_TYPE_CMD = 0x1,
18 HCI_PACKET_TYPE_DAT = 0x2,
19 HCI_PACKET_TYPE_EVT = 0x4
20 }hci_rx_packet_type;
21
22 #ifdef _MSC_VER
23 __pragma(pack(push, 1))
24 #define __attribute__(x)
25 #endif
26 typedef struct
27 {
28 uint16_t handle;
29 uint16_t len;
30 uint8_t *dat;
31 }__attribute__((packed))hci_dat_packet;
32
33 typedef struct
34 {
35 uint8_t evt;
36 uint8_t len;
37 uint8_t *dat;
38 }__attribute__((packed))hci_evt_packet;
39
40 #ifdef _MSC_VER
41 __pragma(pack(pop))
42 #undef __attribute__
43 #endif
44 typedef struct hci_rx_packet_
45 {
46 hci_rx_packet_type packet_type;
47 union{
48 hci_evt_packet evt;
49 hci_dat_packet dat;
50 }pkt;
51 void *reserved;
52 }hci_rx_packet;
53 #endif
54