Skip to content

Commit e01ac26

Browse files
authored
Merge pull request #420 from adafruit/develop
fix #391
2 parents 3a7597d + a2013be commit e01ac26

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
245245
memset(buffer, 0, sizeof(buffer));
246246

247247
/* Display the timestamp and device address */
248-
if (report->scan_rsp)
248+
if (report->type.scan_response)
249249
{
250250
Serial.printf("[SR%10d] Packet received from ", millis());
251251
}
@@ -258,11 +258,11 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
258258
Serial.println("");
259259

260260
/* Raw buffer contents */
261-
Serial.printf("%14s %d bytes\n", "PAYLOAD", report->dlen);
262-
if (report->dlen)
261+
Serial.printf("%14s %d bytes\n", "PAYLOAD", report->data.len);
262+
if (report->data.len)
263263
{
264264
Serial.printf("%15s", " ");
265-
Serial.printBuffer(report->data, report->dlen, '-');
265+
Serial.printBuffer(report->data.p_data, report->data.len, '-');
266266
Serial.println();
267267
}
268268

@@ -271,20 +271,20 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
271271

272272
/* Adv Type */
273273
Serial.printf("%14s ", "ADV TYPE");
274-
switch (report->type)
275-
{
276-
case BLE_GAP_ADV_TYPE_ADV_IND:
277-
Serial.printf("Connectable undirected\n");
278-
break;
279-
case BLE_GAP_ADV_TYPE_ADV_DIRECT_IND:
280-
Serial.printf("Connectable directed\n");
281-
break;
282-
case BLE_GAP_ADV_TYPE_ADV_SCAN_IND:
283-
Serial.printf("Scannable undirected\n");
284-
break;
285-
case BLE_GAP_ADV_TYPE_ADV_NONCONN_IND:
286-
Serial.printf("Non-connectable undirected\n");
287-
break;
274+
if ( report->type.connectable )
275+
{
276+
Serial.print("Connectable ");
277+
}else
278+
{
279+
Serial.print("Non-connectable ");
280+
}
281+
282+
if ( report->type.directed )
283+
{
284+
Serial.println("directed");
285+
}else
286+
{
287+
Serial.println("undirected");
288288
}
289289

290290
/* Shortened Local Name */

0 commit comments

Comments
 (0)