Bluetooth¶
Bluetooth allows devices in close proximity to transmit data wirelessly. It uses the 2.4 GHz radio frequency band. The xPico 250 supports dual-mode Bluetooth Classic and BLE wireless connectivity.
xPico 250 supports dual-mode Bluetooth. It is capable of communicating with Bluetooth Classic Devices as well as BLE Devices.
In the diagram, the items in gray are supported by xPico 250. Customers have to implement BLE profiles on top of GATT for BLE. For BT Classic, profiles like SPP are included already. Additional profiles are planned for future releases, and the SDK can be utilized to develop them as well.
For sample applications, see the SDK User Guide.
BLE¶
BLE (Bluetooth low-energy) is optimized for short bursts of data transmission and is designed for low power consumption. BLE devices have pre-connection and post-connection roles.
Before connection, a BLE device is a peripheral or a central device. Peripheral devices advertise and wait for a wireless connection from a central device. Central devices scan for peripherals. Once the connection is made, a peripheral device is a slave and a central device is a master.
After connection, a device can be either a client or a server. This is separate from the peripheral/central or slave/master roles. A client accesses resources hosted on the server. In most cases, the peripheral device becomes the server and the central device becomes a client.
BLE is supported only in peripheral mode. BLE central role is planned for a future firmware update.
BLE Peripheral Role¶
In the BLE peripheral role, xPico 250 supports the Gateway Provisioning Profile by default. Use the SDK to build your BLE profiles on top of the GATT layer and integrate it within your own embedded application.
Gateway Provisioning Profile enables communication with the Lantronix Gateway Provisioning mobile application for iOS or Android. Using the application, you can use your mobile device to connect to the gateway, complete initial gateway provisioning, and configure the gateway.
See the Gateway Provisioning mobile application documentation for iOS or Android for more information.
BLE Peripheral Status¶
You can view the BLE Peripheral state, the Bluetooth MAC address for the local Bluetooth device, and the Bluetooth MAC address for the connected device.
In Web Manager, go to Bluetooth > BLE > Peripheral > Status.
For CLI, see Status Bluetooth BLE Peripheral level.
For XML, see configgroup Bluetooth BLE Peripheral.
BLE Peripheral Configuration Settings¶
To enable/disable BLE Peripheral:
In Web Manager, go to Bluetooth > BLE > Peripheral > Configuration.
For CLI, see Config Bluetooth BLE Peripheral level.
For XML, see configgroup Bluetooth BLE Peripheral.
Bluetooth Classic¶
Bluetooth Classic uses the master/slave architecture. The master device scans for slave devices, which respond to the inquiry. The master then initiates a connection.
One master device can connect to a maximum of seven slave devices. A slave device can only be connected to a single master device. A master device can communicate with any slave device to which it's connected. A slave device can communicate only with the master device to which it's connected. The xPico 250 supports the master role with the SPP profile.
Bluetooth Classic Master Mode¶
The xPico 250 uses Bluetooth Classic in the Master role.
Bluetooth Classic Master Status¶
You can view the status of the Bluetooth Classic Master state as well as a list of bonded devices. A bonded device's name, MAC address, Profile, and status is displayed.
In Web Manager, go to Bluetooth > Classic > Master > Status.
For CLI, see Status Bluetooth Classic Master level.
For XML, see configgroup Bluetooth Classic Master.
Bluetooth Classic Master QuickConnect¶
Use QuickConnect to discover and pair to devices. See Bluetooth Classic Master QuickConnect for more information.
Standard operating firmware now support automatic connection management. When devices come within proximity of the gateway, they can start communicating when connected without needing to go through the complete connection management process. In order to transfer data, use the xPico 200 Series SDK.
To access Bluetooth Classic Master QuickConnect in Web Manager, go to Bluetooth > Classic > Master > QuickConnect.
You can see a list of all Bluetooth devices that support SPP within range. This is the discovery phase of the Bluetooth connection process. To perform a directed scan for a particular device, enter the device's MAC address, formatted as xx:xx:xx:xx:xx:xx in the Device MAC field and click Scan. To refresh the scan results every 60 seconds, check the box.
Scan results include device name, MAC address of the device, Received Signal Strength Indication (RSSI), and Profile (only SPP is supported at this time).
Click the MAC address to page and attempt to pair and bond to that device.
The Bluetooth Connect page will open. Enter the passphrase and click Connect to connect to the device. If the device is unable to connect, please check the tlog. See Logging for more information.
In order to communicate and transfer data using the supported Bluetooth Classic profiles, you will need to create your own application using the SDK or modify the included demo.
For CLI, navigate to the status Bluetooth Classic Master
level. Use Broadcast scan
to scan for all Bluetooth devices that support SPP within range. Alternatively, use Directed scan <MAC>
to scan for a particular MAC address. Locate the Bluetooth device to which you want to connect and note its MAC address. To connect to that device, use Connect <MAC> [<passphrase>]
. For more information, see Status Bluetooth Classic Master level.
Bluetooth Classic Configuration Settings¶
To enable/disable Bluetooth Classic Master:
In Web Manager, go to Bluetooth > Classic > Master > Configuration.
For CLI, see Config Bluetooth Classic Master level.
For XML, see configgroup Bluetooth Classic Master.
Bluetooth Connection Process¶
Connecting a Bluetooth device consists of multiple phases.
- Discovery: A BLE central device or Bluetooth Classic master scans for Bluetooth devices that are advertising.
- Paging: A master device pages a slave device to request a connection. The slave device sends a response. This phase is only applicable to Bluetooth Classic.
- Pairing: Two devices exchange security information in order to create a connection.
- Bonding: Two devices store security keys that were exchanged when pairing so they can use them again to connect in the future.
- Connecting: After pairing is successful, the devices are connected.
- Communicating: Once the devices are connected, they can exchange data.