diff options
Diffstat (limited to 'examples/BLE_server_multiconnect/BLE_server_multiconnect.ino')
-rw-r--r-- | examples/BLE_server_multiconnect/BLE_server_multiconnect.ino | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino b/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino index a8bdd63..90704ef 100644 --- a/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino +++ b/examples/BLE_server_multiconnect/BLE_server_multiconnect.ino @@ -40,7 +40,7 @@ uint32_t value = 0; class MyServerCallbacks: public BLEServerCallbacks { void onConnect(BLEServer* pServer) { deviceConnected = true; - BLEAdvertising::startAdvertising(); + BLEDevice::startAdvertising(); }; void onDisconnect(BLEServer* pServer) { @@ -91,10 +91,10 @@ void setup() { void loop() { // notify changed value if (deviceConnected) { - pCharacteristic->setValue(&value, 1); + pCharacteristic->setValue((uint8_t*)&value, 4); pCharacteristic->notify(); value++; - delay(3); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms + delay(10); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms } // disconnecting if (!deviceConnected && oldDeviceConnected) { @@ -108,4 +108,4 @@ void loop() { // do stuff here on connecting oldDeviceConnected = deviceConnected; } -}
\ No newline at end of file +} |