Thread (8 messages) read the whole thread 8 messages, 2 authors, 2013-07-05
STALE4774d

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

From: Jefferson Delfes <hidden>
Date: 2013-07-03 20:54:55
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help