Reconnect a Gadget to an Echo Device Over Classic Bluetooth


If a gadget and an Echo device are paired over Classic Bluetooth (BR/EDR) but have become disconnected, a user can trigger the gadget to reconnect to the Echo device. To reconnect to the Echo device, the gadget initiates a Service Discovery Protocol (SDP) connection, as described in this topic.

For Alexa Gadgets Toolkit issues related to Bluetooth, see Bluetooth on the known issues page.

Overview

The following figure shows how a user triggers a gadget, which is paired to but disconnected from an Echo device, to re-establish the connection with the Echo device using SDP. The steps are explained after the figure.

Reconnection Flow for an Alexa Gadget and an Echo Device over Classic Bluetooth

When a user takes an action on a gadget, such as pressing a button, the gadget can initiate an SDP connection to an Echo device that it is paired to but has become disconnected from. To initiate the SDP connection, the gadget sends the Echo device an SDP attribute request using the parameters listed in SDP Initiation Settings. When the Echo device responds to the request with the appropriate attributes, the link layer connection is established.

RFCOMM connection phase

In this step, which is identical to the RFCOMM connection phase in the initial connection flow, the Echo device sends the gadget a request to connect to its RFCOMM server. For this connection to be established, the gadget's local SDP database must contain the settings listed in SDP Database Settings.

SDP disconnection phase

Now that the Echo device is reconnected to the gadget's RFCOMM server, the gadget and the Echo device can disconnect their SDP connection. This step might happen now or sometime in the future.

Alexa Gadgets Toolkit directives and events

As in the initial connection flow, the Echo device and the gadget now exchange the following information using protocol buffer format:

  1. The Echo device sends the gadget a Discover directive.
  2. The gadget responds with a Discover.Response event that, along with other information, contains a hash of the DSN and the device type secret that your gadget was assigned when you registered it in the developer portal.
  3. The Echo device and the gadget exchange directives and events that are defined by the Alexa Gadgets Toolkit interfaces.

Was this page helpful?

Last updated: Feb 14, 2022