Skip to content

Bluetooth Interface

In operation as a CAN-Bluetooth Interface, CAN data is transmitted wirelessly to other Bluetooth-capable devices such as PCs, smartphones, or tablets.

Supported Bluetooth Protocols

Protocol Supported
SPP
HID
PAN

CAN-CAN-Bluetooth Bridge

In operation as a CAN-CAN-Bluetooth Bridge, CAN data is transmitted wirelessly between two CANlink® wireless 4000 devices via a Bluetooth connection.
The CAN-CAN-Bluetooth Bridge acts as a substitute for CAN cables, e.g. in drag chains or remote control units.

Configuring a Bluetooth Bridge

SERVER

  1. Disable Wi-Fi
    Write 0 (Disable) to 0x3008:0x02 [Wlan Enable]

  2. Disable BLE
    Write 0 (Disable) to 0x3008:0x09 [BLE Enable]

  3. Enable Bluetooth
    Write 1 (Enable) to 0x3008:0x03 [Bluetooth Enable]

  4. Enable Server
    Write 2 (Server Enabled) to 0x3010:0x15 [EEP Connection Direction Configuration/Server or Client1]

  5. Enable Bluetooth SPP
    Write 2 (SPP) to 0x3010:0x16 [EEP Connect Type 1]

  6. Make Discoverable
    Write 1 (Enabled) to 0x3002:0x01 [Discoverable]

  7. Read and save the MAC address for Client access
    Read 0x3007:0x01 [Bluetooth Mac Address (Bluetooth Address)]

  8. Optionally set a PIN for secure access by a Client device

    • Write PIN into 0x3002:0x06 [BT Classic Pin Code].
      The maximum length of the PIN code is 15 bytes.
    • Also set 0x3002:0x07 [BT Classic Enforce Pin Code] to 1 (Enable).

CLIENT

  1. Disable Wi-Fi
    Write 0 (Disable) to 0x3008:0x02 [Wlan Enable]

  2. Disable BLE
    Write 0 (Disable) to 0x3008:0x09 [BLE Enable]

  3. Enable Bluetooth
    Write 1 (Enable) to 0x3008:0x03 [Bluetooth Enable]

  4. Enable Client
    Write 3 (Client Enabled) to 0x3010:0x15 [EEP Connection Direction Configuration/Server or Client1]

  5. Enable Bluetooth SPP
    Write 2 (SPP) to 0x3010:0x16 [EEP Connect Type 1]

  6. Set Server MAC address
    Write the value read in step (7) in the Server directions to 0x3010:0x1A [EEP Bluetooth SP MAC Address 1].

    • This is a 12-character ASCII field, that represents a 6-byte Hexadecimal MAC Address.
      For example 84BA20096D04
    • (This is not case-sensitive).
  7. Optionally configure the PIN

    • Write the appropriate PIN into 0x3002:0x06 [BT Classic Pin Code].

Using Bluetooth PIN

A Personal Identification Number (PIN) may be used on a Bluetooth connection to offer some authentication security.

The PIN is set on the Bluetooth Server device, and the Client requesting connection must supply that same PIN in order to have the request accepted.

The maximum length of the PIN code is 15 characters.

This should be read in conjunction with the general Bluetooth guidance.

Note

Once a Client has 'paired' to a Server, it will always be allowed reconnection.
This means that if a Client that successfully used a PIN to connect, then the PIN on the Server was changed - the Client will still connect. To prevent this, the user must clear all previously paired devices from the Server.

Write 0x64616F6C to 0x1011:0x66 [Delete BT Classic paired devices] to reset all paired Bluetooth classic devices.

See List Currently Paired Devices for more information.

After this, if the Server has the PIN enabled, all Clients must also have that same PIN to connect.

Enabling Bluetooth PIN

On the Server device

  1. Set 0x3002:0x06 [BT Classic Pin Code] to the desired value.

  2. Set 0x3002:0x07 [BT Classic Enforce Pin Code] to 1 (Enable).

On the Client device

  1. Set 0x3002:0x06 [BT Classic Pin Code] to the *same value as on the Server for the same object.

If the Server is configured as above, it will request a PIN from any Client attempting connection.
Only if the PIN matches, does the connection proceed.

Disabling Bluetooth PIN

On the Server device, set 0x3002:0x07 [BT Classic Enforce Pin Code] to 0 (Disable).

This means any Client will be allowed to connect.

Warning

For security reasons, do not disable the PIN on the Server device.
If disabled, any BT Client will be able to connect!

Disabling the PIN might be acceptable only when other measures ensure that no unauthorized personnel or device can come within connection-distance from the Server device.
For example, when the Server device is located in an area with physical restrictions.

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.