BLE Connection Element
The BLE connection element is used to control the Bluetooth Low Energy (BLE) connection between the embedded device and the mobile app. It also allows setting general properties and settings for the BLE connection.
The BLE connection element is located in the Element Toolbox within Studio’s the Embedded tab. When a BLE connection element is added to the canvas, it creates a coupled version in the project’s Application tab that bridges the element’s functionality between the two tabs.
Properties
The following properties can be changed for the BLE connection element:
Name
The name of the element.
Instance
The BLE driver instance number to use. If unsure, leave this set to the default value.
Pairing Type
The pairing method used when connecting over BLE. This element includes the following pairing types:
Just Works
: The device connects to the mobile app automatically.Random Passkey
: Generate a random passkey, which will be required in order for the device to connect to the mobile app.Custom Passkey
: Define your own passkey. If this pairing type is selected, theCustom Passkey
field is used to connect to the mobile app.
The
Just Works
pairing type is not currently available in NXP Rapid IoT projects. TheCustom Passkey
pairing type is not currently available in ESP32 projects. TheRandom Passkey
andCustom Passkey
pairing types are not available on the CYW920819EVB-2 board.
Custom Passkey
Define a custom passkey for pairing. This field is ignored unless the Custom Passkey
pairing type is selected.
Triggers
The following triggers are available to execute events from within the BLE connection element:
Embedded Triggers
Triggered
Execute an event when the source element connected to the BLE connection triggers.
Connected
Execute an event when the device connects over BLE.
Disconnected
Execute an event when the device disconnects from its BLE connection.
Pairing Requested
Execute an event when a pairing request is made. If the pairing type uses a passkey, the passkey is passed with this trigger, which can then be displayed on a serial console or within the project’s interface.
Pairing Succeeded
Execute an event when the device successfully pairs to the mobile app.
Pairing Failed
Execute an event when the device fails to pair to the mobile app.
Application Triggers
Triggered
Execute an event when the source element connected to the BLE connection triggers.
Connected
Execute an event when the device connects to the mobile app.
Disconnected
Execute an event when the device disconnects from the mobile app.
Abilities
The following abilities are available for the BLE connection element when its source element triggers:
Embedded Abilities
Trigger
Trigger the element(s) that follow the BLE connection element.
Disconnect
Disconnect the device from the mobile app.
Application Abilities
Trigger
Trigger the element(s) that follow the BLE connection element.