@@ -80,16 +80,16 @@ void setup() {
80
80
81
81
// Create a BLE Characteristic
82
82
pTxCharacteristic = pService->createCharacteristic (
83
- CHARACTERISTIC_UUID_TX,
84
- BLECharacteristic::PROPERTY_NOTIFY
85
- );
86
-
83
+ CHARACTERISTIC_UUID_TX,
84
+ BLECharacteristic::PROPERTY_NOTIFY
85
+ );
86
+
87
87
pTxCharacteristic->addDescriptor (new BLE2902 ());
88
88
89
89
BLECharacteristic * pRxCharacteristic = pService->createCharacteristic (
90
- CHARACTERISTIC_UUID_RX,
91
- BLECharacteristic::PROPERTY_WRITE
92
- );
90
+ CHARACTERISTIC_UUID_RX,
91
+ BLECharacteristic::PROPERTY_WRITE
92
+ );
93
93
94
94
pRxCharacteristic->setCallbacks (new MyCallbacks ());
95
95
@@ -103,23 +103,23 @@ void setup() {
103
103
104
104
void loop () {
105
105
106
- if (deviceConnected) {
107
- pTxCharacteristic->setValue (&txValue, 1 );
108
- pTxCharacteristic->notify ();
109
- txValue++;
110
- delay (10 ); // bluetooth stack will go into congestion, if too many packets are sent
111
- }
112
-
113
- // disconnecting
114
- if (!deviceConnected && oldDeviceConnected) {
115
- delay (500 ); // give the bluetooth stack the chance to get things ready
116
- pServer->startAdvertising (); // restart advertising
117
- Serial.println (" start advertising" );
118
- oldDeviceConnected = deviceConnected;
119
- }
120
- // connecting
121
- if (deviceConnected && !oldDeviceConnected) {
122
- // do stuff here on connecting
123
- oldDeviceConnected = deviceConnected;
124
- }
106
+ if (deviceConnected) {
107
+ pTxCharacteristic->setValue (&txValue, 1 );
108
+ pTxCharacteristic->notify ();
109
+ txValue++;
110
+ delay (10 ); // bluetooth stack will go into congestion, if too many packets are sent
111
+ }
112
+
113
+ // disconnecting
114
+ if (!deviceConnected && oldDeviceConnected) {
115
+ delay (500 ); // give the bluetooth stack the chance to get things ready
116
+ pServer->startAdvertising (); // restart advertising
117
+ Serial.println (" start advertising" );
118
+ oldDeviceConnected = deviceConnected;
119
+ }
120
+ // connecting
121
+ if (deviceConnected && !oldDeviceConnected) {
122
+ // do stuff here on connecting
123
+ oldDeviceConnected = deviceConnected;
124
+ }
125
125
}
0 commit comments