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
0d564d7b
Commit
0d564d7b
authored
Nov 20, 2018
by
Nikos Mouratidis
Committed by
Me No Dev
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit the number of simultaneously connected devices to BluetoothSerial to only 1 (#2061)
parent
44ca2ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
libraries/BluetoothSerial/src/BluetoothSerial.cpp
libraries/BluetoothSerial/src/BluetoothSerial.cpp
+12
-2
No files found.
libraries/BluetoothSerial/src/BluetoothSerial.cpp
View file @
0d564d7b
...
...
@@ -50,6 +50,7 @@ static xQueueHandle _spp_tx_queue = NULL;
static
SemaphoreHandle_t
_spp_tx_done
=
NULL
;
static
TaskHandle_t
_spp_task_handle
=
NULL
;
static
EventGroupHandle_t
_spp_event_group
=
NULL
;
static
boolean
secondConnectionAttempt
;
#define SPP_RUNNING 0x01
#define SPP_CONNECTED 0x02
...
...
@@ -162,13 +163,22 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
break
;
case
ESP_SPP_SRV_OPEN_EVT
:
//Server connection open
_spp_client
=
param
->
open
.
handle
;
if
(
!
_spp_client
){
_spp_client
=
param
->
open
.
handle
;
}
else
{
secondConnectionAttempt
=
true
;
esp_spp_disconnect
(
param
->
open
.
handle
);
}
xEventGroupSetBits
(
_spp_event_group
,
SPP_CONNECTED
);
log_i
(
"ESP_SPP_SRV_OPEN_EVT"
);
break
;
case
ESP_SPP_CLOSE_EVT
:
//Client connection closed
_spp_client
=
0
;
if
(
secondConnectionAttempt
)
{
secondConnectionAttempt
=
false
;
}
else
{
_spp_client
=
0
;
}
xEventGroupClearBits
(
_spp_event_group
,
SPP_CONNECTED
);
log_i
(
"ESP_SPP_CLOSE_EVT"
);
break
;
...
...
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