Fix indentation (#9343)

This commit is contained in:
Lucas Saavedra Vaz 2024-03-05 15:56:46 -03:00 committed by GitHub
parent df60991509
commit 4123e20a2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,16 +80,16 @@ void setup() {
// Create a BLE Characteristic // Create a BLE Characteristic
pTxCharacteristic = pService->createCharacteristic( pTxCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_TX, CHARACTERISTIC_UUID_TX,
BLECharacteristic::PROPERTY_NOTIFY BLECharacteristic::PROPERTY_NOTIFY
); );
pTxCharacteristic->addDescriptor(new BLE2902()); pTxCharacteristic->addDescriptor(new BLE2902());
BLECharacteristic * pRxCharacteristic = pService->createCharacteristic( BLECharacteristic * pRxCharacteristic = pService->createCharacteristic(
CHARACTERISTIC_UUID_RX, CHARACTERISTIC_UUID_RX,
BLECharacteristic::PROPERTY_WRITE BLECharacteristic::PROPERTY_WRITE
); );
pRxCharacteristic->setCallbacks(new MyCallbacks()); pRxCharacteristic->setCallbacks(new MyCallbacks());
@ -103,23 +103,23 @@ void setup() {
void loop() { void loop() {
if (deviceConnected) { if (deviceConnected) {
pTxCharacteristic->setValue(&txValue, 1); pTxCharacteristic->setValue(&txValue, 1);
pTxCharacteristic->notify(); pTxCharacteristic->notify();
txValue++; txValue++;
delay(10); // bluetooth stack will go into congestion, if too many packets are sent delay(10); // bluetooth stack will go into congestion, if too many packets are sent
} }
// disconnecting // disconnecting
if (!deviceConnected && oldDeviceConnected) { if (!deviceConnected && oldDeviceConnected) {
delay(500); // give the bluetooth stack the chance to get things ready delay(500); // give the bluetooth stack the chance to get things ready
pServer->startAdvertising(); // restart advertising pServer->startAdvertising(); // restart advertising
Serial.println("start advertising"); Serial.println("start advertising");
oldDeviceConnected = deviceConnected; oldDeviceConnected = deviceConnected;
} }
// connecting // connecting
if (deviceConnected && !oldDeviceConnected) { if (deviceConnected && !oldDeviceConnected) {
// do stuff here on connecting // do stuff here on connecting
oldDeviceConnected = deviceConnected; oldDeviceConnected = deviceConnected;
} }
} }