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
e1b56fca
Unverified
Commit
e1b56fca
authored
Jun 24, 2022
by
Rodrigo Garcia
Committed by
GitHub
Jun 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes reading BLE Remote Descriptor (#6903)
parent
9ab81837
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
libraries/BLE/src/BLERemoteDescriptor.cpp
libraries/BLE/src/BLERemoteDescriptor.cpp
+19
-2
No files found.
libraries/BLE/src/BLERemoteDescriptor.cpp
View file @
e1b56fca
...
...
@@ -51,9 +51,26 @@ BLEUUID BLERemoteDescriptor::getUUID() {
void
BLERemoteDescriptor
::
gattClientEventHandler
(
esp_gattc_cb_event_t
event
,
esp_gatt_if_t
gattc_if
,
esp_ble_gattc_cb_param_t
*
evtParam
)
{
switch
(
event
)
{
// ESP_GATTC_READ_DESCR_EVT
// This event indicates that the server has responded to the read request.
//
// read:
// - esp_gatt_status_t status
// - uint16_t conn_id
// - uint16_t handle
// - uint8_t* value
// - uint16_t value_len
case
ESP_GATTC_READ_DESCR_EVT
:
if
(
evtParam
->
read
.
handle
!=
getHandle
())
break
;
// If this event is not for us, then nothing further to do.
if
(
evtParam
->
read
.
handle
!=
getHandle
())
break
;
// At this point, we have determined that the event is for us, so now we save the value
if
(
evtParam
->
read
.
status
==
ESP_GATT_OK
)
{
// it will read the cached value of the descriptor
m_value
=
std
::
string
((
char
*
)
evtParam
->
read
.
value
,
evtParam
->
read
.
value_len
);
}
else
{
m_value
=
""
;
}
// Unlock the semaphore to ensure that the requestor of the data can continue.
m_semaphoreReadDescrEvt
.
give
();
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