BluetoothClient Component


Properties

addressesAndNames
  Returns the list of paired Bluetooth devices. Each element of the returned list is a String consisting of the device's address, a space, and the device's name.
Data type: array
Designer Writable false
Code Writeable false
Code Readable true let variable = bluetoothclientName.addressesAndNames

available
  Returns true if Bluetooth is available on the device, false otherwise.
Data type: boolean
Designer Writable false
Code Writeable false
Code Readable true let variable = bluetoothclientName.available

characterEncoding
  Returns the character encoding to use when sending and receiving text.
Data type: string
Designer Writable true <bluetoothclient name="bluetoothclientName" characterEncoding="utf8">
Code Writeable true bluetoothclientName.characterEncoding = "utf8"
Code Readable true let variable = bluetoothclientName.characterEncoding

delimiterByte
  Returns the delimiter byte to use when passing a negative number for the numberOfBytes parameter when calling ReceiveText, ReceiveSignedBytes, or ReceiveUnsignedBytes.
Data type: number
Designer Writable true <bluetoothclient name="bluetoothclientName" delimiterByte="0">
Code Writeable true bluetoothclientName.delimiterByte = 0
Code Readable true let variable = bluetoothclientName.delimiterByte

disconnectOnError
  Specifies whether BluetoothClient/BluetoothServer should be disconnected automatically when an error occurs.
Data type: boolean
Designer Writable true <bluetoothclient name="bluetoothclientName" disconnectOnError="true">
Code Writeable true bluetoothclientName.disconnectOnError = true
Code Readable true let variable = bluetoothclientName.disconnectOnError

enabled
  Returns true if Bluetooth is enabled, false otherwise.
Data type: boolean
Designer Writable false
Code Writeable false
Code Readable true let variable = bluetoothclientName.enabled

highByteFirst
  Specifies whether numbers are sent and received with the most significant byte first.
Data type: boolean
Designer Writable true <bluetoothclient name="bluetoothclientName" highByteFirst="true">
Code Writeable true bluetoothclientName.highByteFirst = true
Code Readable true let variable = bluetoothclientName.highByteFirst

isConnected
  Returns true if a connection to a Bluetooth device has been made.
Data type: boolean
Designer Writable false
Code Writeable false
Code Readable true let variable = bluetoothclientName.isConnected

pollingRate
  Returns the configured polling rate value of the Bluetooth Client.
Data type: number
Designer Writable true <bluetoothclient name="bluetoothclientName" pollingRate="0">
Code Writeable true bluetoothclientName.pollingRate = 0
Code Readable true let variable = bluetoothclientName.pollingRate

secure
  Specifies whether a secure connection should be used.
Data type: boolean
Designer Writable true <bluetoothclient name="bluetoothclientName" secure="true">
Code Writeable true bluetoothclientName.secure = true
Code Readable true let variable = bluetoothclientName.secure

class
  The styling class of the the component
Data type: string
Designer Writable true <bluetoothclient name="bluetoothclientName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <bluetoothclient name="bluetoothclientName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <bluetoothclient name="bluetoothclientName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
bytesAvailableToReceive Returns number of bytes available from the input stream.
bluetoothclientName.bytesAvailableToReceive()
connect Connect to a Bluetooth device with the given address.
bluetoothclientName.connect(address)
bluetoothclientName.connect("Test address")
address string
connectWithUUID Connect to a Bluetooth device with the given address and a specific UUID.
bluetoothclientName.connectWithUUID(address, uuid)
bluetoothclientName.connectWithUUID("Test address", "Test uuid")
address string
uuid string
disconnect Disconnects from the connected Bluetooth device.
bluetoothclientName.disconnect()
isDevicePaired Checks whether the Bluetooth device with the given address is paired.
bluetoothclientName.isDevicePaired(address)
bluetoothclientName.isDevicePaired("Test address")
address string
receiveSigned1ByteNumber Reads a signed 1-byte number.
bluetoothclientName.receiveSigned1ByteNumber()
receiveSigned2ByteNumber Reads a signed 2-byte number.
bluetoothclientName.receiveSigned2ByteNumber()
receiveSigned4ByteNumber Reads a signed 4-byte number.
bluetoothclientName.receiveSigned4ByteNumber()
receiveSignedBytes Reads a number of signed bytes from the input stream and returns them as a List. If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.
bluetoothclientName.receiveSignedBytes(numberOfBytes)
bluetoothclientName.receiveSignedBytes(0)
numberOfBytes number
receiveText Reads a number of bytes from the input stream and converts them to text. If numberOfBytes is negative, read until a delimiter byte value is read.
bluetoothclientName.receiveText(numberOfBytes)
bluetoothclientName.receiveText(0)
numberOfBytes number
receiveUnsigned1ByteNumber Reads an unsigned 1-byte number.
bluetoothclientName.receiveUnsigned1ByteNumber()
receiveUnsigned2ByteNumber Reads an unsigned 2-byte number.
bluetoothclientName.receiveUnsigned2ByteNumber()
receiveUnsigned4ByteNumber Reads an unsigned 4-byte number.
bluetoothclientName.receiveUnsigned4ByteNumber()
receiveUnsignedBytes Reads a number of unsigned bytes from the input stream and returns them as a List. If numberOfBytes is negative, this method reads until a delimiter byte value is read. The delimiter byte value is included in the returned list.
bluetoothclientName.receiveUnsignedBytes(numberOfBytes)
bluetoothclientName.receiveUnsignedBytes(0)
numberOfBytes number
send1ByteNumber Decodes the given number String to an integer and writes it as one byte to the output stream. If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form's ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.
bluetoothclientName.send1ByteNumber(number)
bluetoothclientName.send1ByteNumber(Test number)
number string
send2ByteNumber Decodes the given number String to an integer and writes it as two bytes to the output stream. If the number could not be decoded to an integer, or the integer would not fit in two bytes, then the Form's ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.
bluetoothclientName.send2ByteNumber(number)
bluetoothclientName.send2ByteNumber(Test number)
number string
send4ByteNumber Decodes the given number String to an integer and writes it as four bytes to the output stream. If the number could not be decoded to an integer, or the integer would not fit in four bytes, then the Form's ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.
bluetoothclientName.send4ByteNumber(number)
bluetoothclientName.send4ByteNumber(Test number)
number string
sendBytes Takes each element from the given list, converts it to a String, decodes the String to an integer, and writes it as one byte to the output stream. If an element could not be decoded to an integer, or the integer would not fit in one byte, then the Form's ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.
bluetoothclientName.sendBytes(list)
bluetoothclientName.sendBytes(list)
list list
sendText Converts the given text to bytes and writes them to the output stream.
bluetoothclientName.sendText(text)
bluetoothclientName.sendText("Test text")
text string