Closed gkoh closed 1 month ago
NimBLE device is configured as a server and advertises. Smartphone client scans, can see peripheral device name and connects.
After connection, would like server to use existing connection to query (and display) client device name via service 0x1800 and characteristic 0x2A00.
0x1800
0x2A00
onConnect()
NimBLEClient::connect()
ble_gap_conn_find_by_addr()
ble_gap_conn_desc
NimBLEClient
NimBLEServer
Work in progress here: https://github.com/h2zero/esp-nimble-cpp/pull/156
API added to master branch here: https://github.com/h2zero/NimBLE-Arduino/commit/6db036830c58ae85e3f691ceebada96e6d8ba4af
API added to master branch here: 6db0368
Nice! Once again, much thanks and appreciation.
Use Case
NimBLE device is configured as a server and advertises. Smartphone client scans, can see peripheral device name and connects.
After connection, would like server to use existing connection to query (and display) client device name via service
0x1800
and characteristic0x2A00
.What I've tried
onConnect()
NimBLEClient::connect()
to this addressble_gap_conn_find_by_addr()
finding the existing underlying connectionWhat I hacked to prove it's possible
NimBLEClient::connect()
to:ble_gap_conn_desc
output ofble_gap_conn_find_by_addr()
checkNimBLEClient
connected with the details from the gap conn descPossible Solutions
NimBLEClient::connect()
to allow and succeed with an already connected OTA addressNimBLEServer
for getting a properly connectedNimBLEClient
based on the underlying connection