Skip to content

Bluetooth Client

Non-Visible component
Category Requires Version
Connectivity API 21, Android 5.0 Lollipop 6

Overview

A non-visible component that acts as a bluetooth client.

Permissions

Events

BluetoothError

The BluetoothError event is no longer used. Please use the Screen.ErrorOccurred event instead.

whenBluetooth Client.BluetoothError function Name message do
Params
function Name Text
message Text

Methods

Bytes Available To Receive

Returns: Number

Returns an estimate of the number of bytes that can be received without blocking

callBluetooth Client.Bytes Available To Receive

Connect

Returns: Boolean

Connect to the Bluetooth device with the specified address and the Serial Port Profile (SPP). Returns true if the connection was successful.

callBluetooth Client.Connectaddress
Params
address Text

Connect With UUID

Returns: Boolean

Connect to the Bluetooth device with the specified address and UUID. Returns true if the connection was successful.

callBluetooth Client.Connect With UUIDaddressuuid
Params
address Text
uuid Text

Disconnect

Disconnect from the connected Bluetooth device.

callBluetooth Client.Disconnect

Is Device Paired

Returns: Boolean

Checks whether the Bluetooth device with the specified address is paired.

callBluetooth Client.Is Device Pairedaddress
Params
address Text

Receive Signed 1 Byte Number

Returns: Number

Receive a signed 1-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Signed 1 Byte Number

Receive Signed 2 Byte Number

Returns: Number

Receive a signed 2-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Signed 2 Byte Number

Receive Signed 4 Byte Number

Returns: Number

Receive a signed 4-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Signed 4 Byte Number

Receive Signed Bytes

Returns: List

Receive multiple signed byte values from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

callBluetooth Client.Receive Signed Bytesnumber Of Bytes
Params
number Of Bytes Number

Receive Text

Returns: Text

Receive text from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

callBluetooth Client.Receive Textnumber Of Bytes
Params
number Of Bytes Number

Receive Unsigned 1 Byte Number

Returns: Number

Receive an unsigned 1-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Unsigned 1 Byte Number

Receive Unsigned 2 Byte Number

Returns: Number

Receive a unsigned 2-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Unsigned 2 Byte Number

Receive Unsigned 4 Byte Number

Returns: Number

Receive a unsigned 4-byte number from the connected Bluetooth device.

callBluetooth Client.Receive Unsigned 4 Byte Number

Receive Unsigned Bytes

Returns: List

Receive multiple unsigned byte values from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

callBluetooth Client.Receive Unsigned Bytesnumber Of Bytes
Params
number Of Bytes Number

Remove Name From Address

Returns: Text

Remove the Name from a Bluetooth Address and Name String.

callBluetooth Client.Remove Name From Addressaddress And Name
Params
address And Name Text

Send 1 Byte Number

Send a 1-byte number to the connected Bluetooth device.

callBluetooth Client.Send 1 Byte Numbernumber
Params
number Text

Send 2 Byte Number

Send a 2-byte number to the connected Bluetooth device.

callBluetooth Client.Send 2 Byte Numbernumber
Params
number Text

Send 4 Byte Number

Send a 4-byte number to the connected Bluetooth device.

callBluetooth Client.Send 4 Byte Numbernumber
Params
number Text

Send Bytes

Send a list of byte values to the connected Bluetooth device.

callBluetooth Client.Send Byteslist
Params
list List

Send Text

Send text to the connected Bluetooth device.

callBluetooth Client.Send Texttext
Params
text Text

Properties

Addresses And Names

List ➖ Read - Blocks

The addresses and names of paired Bluetooth devices

Bluetooth Client.Addresses And Names

Available

Boolean ➖ Read - Blocks

Whether Bluetooth is available on the device

Bluetooth Client.Available

Character Encoding

Text Default: UTF-8 ➖ Read Write - Designer Blocks

Sets the character encoding to use when sending and receiving text.

Bluetooth Client.Character Encoding
setBluetooth Client.Character Encoding to 

Delimiter Byte

Number Default: 0 ➖ Read Write - Designer Blocks

Sets the delimiter byte to use when passing a negative number for thenumberOfBytes parameter when calling ReceiveText, ReceiveSignedBytes, orReceiveUnsignedBytes.

Bluetooth Client.Delimiter Byte
setBluetooth Client.Delimiter Byte to 

Enabled

Boolean ➖ Read - Blocks

Whether Bluetooth is enabled

Bluetooth Client.Enabled

High Byte First

Boolean Default: False ➖ Read Write - Designer Blocks

Returns true if numbers are sent and received with the most significantbyte first.

Bluetooth Client.High Byte First
setBluetooth Client.High Byte First to 

Is Connected

Boolean ➖ Read - Blocks

Returns true if a connection to a Bluetooth device has been made.

Bluetooth Client.Is Connected

Secure

Boolean Default: True ➖ Read Write - Designer Blocks

Whether to invoke SSP (Simple Secure Pairing), which is supported on devices with Bluetooth v2.1 or higher. When working with embedded Bluetooth devices, this property may need to be set to False. For Android 2.0-2.2, this property setting will be ignored.

Bluetooth Client.Secure
setBluetooth Client.Secure to