ARMmbed / ARMmbed/ble

Make UARTService connection oriented

Open
#88 1 comment 0 reactions 0 assignees View on GitHub
enhancement mirrored
Dominant language
C++
Stars
81
Forks
71
PR merge metrics
No merged PRs in 30d

Description

The UART service can only be used with one connection at the moment, as soon as a second connection happen on the device, the write operation stop working (see https://developer.mbed.org/forum/team-63-Bluetooth-Low-Energy-community/post/40093/ and the following response).

It would be great if each BLE connection can have its own UART connection.

``` c++
UARTService* uartService;

// gap connection handle
void handleConnection(const Gap::ConnectionCallbackParams_t *params) {
if(params->role == Gap::PERIPHERAL) {
UARTService::Connection* uartConnection = uartService.getConnection(params->handle);
// at this point the UART connection is usable ...
uartConnection->onDataWriten(/* handle the RX */);
uartConnection->writeString("...");
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start at the UARTService API and the Gap::ConnectionCallbackParams_t callback example in this issue, then trace how getConnection(params->handle) and writeString currently handle connections. Confirm the behavior described in the linked mbed forum discussion and define completion as independent UART connections whose writes continue to work when a second BLE connection is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.