# Modules.Bluetooth.BluetoothDevice
Represents a remote bluetooth device.
# Overview
A BluetoothDevice
object lets you create a connection with the remote device or query information
about it, such as the name, address, UUID and type.
# Properties
# address READONLY
Address of the remote Bluetooth device.
This property returns the Bluetooth hardware address as string. For example, "00:11:22:AA:BB:CC".
# name READONLY
Name of the remote Bluetooth device.
This property returns the Bluetooth name or null if there was a problem.
# type READONLY
Type of the remote Bluetooth device.
Possible values are DEVICE_TYPE_UNKNOWN, DEVICE_TYPE_CLASSIC, DEVICE_TYPE_DUAL and DEVICE_TYPE_LE.
# uUIDs READONLY
The supported UUIDs of the remote device.
This property does not start a service discovery procedure to retrieve the UUIDs from the remote device. Rather, the local cached copy of the service UUIDs are returned. Can be null on error.
# Methods
# createSocket
Creates an RFCOMM Bluetooth socket.
This method, when called, creates an RFCOMM Bluetooth socket ready to start an outgoing connection to the remote device using SDP lookup of UUID.
Parameters
Name | Type | Description |
---|---|---|
uuid | String | UUID of the service this socket will connect to. |
secure | Boolean | Determines whether the connection will be secure or insecure. |
Returns
created socket for the device
# fetchUUIDs
Perform a service discovery on the remote device to get the UUIDs supported.
The outcome of the discovery is reported via the fetchedUUIDs event.
Returns
Returns true if service discovery started successfully.
- Type
- Boolean
# Events
# fetchedUUIDs
Fired when the UUIDs of the remote device are received using SDP.
Properties
Name | Type | Description |
---|---|---|
device | Modules.Bluetooth.BluetoothDevice | The Bluetooth device in question. |
UUIDs | Array<String> | The service UUIDs of the device. |
source | Object | Source object that fired the event. |
type | String | Name of the event fired. |
bubbles | Boolean | True if the event will try to bubble up if possible. |
cancelBubble | Boolean | Set to true to stop the event from bubbling. |