Skip to content

Pairing

Bluetooth Paired Devices

The CANlink® wireless 4000 offers a local Bluetooth connection in order to connect to another CANlink® wireless 4000 device (in ‘Bridge’ mode), or another device such as a mobile phone or PC (in ‘Gateway’ mode) to transfer CAN data.

In order to establish a secure connection between two devices, there are several steps which all combine to form the Bluetooth “Pairing” process.

To pair devices, refer to Enabling Bluetooth PIN

  1. Discovery
    One device (the initiator) searches for nearby Bluetooth devices. This is what the CANlink® wireless 4000 does when configured as a Client. The other device (the responder) makes itself discoverable. The CANlink® wireless 4000 Server has this responsibility.

  2. Initiation
    The initiator sends a pairing request to the responder. This request includes information like the device name and type.

  3. Authentication
    Both devices exchange a unique code, often called a PIN or passkey. This step ensures that the devices are authorized to connect with each other.

  4. Bonding
    Once the devices are authenticated, they create a bond. This involves storing the pairing information so that they can reconnect automatically in the future without repeating the pairing process.

  5. Connection
    After bonding, the devices establish a secure connection. They can now communicate and exchange data over the Bluetooth link.

  6. Communication
    With the connection established, the devices can now transfer data, such as audio, files, or other types of information.

In step four, the newly paired device is added to an internal list in the CANlink® wireless 4000.
This simplifies subsequent pairing - but has one drawback: If the Bluetooth PIN code on the Server is changed, a device that has already paired may still connect with the old, invalid PIN.

In order to prevent this happening, the user may check all paired devices, and remove them from this internal list, in the following manner:

List currently paired devices

The user can read 0x3002:0x09 [BT Classic list of paired devices] to see all currently paired devices.
The object returned is a JSON structure that will look similar to this example.

Currently paired Bluetooth devices:

{
   "version": "1.0.0",
      "bt_classic_paired_devices": [
      {
         "mac": "040D8435110E"
      },
      {
         "mac": "3003C86A6904"
      }
   ]
}

Remove all paired devices

When 0x64616F6C is written to 0x1011:0x66 [Delete BT Classic paired devices], the deletion of all devices in the paired list is triggered.

To check, the 0x3002:0x09 [BT Classic list of paired devices] object can be read, and will return:

No currently paired Bluetooth devices:

{
   "version": "1.0.0",
   "bt_classic_paired_devices": [
   ]
}

If no devices are in this list, then the Client device must supply the correct PIN for successful connection if 0x3002:0x07 [BT Classic Enforce Pin Code] is enabled in the Server device.