Difference between revisions of "Unit Bluetooth"
| Line 9: | Line 9: | ||
=== Constants === | === Constants === | ||
---- | ---- | ||
| − | |||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
| Line 236: | Line 235: | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
| − | |||
'''Bluetooth device''' | '''Bluetooth device''' | ||
| Line 490: | Line 488: | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
| − | |||
'''Bluetooth specific variables''' | '''Bluetooth specific variables''' | ||
Revision as of 04:27, 10 November 2025
Return to Unit Reference
Description
Ultibo Bluetooth interface unit
Constants
BLUETOOTH_* BLUETOOTH_DEVICE_PREFIX = 'Bluetooth';
|
Name prefix for Bluetooth Devices |
BLUETOOTH_DRIVER_PREFIX = 'Bluetooth';
|
Name prefix for Bluetooth Drivers |
BLUETOOTH_HOST_PREFIX = 'BluetoothHost';
|
Name prefix for Bluetooth Hosts |
BLUETOOTH_DRIVER_NAME = 'Bluetooth USB HCI Driver';
|
Name of Bluetooth USB driver |
BLUETOOTH_TYPE_* BLUETOOTH_TYPE_NONE = 0;
|
|
BLUETOOTH_TYPE_MAX = 0;
|
|
BLUETOOTH_TYPE_NAMES:array[BLUETOOTH_TYPE_NONE..BLUETOOTH_TYPE_MAX] of String = ('BLUETOOTH_TYPE_NONE');
| |
BLUETOOTH_STATE_* BLUETOOTH_STATE_DETACHED = 0;
|
|
BLUETOOTH_STATE_DETACHING = 1;
|
|
BLUETOOTH_STATE_ATTACHING = 2;
|
|
BLUETOOTH_STATE_ATTACHED = 3;
|
|
BLUETOOTH_STATE_MAX = 3;
|
|
BLUETOOTH_STATE_NAMES:array[BLUETOOTH_STATE_DETACHED..BLUETOOTH_STATE_MAX] of String = ('BLUETOOTH_STATE_DETACHED', 'BLUETOOTH_STATE_DETACHING', 'BLUETOOTH_STATE_ATTACHING', 'BLUETOOTH_STATE_ATTACHED');
| |
BLUETOOTH_STATUS_* BLUETOOTH_STATUS_UNBOUND = 0;
|
|
BLUETOOTH_STATUS_BOUND = 1;
|
|
BLUETOOTH_STATUS_MAX = 1;
|
|
BLUETOOTH_STATUS_NAMES:array[BLUETOOTH_STATUS_UNBOUND..BLUETOOTH_STATUS_MAX] of String = ('BLUETOOTH_STATUS_UNBOUND', 'BLUETOOTH_STATUS_BOUND');
| |
BLUETOOTH_FLAG_* BLUETOOTH_FLAG_NONE = $00000000;
|
BLUETOOTHHOST_TYPE_* BLUETOOTHHOST_TYPE_NONE = 0;
|
|
BLUETOOTHHOST_TYPE_UART = 1;
|
Bluetooth HCI over RS232 with RTS/CTS flow control for reliable delivery |
BLUETOOTHHOST_TYPE_USB = 2;
|
Bluetooth HCI over USB |
BLUETOOTHHOST_TYPE_SDIO = 3;
|
Bluetooth HCI over SDIO |
BLUETOOTHHOST_TYPE_3WIRE = 4;
|
Bluetooth HCI over 3 wire UART (TX/RX/GND only with RTS/CTS optional) |
BLUETOOTHHOST_TYPE_MAX = 4;
|
|
BLUETOOTHHOST_TYPE_NAMES:array[BLUETOOTHHOST_TYPE_NONE..BLUETOOTHHOST_TYPE_MAX] of String = ('BLUETOOTHHOST_TYPE_NONE', 'BLUETOOTHHOST_TYPE_UART', 'BLUETOOTHHOST_TYPE_USB', 'BLUETOOTHHOST_TYPE_SDIO', 'BLUETOOTHHOST_TYPE_3WIRE');
| |
BLUETOOTHHOST_STATE_* BLUETOOTHHOST_STATE_DISABLED = 0;
|
|
BLUETOOTHHOST_STATE_ENABLED = 1;
|
|
BLUETOOTHHOST_STATE_MAX = 1;
|
|
BLUETOOTHHOST_STATE_NAMES:array[BLUETOOTHHOST_STATE_DISABLED..BLUETOOTHHOST_STATE_MAX] of String = ('BLUETOOTHHOST_STATE_DISABLED', 'BLUETOOTHHOST_STATE_ENABLED');
| |
BLUETOOTHHOST_FLAG_* BLUETOOTHHOST_FLAG_NONE = $00000000;
|
|
BLUETOOTHHOST_FLAG_SHARED = $00000001;
|
|
BLUETOOTHHOST_FLAG_NOCACHE = $00000002;
|
BLUETOOTH_STATUS_* BLUETOOTH_STATUS_SUCCESS = 0;
|
Function successful |
BLUETOOTH_STATUS_DEVICE_DETACHED = 1;
|
Bluetooth device was detached |
BLUETOOTH_STATUS_DEVICE_UNSUPPORTED = 2;
|
Bluetooth device is unsupported by the driver |
BLUETOOTH_STATUS_HARDWARE_ERROR = 3;
|
Hardware error of some form occurred |
BLUETOOTH_STATUS_INVALID_DATA = 4;
|
Invalid data was received |
BLUETOOTH_STATUS_INVALID_PARAMETER = 5;
|
An invalid parameter was passed to the function |
BLUETOOTH_LOG_* BLUETOOTH_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;
|
Bluetooth debugging messages |
BLUETOOTH_LOG_LEVEL_INFO = LOG_LEVEL_INFO;
|
Bluetooth informational messages, such as a device being attached or detached |
BLUETOOTH_LOG_LEVEL_WARN = LOG_LEVEL_WARN;
|
Bluetooth warning messages |
BLUETOOTH_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;
|
Bluetooth error messages |
BLUETOOTH_LOG_LEVEL_NONE = LOG_LEVEL_NONE;
|
No Bluetooth messages |
Type definitions
Bluetooth device
PBluetoothDevice = ^TBluetoothDevice;
TBluetoothDevice = record
| Device Properties | |
Device:TDevice;
|
The Device entry for this Bluetooth device |
| Bluetooth Properties | |
BluetoothId:LongWord;
|
Unique Id of this Bluetooth in the Bluetooth device table |
BluetoothState:LongWord;
|
Bluetooth device state (eg BLUETOOTH_STATE_ATTACHED) |
BluetoothStatus:LongWord;
|
Bluetooth device status (eg BLUETOOTH_STATUS_BOUND) |
Host:PBluetoothHost;
|
Host controller this Bluetooth device is connected to (Set by Bluetooth core) |
Driver:PBluetoothDriver;
|
Driver this Bluetooth device is bound to, if any (Set by Bluetooth core) |
| Driver Properties | |
Lock:TMutexHandle;
|
Bluetooth device lock |
| Internal Properties | |
Prev:PBluetoothDevice;
|
Previous entry in Bluetooth device table |
Next:PBluetoothDevice;
|
Next entry in Bluetooth device table |
Bluetooth device bind callback
TBluetoothDeviceBind = function(Device:PBluetoothDevice):LongWord;
|
Bluetooth device unbind callback
TBluetoothDeviceUnbind = function(Device:PBluetoothDevice; Driver:PBluetoothDriver):LongWord;
|
Bluetooth device enumeration callback
TBluetoothDeviceEnumerate = function(Device:PBluetoothDevice; Data:Pointer):LongWord;
|
Bluetooth device notification callback
TBluetoothDeviceNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Bluetooth driver enumeration callback
TBluetoothDriverEnumerate = function(Driver:PBluetoothDriver; Data:Pointer):LongWord;
|
Bluetooth driver bind callback
TBluetoothDriverBind = function(Device:PBluetoothDevice):LongWord;
|
Bluetooth driver unbind callback
TBluetoothDriverUnbind = function(Device:PBluetoothDevice):LongWord;
|
Bluetooth driver
PBluetoothDriver = ^TBluetoothDriver;
TBluetoothDriver = record
| Driver Properties | |
Driver:TDriver;
|
The Driver entry for this Bluetooth Driver |
| Bluetooth Properties | |
DriverBind:TBluetoothDriverBind;
|
A Driver specific DriverBind method implementing the standard Bluetooth driver interface |
DriverUnbind:TBluetoothDriverUnbind;
|
A Driver specific DriverUnbind method implementing the standard Bluetooth driver interface |
| Interface Properties | |
Lock:TMutexHandle;
|
Driver lock |
| Internal Properties | |
Prev:PBluetoothDriver;
|
Previous entry in Driver table |
Next:PBluetoothDriver;
|
Next entry in Driver table |
Bluetooth host enumeration callback
TBluetoothHostEnumerate = function(Host:PBluetoothHost; Data:Pointer):LongWord;
|
Bluetooth host notification callback
TBluetoothHostNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
Bluetooth host start
TBluetoothHostStart = function(Host:PBluetoothHost):LongWord;
|
Bluetooth host stop
TBluetoothHostStop = function(Host:PBluetoothHost):LongWord;
|
Bluetooth host reset
TBluetoothHostReset = function(Host:PBluetoothHost):LongWord;
|
Bluetooth host
PBluetoothHost = ^TBluetoothHost;
TBluetoothHost = record
| Device Properties | |
Device:TDevice;
|
The Device entry for this Bluetooth Host |
| Bluetooth Properties | |
HostId:LongWord;
|
Unique Id of this Host in the Host table |
HostState:LongWord;
|
Host state (eg BLUETOOTHHOST_STATE_ENABLED) |
HostStart:TBluetoothHostStart;
|
A Host specific HostStart method implementing the standard Bluetooth host interface |
HostStop:TBluetoothHostStop;
|
A Host specific HostStop method implementing the standard Bluetooth host interface |
HostReset:TBluetoothHostReset;
|
A Host specific HostReset method implementing the standard Bluetooth host interface |
| Driver Properties | |
Lock:TMutexHandle;
|
Host lock |
| Internal Properties | |
Prev:PBluetoothHost;
|
Previous entry in Host table |
Next:PBluetoothHost;
|
Next entry in Host table |
Bluetooth log output
TBluetoothLogOutput = procedure(const AText:String; Data:Pointer);
|
Public variables
Bluetooth specific variables
BluetoothInitialized:Boolean;
|
Bluetooth logging
BLUETOOTH_DEFAULT_LOG_LEVEL:LongWord = BLUETOOTH_LOG_LEVEL_DEBUG;
|
Minimum level for Bluetooth messages. Only messages with level greater than or equal to this will be printed. |
BLUETOOTH_LOG_ENABLED:Boolean;
|
Function declarations
To be documented
Return to Unit Reference