From a2013be604ac6bdfeb59acc6dbfd47f308c38efc Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 15 Jan 2020 14:42:47 +0700 Subject: [PATCH] fix #391 --- .../rssi_proximity_central.ino | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino b/libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino index db77fb84..e34da766 100644 --- a/libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino +++ b/libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino @@ -245,7 +245,7 @@ void scan_callback(ble_gap_evt_adv_report_t* report) memset(buffer, 0, sizeof(buffer)); /* Display the timestamp and device address */ - if (report->scan_rsp) + if (report->type.scan_response) { Serial.printf("[SR%10d] Packet received from ", millis()); } @@ -258,11 +258,11 @@ void scan_callback(ble_gap_evt_adv_report_t* report) Serial.println(""); /* Raw buffer contents */ - Serial.printf("%14s %d bytes\n", "PAYLOAD", report->dlen); - if (report->dlen) + Serial.printf("%14s %d bytes\n", "PAYLOAD", report->data.len); + if (report->data.len) { Serial.printf("%15s", " "); - Serial.printBuffer(report->data, report->dlen, '-'); + Serial.printBuffer(report->data.p_data, report->data.len, '-'); Serial.println(); } @@ -271,20 +271,20 @@ void scan_callback(ble_gap_evt_adv_report_t* report) /* Adv Type */ Serial.printf("%14s ", "ADV TYPE"); - switch (report->type) + if ( report->type.connectable ) { - case BLE_GAP_ADV_TYPE_ADV_IND: - Serial.printf("Connectable undirected\n"); - break; - case BLE_GAP_ADV_TYPE_ADV_DIRECT_IND: - Serial.printf("Connectable directed\n"); - break; - case BLE_GAP_ADV_TYPE_ADV_SCAN_IND: - Serial.printf("Scannable undirected\n"); - break; - case BLE_GAP_ADV_TYPE_ADV_NONCONN_IND: - Serial.printf("Non-connectable undirected\n"); - break; + Serial.print("Connectable "); + }else + { + Serial.print("Non-connectable "); + } + + if ( report->type.directed ) + { + Serial.println("directed"); + }else + { + Serial.println("undirected"); } /* Shortened Local Name */