Difference between revisions of "Unit Bluetooth"

From Ultibo.org
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
----
 
----
 
Ultibo Bluetooth interface unit
 
  
 
'''Ultibo Bluetooth interface unit'''
 
'''Ultibo Bluetooth interface unit'''
Line 12: Line 10:
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth device, driver and host specific constants''' <code> BLUETOOTH_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_DEVICE_PREFIX = 'Bluetooth';</code>
 +
| Name prefix for Bluetooth Devices
 +
|-
 +
| <code>BLUETOOTH_DRIVER_PREFIX = 'Bluetooth';</code>
 +
| Name prefix for Bluetooth Drivers
 +
|-
 +
| <code>BLUETOOTH_HOST_PREFIX = 'BluetoothHost';</code>
 +
| Name prefix for Bluetooth Hosts
 +
|-
 +
| <code>BLUETOOTH_DRIVER_NAME = 'Bluetooth USB HCI Driver';</code>
 +
| Name of Bluetooth USB driver
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth device types''' <code> BLUETOOTH_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_TYPE_NONE = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTH_TYPE_MAX = 0;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>BLUETOOTH_TYPE_NAMES:array[BLUETOOTH_TYPE_NONE..BLUETOOTH_TYPE_MAX] of String = ('BLUETOOTH_TYPE_NONE');</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth device states''' <code> BLUETOOTH_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_STATE_DETACHED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATE_DETACHING = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATE_ATTACHING = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATE_ATTACHED = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATE_MAX = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>BLUETOOTH_STATE_NAMES:array[BLUETOOTH_STATE_DETACHED..BLUETOOTH_STATE_MAX] of String = ('BLUETOOTH_STATE_DETACHED', 'BLUETOOTH_STATE_DETACHING',  'BLUETOOTH_STATE_ATTACHING', 'BLUETOOTH_STATE_ATTACHED');</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth device status''' <code> BLUETOOTH_STATUS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_STATUS_UNBOUND = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATUS_BOUND = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BLUETOOTH_STATUS_MAX = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>BLUETOOTH_STATUS_NAMES:array[BLUETOOTH_STATUS_UNBOUND..BLUETOOTH_STATUS_MAX] of String = ('BLUETOOTH_STATUS_UNBOUND', 'BLUETOOTH_STATUS_BOUND');</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth device flags''' <code> BLUETOOTH_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_FLAG_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth host types''' <code> BLUETOOTHHOST_TYPE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_NONE = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_UART = 1;</code>
 +
| Bluetooth HCI over RS232 with RTS/CTS flow control for reliable delivery
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_USB = 2;</code>
 +
| Bluetooth HCI over USB
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_SDIO = 3;</code>
 +
| Bluetooth HCI over SDIO
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_3WIRE = 4;</code>
 +
| Bluetooth HCI over 3 wire UART (TX/RX/GND only with RTS/CTS optional)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_TYPE_MAX = 4;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>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');</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth host states''' <code> BLUETOOTHHOST_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTHHOST_STATE_DISABLED = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_STATE_ENABLED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_STATE_MAX = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|<code>BLUETOOTHHOST_STATE_NAMES:array[BLUETOOTHHOST_STATE_DISABLED..BLUETOOTHHOST_STATE_MAX] of String = ('BLUETOOTHHOST_STATE_DISABLED', 'BLUETOOTHHOST_STATE_ENABLED');</code>
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth host flags''' <code> BLUETOOTHHOST_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTHHOST_FLAG_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_FLAG_SHARED = $00000001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BLUETOOTHHOST_FLAG_NOCACHE = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth status codes''' <code> BLUETOOTH_STATUS_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_STATUS_SUCCESS = 0;</code>
 +
| style="width: 50%;"|Function successful
 +
|-
 +
| <code>BLUETOOTH_STATUS_DEVICE_DETACHED = 1;</code>
 +
| Bluetooth device was detached
 +
|-
 +
| <code>BLUETOOTH_STATUS_DEVICE_UNSUPPORTED = 2;</code>
 +
| Bluetooth device is unsupported by the driver
 +
|-
 +
| <code>BLUETOOTH_STATUS_HARDWARE_ERROR = 3;</code>
 +
| Hardware error of some form occurred
 +
|-
 +
| <code>BLUETOOTH_STATUS_INVALID_DATA = 4;</code>
 +
| Invalid data was received
 +
|-
 +
| <code>BLUETOOTH_STATUS_INVALID_PARAMETER = 5;</code>
 +
