This is a GAP example for the new features introduced in Bluetooth Core Spec v5.0.

Files at this revision

API Documentation at this revision

Comitter:
krenbluetoothsig
Date:
Fri Dec 28 02:42:58 2018 +0000
Parent:
16:bcb55cd411c3
Child:
18:017918f93afe
Commit message:
1. CHG: comment out some timer to make device quiet.

Changed in this revision

source/main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/main.cpp	Thu Dec 27 09:33:32 2018 +0000
+++ b/source/main.cpp	Fri Dec 28 02:42:58 2018 +0000
@@ -33,13 +33,13 @@
 static const uint8_t DEVICE_NAME[]        = "GAP_device";
 
 /* Duration of each mode in milliseconds */
-static const size_t MODE_DURATION_MS      = 6000;
+static const size_t MODE_DURATION_MS      = 20000;
 
 /* Time between each mode in milliseconds */
 static const size_t TIME_BETWEEN_MODES_MS = 2000;
 
 /* how long to wait before disconnecting in milliseconds */
-static const size_t CONNECTION_DURATION = 3000;
+static const size_t CONNECTION_DURATION = 10000;
 
 typedef struct {
     GapAdvertisingParams::AdvertisingType_t adv_type;
@@ -204,7 +204,7 @@
         }
 
         /* for performance measurement keep track of duration of the demo mode */
-        _demo_duration.start();
+        //_demo_duration.start();
         /* keep track of our state */
         _is_connecting = false;
 
@@ -398,7 +398,7 @@
         printf("Disconnected\r\n");
 
         /* we have successfully disconnected ending the demo, move to next mode */
-        _event_queue.call(this, &GAPDevice::demo_mode_end);
+        //_event_queue.call(this, &GAPDevice::demo_mode_end);
     };
 
     /**
@@ -443,10 +443,10 @@
             );
         } else {
             printf(
-                "Phy update on connection %d - Tx Phy: %s, Rx Phy: %s\r\n",
+                "Phy update on connection %d - Tx Phy: %d, Rx Phy: %d\r\n",
                 connectionHandle,
-                to_string(txPhy),
-                to_string(rxPhy)
+                txPhy.value(), /*to_string(txPhy),*/
+                rxPhy.value() /*to_string(rxPhy)*/
             );
         }
     }