include/nuttx/wireless/bluetooth adn include/nuttx/wireless/bluetooth: Add SIOCBTCONNECT and SIOCBTDISCONNECT ioctl commands

This commit is contained in:
Lwazi Dube
2018-12-02 10:57:51 -06:00
committed by Gregory Nutt
parent ab974488d5
commit b7fa409fc4
4 changed files with 90 additions and 2 deletions
+18 -1
View File
@@ -69,7 +69,7 @@
/* Bluetooth network device IOCTL commands. */
#if !defined(WL_BLUETOOTHCMDS) || WL_BLUETOOTHCMDS != 24
#if !defined(WL_BLUETOOTHCMDS) || WL_BLUETOOTHCMDS != 26
# error Incorrect setting for number of Bluetooth IOCTL commands
#endif
@@ -202,6 +202,11 @@
#define SIOCBTGATTWR _WLIOC(WL_BLUETOOTHFIRST + 22)
#define SIOCBTGATTWRGET _WLIOC(WL_BLUETOOTHFIRST + 23)
/* Connect/diconnect from a peer */
#define SIOCBTCONNECT _WLIOC(WL_BLUETOOTHFIRST + 24)
#define SIOCBTDISCONNECT _WLIOC(WL_BLUETOOTHFIRST + 25)
/* Definitions associated with struct btreg_s *******************************/
/* struct btreq_s union field accessors */
@@ -267,6 +272,8 @@
#define btr_wrpending btru.btgwrr.br_pending
#define btr_wrresult btru.btgwrr.br_result
#define btr_rmtpeer btru.btcon.btcon_peer
/* btr_flags */
#define BTF_UP (1 << 0) /* Unit is up */
@@ -496,6 +503,16 @@ struct btreq_s
/* Write result that accompanies SIOCBTGATTWRGET command */
struct bt_result_s btgwrr; /* OUT: Result of the write */
/* Read-only data that accompanies the SIOCBTCONNECT and
* SIOCBTDISCONNECT commands.
*/
struct
{
bt_addr_le_t btcon_peer; /* IN: Peer address */
} btcon;
} btru;
};
+1 -1
View File
@@ -160,7 +160,7 @@
/* Reserved for Bluetooth network devices (see bt_ioctls.h) */
#define WL_BLUETOOTHFIRST (WL_NETFIRST + WL_NNETCMDS)
#define WL_BLUETOOTHCMDS (24)
#define WL_BLUETOOTHCMDS (26)
#define WL_IBLUETOOTHCMD(cmd) (_WLIOCVALID(cmd) && \
_IOC_NR(cmd) >= WL_BLUETOOTHFIRST && \
_IOC_NR(cmd) < (WL_BLUETOOTHFIRST + WL_BLUETOOTHCMDS))