| An invalid parameter was passed to the function
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Bluetooth logging''' <code> BLUETOOTH_LOG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>BLUETOOTH_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code>
 +
| style="width: 50%;"|Bluetooth debugging messages
 +
|-
 +
| <code>BLUETOOTH_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 +
| Bluetooth informational messages, such as a device being attached or detached
 +
|-
 +
| <code>BLUETOOTH_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code>
 +
| Bluetooth warning messages
 +
|-
 +
| <code>BLUETOOTH_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 +
| Bluetooth error messages
 +
|-
 +
| <code>BLUETOOTH_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code>
 +
| No Bluetooth messages
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Bluetooth device'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PBluetoothDevice = ^TBluetoothDevice;</code>
 +
 
 +
<code>TBluetoothDevice = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Device Properties''
 +
|-
 +
| <code>Device:TDevice;</code>
 +
| The Device entry for this Bluetooth device
 +
|-
 +
|colspan="2"|''Bluetooth Properties''
 +
|-
 +
| <code>BluetoothId:LongWord;</code>
 +
| Unique Id of this Bluetooth in the Bluetooth device table
 +
|-
 +
| <code>BluetoothState:LongWord;</code>
 +
| Bluetooth device state (eg BLUETOOTH_STATE_ATTACHED)
 +
|-
 +
| <code>BluetoothStatus:LongWord;</code>
 +
| Bluetooth device status (eg BLUETOOTH_STATUS_BOUND)
 +
|-
 +
| <code>Host:PBluetoothHost;</code>
 +
| Host controller this Bluetooth device is connected to (Set by Bluetooth core)
 +
|-
 +
| <code>Driver:PBluetoothDriver;</code>
 +
| Driver this Bluetooth device is bound to, if any (Set by Bluetooth core)
 +
|-
 +
|colspan="2"|''Driver Properties''
 +
|-
 +
| <code>Lock:TMutexHandle;</code>
 +
| Bluetooth device lock
 +
|-
 +
|colspan="2"|''Internal Properties''
 +
|-
 +
| <code>Prev:PBluetoothDevice;</code>
 +
| Previous entry in Bluetooth device table
 +
|-
 +
| <code>Next:PBluetoothDevice;</code>
 +
| Next entry in Bluetooth device table
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Bluetooth device bind callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDeviceBind = function(Device:PBluetoothDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth device unbind callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDeviceUnbind = function(Device:PBluetoothDevice; Driver:PBluetoothDriver):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth device enumeration callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDeviceEnumerate = function(Device:PBluetoothDevice; Data:Pointer):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|} 
 +
 +
'''Bluetooth device notification callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDeviceNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth driver enumeration callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDriverEnumerate = function(Driver:PBluetoothDriver; Data:Pointer):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth driver bind callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDriverBind = function(Device:PBluetoothDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth driver unbind callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothDriverUnbind = function(Device:PBluetoothDevice):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth driver'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PBluetoothDriver = ^TBluetoothDriver;</code>
 +
 
 +
<code>TBluetoothDriver = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Driver Properties''
 +
|-
 +
| <code>Driver:TDriver;</code>
 +
| The Driver entry for this Bluetooth Driver
 +
|-
 +
|colspan="2"|''Bluetooth Properties''
 +
|-
 +
| <code>DriverBind:TBluetoothDriverBind;</code>
 +
| A Driver specific DriverBind method implementing the standard Bluetooth driver interface
 +
|-
 +
| <code>DriverUnbind:TBluetoothDriverUnbind;</code>
 +
| A Driver specific DriverUnbind method implementing the standard Bluetooth driver interface
 +
|-
 +
|colspan="2"|''Interface Properties''
 +
|-
 +
| <code>Lock:TMutexHandle;</code>
 +
| Driver lock
 +
|-
 +
|colspan="2"|''Internal Properties''
 +
|-
 +
| <code>Prev:PBluetoothDriver;</code>
 +
| Previous entry in Driver table
 +
|-
 +
| <code>Next:PBluetoothDriver;</code>
 +
| Next entry in Driver table
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Bluetooth host enumeration callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothHostEnumerate = function(Host:PBluetoothHost; Data:Pointer):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth host notification callback'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothHostNotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth host start'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothHostStart = function(Host:PBluetoothHost):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Bluetooth host stop'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothHostStop = function(Host:PBluetoothHost):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 +
'''Bluetooth host reset'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothHostReset = function(Host:PBluetoothHost):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth host'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PBluetoothHost = ^TBluetoothHost;</code>
 +
 
 +
<code>TBluetoothHost = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Device Properties''
 +
|-
 +
| <code>Device:TDevice;</code>
 +
| The Device entry for this Bluetooth Host
 +
|-
 +
|colspan="2"|''Bluetooth Properties''
 +
|-
 +
| <code>HostId:LongWord;</code>
 +
| Unique Id of this Host in the Host table
 +
|-
 +
| <code>HostState:LongWord;</code>
 +
| Host state (eg BLUETOOTHHOST_STATE_ENABLED)
 +
|-
 +
| <code>HostStart:TBluetoothHostStart;</code>
 +
| A Host specific HostStart method implementing the standard Bluetooth host interface
 +
|-
 +
| <code>HostStop:TBluetoothHostStop;</code>
 +
| A Host specific HostStop method implementing the standard Bluetooth host interface
 +
|-
 +
| <code>HostReset:TBluetoothHostReset;</code>
 +
| A Host specific HostReset method implementing the standard Bluetooth host interface
 +
|-
 +
|colspan="2"|''Driver Properties''
 +
|-
 +
| <code>Lock:TMutexHandle;</code>
 +
| Host lock
 +
|-
 +
|colspan="2"|''Internal Properties''
 +
|-
 +
| <code>Prev:PBluetoothHost;</code>
 +
| Previous entry in Host table
 +
|-
 +
| <code>Next:PBluetoothHost;</code>
 +
| Next entry in Host table
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Bluetooth log output'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TBluetoothLogOutput = procedure(const AText:String; Data:Pointer);</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
'''Bluetooth specific variables'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>BluetoothInitialized:Boolean;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Bluetooth logging'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>BLUETOOTH_DEFAULT_LOG_LEVEL:LongWord = BLUETOOTH_LOG_LEVEL_DEBUG;</code>
 +
| style="width: 40%;"|Minimum level for Bluetooth messages. Only messages with level greater than or equal to this will be printed.
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>BLUETOOTH_LOG_ENABLED:Boolean;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
  
''To be documented''
 
  
 +
'''Initialization functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothInit;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Performs basic initialization of the Bluetooth core driver, after this devices, hosts and drivers can be registered however nothing will work until BluetoothStart is called</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Called only during system startup
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothStart:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Starts all registered Bluetooth hosts and begins the Bluetooth discovery process</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothStop:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothAsyncStart(Host:PBluetoothHost);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''Bluetooth device, driver and host functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceAllocate(Host:PBluetoothHost):PBluetoothDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and Register a new Device entry in the Device table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Host
 +
| The Host this device is attached to
 +
|-
 +
! Parent
 +
| The Parent device this device is attached to (nil if this device has no parent)
 +
|-
 +
! Return
 +
| Pointer to new Device entry or nil if device could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceRelease(Device:PBluetoothDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister and Destroy a Device from the Device table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Device
 +
| The device to deregister and destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceFind(BluetoothId:LongWord):PBluetoothDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceFindByName(const Name:String):PBluetoothDevice; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceFindByDescription(const Description:String):PBluetoothDevice; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceEnumerate(Callback:TBluetoothDeviceEnumerate; Data:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceNotification(Device:PBluetoothDevice; Callback:TBluetoothDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverCreate:PBluetoothDriver;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Bluetooth Driver entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| Pointer to new Driver entry or nil if driver could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverCreateEx(Size:LongWord):PBluetoothDriver;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Bluetooth Driver entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Size
 +
| Size in bytes to allocate for new driver (Including the driver entry)
 +
|-
 +
! Return
 +
| Pointer to new Driver entry or nil if driver could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverDestroy(Driver:PBluetoothDriver):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Bluetooth Driver entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverRegister(Driver:PBluetoothDriver):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Driver in the Bluetooth Driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverDeregister(Driver:PBluetoothDriver):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a Driver from the Bluetooth Driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverFind(DriverId:LongWord):PBluetoothDriver;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a driver by Id in the Bluetooth Driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverFindByName(const Name:String):PBluetoothDriver; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a driver by name in the Driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverEnumerate(Callback:TBluetoothDriverEnumerate; Data:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enumerate all drivers in the Bluetooth Driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostCreate:PBluetoothHost;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Host entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Return
 +
| Pointer to new Host entry or nil if host could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostCreateEx(Size:LongWord):PBluetoothHost;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Host entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Size
 +
| Size in bytes to allocate for new host (Including the host entry)
 +
|-
 +
! Return
 +
| Pointer to new Host entry or nil if host could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostDestroy(Host:PBluetoothHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Host entry</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostRegister(Host:PBluetoothHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Host in the Host table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostDeregister(Host:PBluetoothHost):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister a Host from the Host table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostFind(HostId:LongWord):PBluetoothHost;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostFindByName(const Name:String):PBluetoothHost; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostFindByDescription(const Description:String):PBluetoothHost; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostEnumerate(Callback:TBluetoothHostEnumerate; Data:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostNotification(Host:PBluetoothHost; Callback:TBluetoothHostNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''Bluetooth device, driver and host helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceGetCount:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current device count</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceCheck(Device:PBluetoothDevice):PBluetoothDevice;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Device is in the device table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverGetCount:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current Bluetooth driver count</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDriverCheck(Driver:PBluetoothDriver):PBluetoothDriver;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Bluetooth Driver is in the driver table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostGetCount:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current host count</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostCheck(Host:PBluetoothHost):PBluetoothHost;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Host is in the host table</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothStatusToString(Status:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Translates a Bluetooth status code into a string</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceTypeToString(BluetoothType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceStateToString(BluetoothState:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceStatusToString(BluetoothStatus:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceStateToNotification(State:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Device state value into the notification code for device notifications</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothDeviceStatusToNotification(Status:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Device status value into the notification code for device notifications</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostTypeToString(HostType:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostStateToString(HostState:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function BluetoothHostStateToNotification(State:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a Host state value into the notification code for device notifications</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothLog(Level:LongWord; Device:PBluetoothDevice; const AText:String);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothLogInfo(Device:PBluetoothDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothLogWarn(Device:PBluetoothDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothLogError(Device:PBluetoothDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure BluetoothLogDebug(Device:PBluetoothDevice; const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 04:34, 10 November 2025

Return to Unit Reference


Description


Ultibo Bluetooth interface unit

Constants



Bluetooth device, driver and host specific 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 device types 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 device states 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 device status 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 device flags BLUETOOTH_FLAG_*
BLUETOOTH_FLAG_NONE = $00000000;  


Bluetooth host types 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');


Bluetooth host states 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');


Bluetooth host flags BLUETOOTHHOST_FLAG_*
BLUETOOTHHOST_FLAG_NONE = $00000000;  
BLUETOOTHHOST_FLAG_SHARED = $00000001;  
BLUETOOTHHOST_FLAG_NOCACHE = $00000002;  


Bluetooth status codes 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 logging 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



Initialization functions

procedure BluetoothInit;
Description: Performs basic initialization of the Bluetooth core driver, after this devices, hosts and drivers can be registered however nothing will work until BluetoothStart is called
Note Called only during system startup


function BluetoothStart:LongWord;
Description: Starts all registered Bluetooth hosts and begins the Bluetooth discovery process
Note None documented


function BluetoothStop:LongWord;
Description: To be documented
Note None documented


procedure BluetoothAsyncStart(Host:PBluetoothHost);
Description: To be documented
Note None documented


Bluetooth device, driver and host functions

function BluetoothDeviceAllocate(Host:PBluetoothHost):PBluetoothDevice;
Description: Create and Register a new Device entry in the Device table
Host The Host this device is attached to
Parent The Parent device this device is attached to (nil if this device has no parent)
Return Pointer to new Device entry or nil if device could not be created


function BluetoothDeviceRelease(Device:PBluetoothDevice):LongWord;
Description: Deregister and Destroy a Device from the Device table
Device The device to deregister and destroy
Return ERROR_SUCCESS if completed or another error code on failure


function BluetoothDeviceFind(BluetoothId:LongWord):PBluetoothDevice;
Description: To be documented
Note None documented


function BluetoothDeviceFindByName(const Name:String):PBluetoothDevice; inline;
Description: To be documented
Note None documented


function BluetoothDeviceFindByDescription(const Description:String):PBluetoothDevice; inline;
Description: To be documented
Note None documented


function BluetoothDeviceEnumerate(Callback:TBluetoothDeviceEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


function BluetoothDeviceNotification(Device:PBluetoothDevice; Callback:TBluetoothDeviceNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


function BluetoothDriverCreate:PBluetoothDriver;
Description: Create a new Bluetooth Driver entry
Return Pointer to new Driver entry or nil if driver could not be created


function BluetoothDriverCreateEx(Size:LongWord):PBluetoothDriver;
Description: Create a new Bluetooth Driver entry
Size Size in bytes to allocate for new driver (Including the driver entry)
Return Pointer to new Driver entry or nil if driver could not be created


function BluetoothDriverDestroy(Driver:PBluetoothDriver):LongWord;
Description: Destroy an existing Bluetooth Driver entry
Note None documented


function BluetoothDriverRegister(Driver:PBluetoothDriver):LongWord;
Description: Register a new Driver in the Bluetooth Driver table
Note None documented


function BluetoothDriverDeregister(Driver:PBluetoothDriver):LongWord;
Description: Deregister a Driver from the Bluetooth Driver table
Note None documented


function BluetoothDriverFind(DriverId:LongWord):PBluetoothDriver;
Description: Find a driver by Id in the Bluetooth Driver table
Note None documented


function BluetoothDriverFindByName(const Name:String):PBluetoothDriver; inline;
Description: Find a driver by name in the Driver table
Note None documented


function BluetoothDriverEnumerate(Callback:TBluetoothDriverEnumerate; Data:Pointer):LongWord;
Description: Enumerate all drivers in the Bluetooth Driver table
Note None documented


function BluetoothHostCreate:PBluetoothHost;
Description: Create a new Host entry
Return Pointer to new Host entry or nil if host could not be created


function BluetoothHostCreateEx(Size:LongWord):PBluetoothHost;
Description: Create a new Host entry
Size Size in bytes to allocate for new host (Including the host entry)
Return Pointer to new Host entry or nil if host could not be created


function BluetoothHostDestroy(Host:PBluetoothHost):LongWord;
Description: Destroy an existing Host entry
Note None documented


function BluetoothHostRegister(Host:PBluetoothHost):LongWord;
Description: Register a new Host in the Host table
Note None documented


function BluetoothHostDeregister(Host:PBluetoothHost):LongWord;
Description: Deregister a Host from the Host table
Note None documented


function BluetoothHostFind(HostId:LongWord):PBluetoothHost;
Description: To be documented
Note None documented


function BluetoothHostFindByName(const Name:String):PBluetoothHost; inline;
Description: To be documented
Note None documented


function BluetoothHostFindByDescription(const Description:String):PBluetoothHost; inline;
Description: To be documented
Note None documented


function BluetoothHostEnumerate(Callback:TBluetoothHostEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note None documented


function BluetoothHostNotification(Host:PBluetoothHost; Callback:TBluetoothHostNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note None documented


Bluetooth device, driver and host helper functions

function BluetoothDeviceGetCount:LongWord;
Description: Get the current device count
Note None documented


function BluetoothDeviceCheck(Device:PBluetoothDevice):PBluetoothDevice;
Description: Check if the supplied Device is in the device table
Note None documented


function BluetoothDriverGetCount:LongWord;
Description: Get the current Bluetooth driver count
Note None documented


function BluetoothDriverCheck(Driver:PBluetoothDriver):PBluetoothDriver;
Description: Check if the supplied Bluetooth Driver is in the driver table
Note None documented


function BluetoothHostGetCount:LongWord;
Description: Get the current host count
Note None documented


function BluetoothHostCheck(Host:PBluetoothHost):PBluetoothHost;
Description: Check if the supplied Host is in the host table
Note None documented


function BluetoothStatusToString(Status:LongWord):String;
Description: Translates a Bluetooth status code into a string
Note None documented


function BluetoothDeviceTypeToString(BluetoothType:LongWord):String;
Description: To be documented
Note None documented


function BluetoothDeviceStateToString(BluetoothState:LongWord):String;
Description: To be documented
Note None documented


function BluetoothDeviceStatusToString(BluetoothStatus:LongWord):String;
Description: To be documented
Note None documented


function BluetoothDeviceStateToNotification(State:LongWord):LongWord;
Description: Convert a Device state value into the notification code for device notifications
Note None documented


function BluetoothDeviceStatusToNotification(Status:LongWord):LongWord;
Description: Convert a Device status value into the notification code for device notifications
Note None documented


function BluetoothHostTypeToString(HostType:LongWord):String;
Description: To be documented
Note None documented


function BluetoothHostStateToString(HostState:LongWord):String;
Description: To be documented
Note None documented


function BluetoothHostStateToNotification(State:LongWord):LongWord;
Description: Convert a Host state value into the notification code for device notifications
Note None documented


procedure BluetoothLog(Level:LongWord; Device:PBluetoothDevice; const AText:String);
Description: To be documented
Note None documented


procedure BluetoothLogInfo(Device:PBluetoothDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure BluetoothLogWarn(Device:PBluetoothDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure BluetoothLogError(Device:PBluetoothDevice; const AText:String); inline;
Description: To be documented
Note None documented


procedure BluetoothLogDebug(Device:PBluetoothDevice; const AText:String); inline;
Description: To be documented
Note None documented


Return to Unit Reference