@@ -245,7 +245,7 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
245
245
memset (buffer, 0 , sizeof (buffer));
246
246
247
247
/* Display the timestamp and device address */
248
- if (report->scan_rsp )
248
+ if (report->type . scan_response )
249
249
{
250
250
Serial.printf (" [SR%10d] Packet received from " , millis ());
251
251
}
@@ -258,11 +258,11 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
258
258
Serial.println (" " );
259
259
260
260
/* 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 )
263
263
{
264
264
Serial.printf (" %15s" , " " );
265
- Serial.printBuffer (report->data , report->dlen , ' -' );
265
+ Serial.printBuffer (report->data . p_data , report->data . len , ' -' );
266
266
Serial.println ();
267
267
}
268
268
@@ -271,20 +271,20 @@ void scan_callback(ble_gap_evt_adv_report_t* report)
271
271
272
272
/* Adv Type */
273
273
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 " ) ;
288
288
}
289
289
290
290
/* Shortened Local Name */
0 commit comments