[PATCH BlueZ 5/6] emulator: Dummy LE set advertising parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Implement basic LE set adv parameters command.
---
 emulator/btdev.c | 10 ++++++++++
 monitor/bt.h     | 12 ++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index f3de1a5..c98a20d 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -1451,6 +1451,16 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 		cmd_complete(btdev, opcode, &lrlf, sizeof(lrlf));
 		break;
 
+	case BT_HCI_CMD_LE_SET_ADV_PARAMETERS:
+		if (btdev->type == BTDEV_TYPE_BREDR)
+			goto unsupported;
+		if (btdev->le_adv_enable)
+			status = BT_HCI_ERR_COMMAND_DISALLOWED;
+		else
+			status = BT_HCI_ERR_SUCCESS;
+		cmd_complete(btdev, opcode, &status, sizeof(status));
+		break;
+
 	case BT_HCI_CMD_LE_READ_ADV_TX_POWER:
 		if (btdev->type == BTDEV_TYPE_BREDR)
 			goto unsupported;
diff --git a/monitor/bt.h b/monitor/bt.h
index da62a3d..0f1c1d8 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -842,6 +842,18 @@ struct bt_hci_cmd_le_set_random_address {
 	uint8_t  addr[6];
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_LE_SET_ADV_PARAMETERS	0x2006
+struct bt_hci_cmd_le_set_adv_parameters {
+	uint16_t adv_interval_min;
+	uint16_t adv_interval_max;
+	uint8_t adv_type;
+	uint8_t own_address_type;
+	uint8_t direct_address_type;
+	uint8_t direct_address[6];
+	uint8_t adv_channel_map;
+	uint8_t adv_filter_policy;
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_LE_READ_ADV_TX_POWER		0x2007
 struct bt_hci_rsp_le_read_adv_tx_power {
 	uint8_t  status;
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux