Skip to content

Cannot swap BLE connections or trigger manual disconnect. #5

@bobsupercow

Description

@bobsupercow

With the current setup, I cannot trigger a BLE disconnect to trigger pairing mode, or swap to another, already paired device.

Use case is an NRF52840 that is sealed up in a case and not easily accessible. Ideally, we should be able to trigger either a swap or disconnect/pairing programmatically, or even via a particular keycode.

Can you present the underlying Bluefruit.connection for this.

Similar code using Bluefruit library directly:

uint16_t connectionHandle = 0;
BLEConnection* connection = NULL;

connectionHandle = Bluefruit.connHandle();
connection = Bluefruit.Connection(connectionHandle);

delay(2000);
connection->disconnect();
void bleDisconnectAll(){
  for (int i = 0; i < MAXIMUM_SWAP_CONNECTIONS; ++i) {
    if (conn_handles[i] != INVALID_CONN_HANDLE) {
      if (Bluefruit.connected(conn_handles[i]))Bluefruit.disconnect(conn_handles[i]) ;
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions