roBtCentralManager
This object allows you to check if Bluetooth is fitted; set, monitor, or retrieve the current Bluetooth Low Energy (BLE) advertisements; and scan for Bluetooth devices.
Scan(parameters As roAssociativeArray) As Boolean
When set to true, scanning includes BLE advertisements.
Parameters can include advertising_reports.
ifBtAdvertisingReportEvent
GetAdapter() As String
Returns the adapter that the advertising device belongs to
GetDevice() As String
Returns the identifier for remote advertising device
GetRssi() As Integer
Returns the signal strength indicator for advertisement
GetData() As roByteArray
Returns advertisement data
GetAdvertisement() As roAssociativeArray
Available as of BOS 9.0.198 and 9.1.21, this returns an associative array containing all of the above. The field names are:
- adapter_path string: The object path of the adapter the device belongs to
- device_address string: The Bluetooth device address of the remote device
- rssi int: The Received Signal Strength Indicator of the remote device (inquiry or advertising)
- data roByteArray: An roByteArray of manufacturing data
Reset() As Boolean
This reset method will attempt to recover the Bluetooth stack if it becomes unresponsive
ifBtDeviceFoundEvent
GetDevice() as roAssociativeArray
Available as of BOS 9.0.198 and 9.1.21, this returns an associative array containing the following:
- adapter_path string: The object path of the adapter the device belongs to
- address string: The Bluetooth device address of the remote device
- name string: The Bluetooth remote name.
- alias string: The name alias for the remote device.
- rssi int: The Received Signal Strength Indicator of the remote device (inquiry or advertising)
- tx_power int: The advertised transmitted power level (inquiry or advertising)
- uuids roArray: An roArray of UUID strings that represent the available remote services
- advertising_flags roArray: An roArray of advertisement flags
- manufacturer_data roArray: An roArray of roAssociativeArray where each element has:
- id int: The id of the manufacturer
- data roByteArray: An roByteArray of mfg data
- service_data roAssociativeArray: An roAssociativeArray with the following pairs:
- uuid string: UUID strings that represent the available remote services
- service data roByteArray: An array of service advertisement data
ifBtDeviceLostEvent
GetDevice() as roAssociativeArray
Available as of BOS 9.0.198 and 9.1.21, this returns an associative array containing the following:
- adapter_path string: The object path of the adapter the device belongs to.
- address string: The Bluetooth device address of the remote device
Example
mp = CreateObject("roMessagePort")
btc = CreateObject("roBtCentralManager")
btc.SetPort(mp)
btc.Scan({advertising_reports: true})