--- title: "Bluetooth Component" slug: "bluetooth-component" updated: 2023-12-06T10:16:59Z published: 2023-12-06T10:16:59Z canonical: "help.pillir.io/bluetooth-component" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Bluetooth Component The EdgeReady platform allows the EdgeReady Apps to connect to Bluetooth devices through the bluetooth component. The logic for this connection can be implemented using the following blocks: ## BTDeviceGetList This block retrieves the list of bluetooth devices that are available nearby. It has two callback functions: - The Discovered list function retrieves the available devices in the range - The Disappeared list function retrieves the devices that has gone out of range | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Table Variable | Returns the list of available devices | ![Bluetooth-getdevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/Bluetooth-getdevice.png) | ```javascript async function er_2a628d77_29ff_41fd_8186_def49c423fa8_onPageShow(e,obj,index){ await __er.getDeviceList(async function(list){ }, async function(list){ }); } ``` | ## BTPairDevice This block enables device pairing based on device ID | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | Pairs device based on device ID | ![pairdevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/pairdevice.png) | ```javascript async function er_1698131203_click(e,obj,index){ await __er.pairDevice(obj,async function(){ }, async function(err){ }); } ``` | BTUnPairDevice This block enables unpairing of device based on device ID. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | UnPairs device based on device ID | ![unpairdevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/unpairdevice.png) | ```javascript async function er_1698131203_click(e,obj,index){ await __er.unPairDevice("",async function(){ }, async function(err){ }); } ``` | ## BTConnectDevice This block connects to a specific bluetooth device based on device ID. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | Connects to a device based on device ID | ![connectdevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/connectdevice.png) | ```javascript async function er_1698139457_click(e,obj,index){ await __er.connect((await __er.getState("deviceID")),async function(){ }, async function(err){ }); } ``` | ## BTDisconnectDevice This block disconnects from a specific bluetooth device based on device ID. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | Disconnects a device based on device ID | ![disconnectdevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/disconnectdevice.png) | ```javascript async function er_1698139457_click(e,obj,index){ await __er.disconnect((await __er.getState("deviceID")),async function(){ }, async function(err){ }); } ``` | ## BTListenDevice This block is used to receive the data from the connected bluetooth device. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | Object (receives the data returned by the Bluetooth device) | ![listendevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/listendevice.png) | ```javascript async function er_1698139457_click(e,obj,index){ await __er.listen("",async function(obj){ }); } ``` | ## BTCommandDevice This block sends commands to a bluetooth device based on device ID. For example, if a printer is the bluetooth device, this block sends the data that is to be printed. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Variable (device ID) | | ![commanddevice](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/commanddevice.png) | ```javascript async function er_1698139457_click(e,obj,index){ await __er.command("","",async function(){ }, async function(err){ }); } ``` |