ble
ble copied to clipboard
Make UARTService connection oriented
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.
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("...");
}
}
ARM Internal Ref: IOTSFW-1100