SerialBluetoothDevice QML Type

Details connection information on Bluetooth devices. More...

Import Statement: import ArcGIS.AppFramework.Devices 1.0
Inherits:

Device

Properties

Detailed Description

The SerialBluetoothDevice component provides identifying information about Bluetooth devices known to the app. Used alongside DeviceDiscoveryAgent to locate devices, this component can be used to confirm the correct Bluetooth device is paired and in use.

This code sample demonstrates usage of SerialBluetoothDevice, using the pairingStatus property alongside DeviceDiscoveryAgent to determine if a device in the device list is either paired or authorized-paired.

DeviceDiscoveryAgent {
    id: discoveryAgent

    property bool detectBluetooth: true
    property bool detectSerialPort: false

    deviceFilter: function(device) {
        var types = [];

        if (detectBluetooth) {
            types.push(Device.DeviceTypeBluetooth);
        }

        if (detectSerialPort) {
            types.push(Device.DeviceTypeSerialPort);
        }

        for (var i in types) {
            if (device.deviceType === types[i]) {
                if (device.deviceType === Device.DeviceTypeBluetooth) {

                    if (device.pairingStatus === Device.PairingStatusPaired || device.pairingStatus === Device.PairingStatusAuthorizedPaired)
                        return true;
                }

                else
                    return true;
            }
        }

        return false;
    }
}

Property Documentation

[read-only] pairingStatus : PairingStatus

Returns the current pairing status of the Bluetooth devices. 0 means that the devices are not paired, 1 means that the device is paired but needs authorization when the connection is initiated, and 2 means that the device is paired, and does not need authorization when the connection is initiated.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.