@@ -265,7 +265,7 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
265
265
/* Gap::EventHandler */
266
266
267
267
/* * Look at scan payload to find a peer device and connect to it */
268
- virtual void onAdvertisingReport (const ble::AdvertisingReportEvent &event)
268
+ void onAdvertisingReport (const ble::AdvertisingReportEvent &event) override
269
269
{
270
270
/* keep track of scan events for performance reporting */
271
271
_scan_count++;
@@ -317,22 +317,27 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
317
317
}
318
318
}
319
319
320
- virtual void onAdvertisingEnd (const ble::AdvertisingEndEvent &event)
320
+ void onAdvertisingEnd (const ble::AdvertisingEndEvent &event) override
321
321
{
322
322
if (event.isConnected ()) {
323
323
printf (" Stopped advertising early due to connection\r\n " );
324
324
}
325
325
}
326
326
327
- virtual void onScanTimeout (const ble::ScanTimeoutEvent&)
327
+ void onAdvertisingStart (const ble::AdvertisingStartEvent &event) override
328
+ {
329
+ printf (" Advertising set %d started\r\n " , event.getAdvHandle ());
330
+ }
331
+
332
+ void onScanTimeout (const ble::ScanTimeoutEvent&) override
328
333
{
329
334
printf (" Stopped scanning due to timeout parameter\r\n " );
330
335
_event_queue.call (this , &GapDemo::end_scanning_mode);
331
336
}
332
337
333
338
/* * This is called by Gap to notify the application we connected,
334
339
* in our case it immediately disconnects */
335
- virtual void onConnectionComplete (const ble::ConnectionCompleteEvent &event)
340
+ void onConnectionComplete (const ble::ConnectionCompleteEvent &event) override
336
341
{
337
342
_is_connecting = false ;
338
343
_demo_duration.stop ();
@@ -370,7 +375,7 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
370
375
371
376
/* * This is called by Gap to notify the application we disconnected,
372
377
* in our case it calls next_demo_mode() to progress the demo */
373
- virtual void onDisconnectionComplete (const ble::DisconnectionCompleteEvent &event)
378
+ void onDisconnectionComplete (const ble::DisconnectionCompleteEvent &event) override
374
379
{
375
380
printf (" Disconnected\r\n " );
376
381
@@ -389,12 +394,12 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
389
394
/* *
390
395
* Implementation of Gap::EventHandler::onReadPhy
391
396
*/
392
- virtual void onReadPhy (
397
+ void onReadPhy (
393
398
ble_error_t error,
394
399
ble::connection_handle_t connectionHandle,
395
400
ble::phy_t txPhy,
396
401
ble::phy_t rxPhy
397
- )
402
+ ) override
398
403
{
399
404
if (error) {
400
405
printf (
@@ -412,12 +417,12 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
412
417
/* *
413
418
* Implementation of Gap::EventHandler::onPhyUpdateComplete
414
419
*/
415
- virtual void onPhyUpdateComplete (
420
+ void onPhyUpdateComplete (
416
421
ble_error_t error,
417
422
ble::connection_handle_t connectionHandle,
418
423
ble::phy_t txPhy,
419
424
ble::phy_t rxPhy
420
- )
425
+ ) override
421
426
{
422
427
if (error) {
423
428
printf (
@@ -435,11 +440,11 @@ class GapDemo : private mbed::NonCopyable<GapDemo>, public ble::Gap::EventHandle
435
440
/* *
436
441
* Implementation of Gap::EventHandler::onDataLengthChange
437
442
*/
438
- virtual void onDataLengthChange (
443
+ void onDataLengthChange (
439
444
ble::connection_handle_t connectionHandle,
440
445
uint16_t txSize,
441
446
uint16_t rxSize
442
- )
447
+ ) override
443
448
{
444
449
printf (
445
450
" Data length changed on the connection %d.\r\n "
0 commit comments