Bluetooth: Add support for set_discoverable management command
This patch adds a set_discoverable command to the management interface as well as the corresponding event. The command is used to control the discoverable state of adapters. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:

committed by
Gustavo F. Padovan

parent
eec8d2bcc8
commit
73f22f6238
@@ -675,6 +675,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
|
||||
int mgmt_index_added(u16 index);
|
||||
int mgmt_index_removed(u16 index);
|
||||
int mgmt_powered(u16 index, u8 powered);
|
||||
int mgmt_discoverable(u16 index, u8 discoverable);
|
||||
|
||||
/* HCI info for socket */
|
||||
#define hci_pi(sk) ((struct hci_pinfo *) sk)
|
||||
|
@@ -68,6 +68,16 @@ struct mgmt_rp_set_powered {
|
||||
__u8 powered;
|
||||
} __packed;
|
||||
|
||||
#define MGMT_OP_SET_DISCOVERABLE 0x0006
|
||||
struct mgmt_cp_set_discoverable {
|
||||
__le16 index;
|
||||
__u8 discoverable;
|
||||
} __packed;
|
||||
struct mgmt_rp_set_discoverable {
|
||||
__le16 index;
|
||||
__u8 discoverable;
|
||||
} __packed;
|
||||
|
||||
#define MGMT_EV_CMD_COMPLETE 0x0001
|
||||
struct mgmt_ev_cmd_complete {
|
||||
__le16 opcode;
|
||||
@@ -101,3 +111,9 @@ struct mgmt_ev_powered {
|
||||
__le16 index;
|
||||
__u8 powered;
|
||||
} __packed;
|
||||
|
||||
#define MGMT_EV_DISCOVERABLE 0x0007
|
||||
struct mgmt_ev_discoverable {
|
||||
__le16 index;
|
||||
__u8 discoverable;
|
||||
} __packed;
|
||||
|
Reference in New Issue
Block a user