diff options
author | chegewara <imperiaonline4@gmail.com> | 2018-11-30 16:36:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-30 16:36:28 +0100 |
commit | 11a0aa645326aed0cb681e86060fe28d4623bc68 (patch) | |
tree | de74bc4c1a1ca394c59548d879178aa617f129c5 | |
parent | Update BLE_client.ino (diff) | |
download | thermostat-11a0aa645326aed0cb681e86060fe28d4623bc68.tar.gz thermostat-11a0aa645326aed0cb681e86060fe28d4623bc68.tar.bz2 thermostat-11a0aa645326aed0cb681e86060fe28d4623bc68.zip |
Update 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 +} |