apps/btshell: Add more printouts to extended advertising event
@@ -907,9 +907,15 @@ btshell_decode_adv_data(uint8_t *adv_data, uint8_t adv_data_len)
static void
btshell_decode_event_type(struct ble_gap_ext_disc_desc *desc)
{
+ uint8_t directed = 0;
+
if (desc->props & BLE_HCI_ADV_LEGACY_MASK) {
console_printf("Legacy PDU type %d", desc->legacy_event_type);
- goto adv_data;
+ if (desc->legacy_event_type == BLE_HCI_ADV_TYPE_ADV_DIRECT_IND_HD ||
+ desc->legacy_event_type == BLE_HCI_ADV_TYPE_ADV_DIRECT_IND_LD) {
+ directed = 1;
+ }
+ goto common_data;
}
console_printf("Extended adv: ");
@@ -921,6 +927,7 @@ btshell_decode_event_type(struct ble_gap_ext_disc_desc *desc)
}
if (desc->props & BLE_HCI_ADV_DIRECT_MASK) {
console_printf("'dir' ");
+ directed = 1;
}
if (desc->props & BLE_HCI_ADV_SCAN_RSP_MASK) {
@@ -941,9 +948,20 @@ btshell_decode_event_type(struct ble_gap_ext_disc_desc *desc)
console_printf("reserved %d", desc->data_status);
break;
}
+
+common_data:
+ console_printf(" rssi=%d txpower=%d, pphy=%d, sphy=%d, sid=%d,"
+ " addr_type=%d addr=",
+ desc->rssi, desc->tx_power, desc->prim_phy, desc->sec_phy,
+ desc->sid, desc->addr.type);
+ print_addr(desc->addr.val);
+ if (directed) {
+ console_printf(" init_addr_type=%d inita=", desc->direct_addr.type);
+ print_addr(desc->direct_addr.val);
+ }
+
console_printf("\n");
-adv_data:
if(!desc->length_data) {
return;
}
