ble icon indicating copy to clipboard operation
ble copied to clipboard

Make UARTService connection oriented

Open pan- opened this issue 9 years ago • 1 comments

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("...");
    }
}

pan- avatar Oct 27 '15 15:10 pan-

ARM Internal Ref: IOTSFW-1100

rainierwolfcastle avatar Oct 28 '15 14:10 rainierwolfcastle