Skip to content

Commit 11a0aa6

Browse files
authored
Update BLE_server_multiconnect.ino
1 parent e5ff90d commit 11a0aa6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/BLE_server_multiconnect/BLE_server_multiconnect.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ uint32_t value = 0;
4040
class MyServerCallbacks: public BLEServerCallbacks {
4141
void onConnect(BLEServer* pServer) {
4242
deviceConnected = true;
43-
BLEAdvertising::startAdvertising();
43+
BLEDevice::startAdvertising();
4444
};
4545

4646
void onDisconnect(BLEServer* pServer) {
@@ -91,10 +91,10 @@ void setup() {
9191
void loop() {
9292
// notify changed value
9393
if (deviceConnected) {
94-
pCharacteristic->setValue(&value, 1);
94+
pCharacteristic->setValue((uint8_t*)&value, 4);
9595
pCharacteristic->notify();
9696
value++;
97-
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
97+
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
9898
}
9999
// disconnecting
100100
if (!deviceConnected && oldDeviceConnected) {
@@ -108,4 +108,4 @@ void loop() {
108108
// do stuff here on connecting
109109
oldDeviceConnected = deviceConnected;
110110
}
111-
}
111+
}

0 commit comments

Comments
 (0)