Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
4123e20a
Unverified
Commit
4123e20a
authored
Mar 05, 2024
by
Lucas Saavedra Vaz
Committed by
GitHub
Mar 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation (#9343)
parent
df609915
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
libraries/BLE/examples/UART/UART.ino
libraries/BLE/examples/UART/UART.ino
+26
-26
No files found.
libraries/BLE/examples/UART/UART.ino
View file @
4123e20a
...
...
@@ -80,16 +80,16 @@ void setup() {
// Create a BLE Characteristic
pTxCharacteristic
=
pService
->
createCharacteristic
(
CHARACTERISTIC_UUID_TX
,
BLECharacteristic
::
PROPERTY_NOTIFY
);
CHARACTERISTIC_UUID_TX
,
BLECharacteristic
::
PROPERTY_NOTIFY
);
pTxCharacteristic
->
addDescriptor
(
new
BLE2902
());
BLECharacteristic
*
pRxCharacteristic
=
pService
->
createCharacteristic
(
CHARACTERISTIC_UUID_RX
,
BLECharacteristic
::
PROPERTY_WRITE
);
CHARACTERISTIC_UUID_RX
,
BLECharacteristic
::
PROPERTY_WRITE
);
pRxCharacteristic
->
setCallbacks
(
new
MyCallbacks
());
...
...
@@ -103,23 +103,23 @@ void setup() {
void
loop
()
{
if
(
deviceConnected
)
{
pTxCharacteristic
->
setValue
(
&
txValue
,
1
);
pTxCharacteristic
->
notify
();
txValue
++
;
delay
(
10
);
// bluetooth stack will go into congestion, if too many packets are sent
}
// disconnecting
if
(
!
deviceConnected
&&
oldDeviceConnected
)
{
delay
(
500
);
// give the bluetooth stack the chance to get things ready
pServer
->
startAdvertising
();
// restart advertising
Serial
.
println
(
"start advertising"
);
oldDeviceConnected
=
deviceConnected
;
}
// connecting
if
(
deviceConnected
&&
!
oldDeviceConnected
)
{
// do stuff here on connecting
oldDeviceConnected
=
deviceConnected
;
}
if
(
deviceConnected
)
{
pTxCharacteristic
->
setValue
(
&
txValue
,
1
);
pTxCharacteristic
->
notify
();
txValue
++
;
delay
(
10
);
// bluetooth stack will go into congestion, if too many packets are sent
}
// disconnecting
if
(
!
deviceConnected
&&
oldDeviceConnected
)
{
delay
(
500
);
// give the bluetooth stack the chance to get things ready
pServer
->
startAdvertising
();
// restart advertising
Serial
.
println
(
"start advertising"
);
oldDeviceConnected
=
deviceConnected
;
}
// connecting
if
(
deviceConnected
&&
!
oldDeviceConnected
)
{
// do stuff here on connecting
oldDeviceConnected
=
deviceConnected
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment