Skip to content

Commit 63185f6

Browse files
Ville TervoGustavo F. Padovan
authored andcommitted
Bluetooth: Add low energy commands and events
Add needed HCI command and event structs to create LE connections. Signed-off-by: Ville Tervo <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo F. Padovan <[email protected]>
1 parent 903d343 commit 63185f6

File tree

1 file changed

+49
-0
lines changed
  • include/net/bluetooth

1 file changed

+49
-0
lines changed

include/net/bluetooth/hci.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,36 @@ struct hci_rp_read_bd_addr {
642642
bdaddr_t bdaddr;
643643
} __packed;
644644

645+
#define HCI_OP_LE_SET_EVENT_MASK 0x2001
646+
struct hci_cp_le_set_event_mask {
647+
__u8 mask[8];
648+
} __packed;
649+
650+
#define HCI_OP_LE_READ_BUFFER_SIZE 0x2002
651+
struct hci_rp_le_read_buffer_size {
652+
__u8 status;
653+
__le16 le_mtu;
654+
__u8 le_max_pkt;
655+
} __packed;
656+
657+
#define HCI_OP_LE_CREATE_CONN 0x200d
658+
struct hci_cp_le_create_conn {
659+
__le16 scan_interval;
660+
__le16 scan_window;
661+
__u8 filter_policy;
662+
__u8 peer_addr_type;
663+
bdaddr_t peer_addr;
664+
__u8 own_address_type;
665+
__le16 conn_interval_min;
666+
__le16 conn_interval_max;
667+
__le16 conn_latency;
668+
__le16 supervision_timeout;
669+
__le16 min_ce_len;
670+
__le16 max_ce_len;
671+
} __packed;
672+
673+
#define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e
674+
645675
/* ---- HCI Events ---- */
646676
#define HCI_EV_INQUIRY_COMPLETE 0x01
647677

@@ -902,6 +932,25 @@ struct hci_ev_remote_host_features {
902932
__u8 features[8];
903933
} __packed;
904934

935+
#define HCI_EV_LE_META 0x3e
936+
struct hci_ev_le_meta {
937+
__u8 subevent;
938+
} __packed;
939+
940+
/* Low energy meta events */
941+
#define HCI_EV_LE_CONN_COMPLETE 0x01
942+
struct hci_ev_le_conn_complete {
943+
__u8 status;
944+
__le16 handle;
945+
__u8 role;
946+
__u8 bdaddr_type;
947+
bdaddr_t bdaddr;
948+
__le16 interval;
949+
__le16 latency;
950+
__le16 supervision_timeout;
951+
__u8 clk_accurancy;
952+
} __packed;
953+
905954
/* Internal events generated by Bluetooth stack */
906955
#define HCI_EV_STACK_INTERNAL 0xfd
907956
struct hci_ev_stack_internal {

0 commit comments

Comments
 (0)