This commit is contained in:
hathach committed 2020-01-15 14:42:47 +07:00
1 parent 9bd542e3e9
commit a2013be604
1 file changed
+17 -17
@@ -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 */