From 11a0aa645326aed0cb681e86060fe28d4623bc68 Mon Sep 17 00:00:00 2001 From: chegewara Date: Fri, 30 Nov 2018 16:36:28 +0100 Subject: Update BLE_server_multiconnect.ino --- examples/BLE_server_multiconnect/BLE_server_multiconnect.ino | 8 ++++---- 1 file 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 +} -- cgit v1.2.3