Skip to contentSkip to conversation

monitor: Add description for filter in scan parameters

PATCH In review Łukasz Rymanowski 2 participants 6 messages Apr 12, 2017 – Apr 19, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/5 monitor: Add description for filter in scan parameters

< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7

        Type: Active (0x01)
        Interval: 30.000 msec (0x0030)
        Window: 30.000 msec (0x0030)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement, inc. directed unresolved RPA (0x02)
---
 monitor/packet.c | 6 ++++++
 1 file changed, 6 insertions(+)
monitor/packet.c +6 -0
index 5d927f5..219542e 100644
@@ -6309,6 +6309,12 @@ static void le_set_scan_parameters_cmd(const void *data, uint8_t size)
 	case 0x01:
 		str = "Ignore not in white list";
 		break;
+	case 0x02:
+		str = "Accept all advertisement, inc. directed unresolved RPA";
+		break;
+	case 0x03:
+		str = "Ignore not in white list, exc. directed unresolved RPA";
+		break;
 	default:
 		str = "Reserved";
 		break;
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 2/5 monitor: Add LE Read PHY decoding

---
 monitor/bt.h     | 11 +++++++++++
 monitor/packet.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 53 insertions(+), 1 deletion(-)
monitor/bt.h +11 -0
index 0b77a10..a6c12a3 100644
@@ -2134,6 +2134,17 @@ struct bt_hci_rsp_le_read_max_data_length {
 	uint16_t max_rx_time;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_LE_READ_PHY			0x2030
+struct bt_hci_cmd_le_read_phy {
+	uint16_t handle;
+} __attribute__((packed));
+struct bt_hci_rsp_le_read_phy {
+	uint8_t status;
+	uint16_t handle;
+	uint8_t tx_phy;
+	uint8_t rx_phy;
+} __attribute__((packed));
+
 #define BT_HCI_EVT_INQUIRY_COMPLETE		0x01
 struct bt_hci_evt_inquiry_complete {
 	uint8_t  status;
monitor/packet.c +42 -1

55 lines not on this page · raw message

Signature · 1 line
2.9.3
#2 lore raw

PATCH v2 3/5 monitor: Add LE Set default PHY decoding

In reply to Łukasz Rymanowski

< HCI Command: LE Set Default PHY (0x08|0x0031) plen 3

        All PHYs preference: 0x00
        TX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        RX PHYs preference: 0x0e
          LE 2M
          LE Coded
          Reserved (0x08)

< HCI Command: LE Set Default PHY (0x08|0x0031) plen 3

        All PHYs preference: 0x03
          No TX PHY preference
          No RX PHY preference
        TX PHYs preference: 0x00
        RX PHYs preference: 0x00
---
 monitor/bt.h     |  7 ++++++
 monitor/packet.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 76 insertions(+), 1 deletion(-)
monitor/bt.h +7 -0
index a6c12a3..9dd726e 100644
@@ -2145,6 +2145,13 @@ struct bt_hci_rsp_le_read_phy {
 	uint8_t rx_phy;
 } __attribute__((packed));
 
+#define BT_HCI_CMD_LE_SET_DEFAULT_PHY		0x2031
+struct bt_hci_cmd_le_set_default_phy {
+	uint8_t all_phys;
+	uint8_t tx_phys;
+	uint8_t rx_phys;
+} __attribute__((packed));
+
 #define BT_HCI_EVT_INQUIRY_COMPLETE		0x01
 struct bt_hci_evt_inquiry_complete {
 	uint8_t  status;
monitor/packet.c +69 -1

82 lines not on this page · raw message

Signature · 1 line
2.9.3
#3 lore raw

PATCH v2 4/5 monitor: Add LE Set PHY decoding

In reply to Łukasz Rymanowski

< HCI Command: LE Set PHY (0x08|0x0032) plen 7

        Handle: 1
        All PHYs preference: 0x00
        TX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        RX PHYs preference: 0x07
          LE 1M
          LE 2M
          LE Coded
        PHY options preference: S8 coding (0x0002)
---
 monitor/bt.h     |  9 +++++++++
 monitor/packet.c | 54 ++++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 51 insertions(+), 12 deletions(-)
monitor/bt.h +9 -0
index 9dd726e..d6e0046 100644
@@ -2152,6 +2152,15 @@ struct bt_hci_cmd_le_set_default_phy {
 	uint8_t rx_phys;
 } __attribute__((packed));
 
+#define BT_HCI_CMD_LE_SET_PHY			0x2032
+struct bt_hci_cmd_le_set_phy {
+	uint16_t handle;
+	uint8_t all_phys;
+	uint8_t tx_phys;
+	uint8_t rx_phys;
+	uint16_t phy_opts;
+} __attribute__((packed));
+
 #define BT_HCI_EVT_INQUIRY_COMPLETE		0x01
 struct bt_hci_evt_inquiry_complete {
 	uint8_t  status;
monitor/packet.c +42 -12

93 lines not on this page · raw message

Signature · 1 line
2.9.3
#4 lore raw

PATCH v2 5/5 monitor: Add LE PHY update complete event decoding

In reply to Łukasz Rymanowski
---
 monitor/bt.h     |  8 ++++++++
 monitor/packet.c | 13 ++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
monitor/bt.h +8 -0
index d6e0046..b3de08c 100644
@@ -2763,6 +2763,14 @@ struct bt_hci_evt_le_direct_adv_report {
 	int8_t   rssi;
 } __attribute__ ((packed));
 
+#define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE	0x0c
+struct bt_hci_evt_le_phy_update_complete {
+	uint8_t  status;
+	uint16_t handle;
+	uint8_t  tx_phy;
+	uint8_t  rx_phy;
+} __attribute__ ((packed));
+
 #define BT_HCI_EVT_LE_CHAN_SELECT_ALG		0x14
 struct bt_hci_evt_le_chan_select_alg {
 	uint16_t handle;
monitor/packet.c +12 -1
index 61bc92d..3c43356 100644
@@ -8695,6 +8695,16 @@ static void le_direct_adv_report_evt(const void *data, uint8_t size)
 		packet_hexdump(data + sizeof(*evt), size - sizeof(*evt));
 }
 
+static void le_phy_update_complete_evt(const void *data, uint8_t size)
+{
+	const struct bt_hci_evt_le_phy_update_complete *evt = data;
+
+	print_status(evt->status);
+	print_handle(evt->handle);
+	print_le_phy("TX PHY", evt->tx_phy);
+	print_le_phy("RX PHY", evt->rx_phy);
+}
+
 static void le_chan_select_alg_evt(const void *data, uint8_t size)
 {
 	const struct bt_hci_evt_le_chan_select_alg *evt = data;
@@ -8769,7 +8779,8 @@ static const struct subevent_data le_meta_event_table[] = {
 				le_enhanced_conn_complete_evt, 30, true },
 	{ 0x0b, "LE Direct Advertising Report",
 				le_direct_adv_report_evt, 1, false },
-	{ 0x0c, "LE PHY Update Complete" },
+	{ 0x0c, "LE PHY Update Complete",
+				le_phy_update_complete_evt, 5, true},
 	{ 0x0d, "LE Extended Advertising Report" },
 	{ 0x0e, "LE Periodic Advertising Sync Established" },
 	{ 0x0f, "LE Periodic Advertising Report" },
Signature · 1 line
2.9.3
#5 lore raw
In reply to Łukasz Rymanowski

Hi =C5=81ukasz,

Quoted 17 lines · On Wednesday, 12 April 2017 14:41:23 CEST =C5=81ukasz Rymanowski wrote:

< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7

        Type: Active (0x01)
        Interval: 30.000 msec (0x0030)
        Window: 30.000 msec (0x0030)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement, inc. directed unresolved
RPA (0x02) ---
 monitor/packet.c | 6 ++++++
 1 file changed, 6 insertions(+)

=20

monitor/packet.c +0 -0
index 5d927f5..219542e 100644
@@ -6309,6 +6309,12 @@ static void le_set_scan_parameters_cmd(const void
 *data, uint8_t size) case 0x01:
 		str =3D "Ignore not in white list";

monitor/packet.c static void le_set_scan_parameters_cmd(const void · line 6320

Quoted 10 lines
monitor/packet.c +6 -0
 		break;
+	case 0x02:
+		str =3D "Accept all advertisement, inc. directed unresolved RPA";
+		break;
+	case 0x03:
+		str =3D "Ignore not in white list, exc. directed unresolved RPA";
+		break;
 	default:
 		str =3D "Reserved";
 		break;

All patches applied, thanks.

=2D-=20
pozdrawiam
Szymon Janc