Difference between revisions of "Unit Bluetooth"

From Ultibo.org
Jump to: navigation, search
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 ===

Revision as of 04:19, 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


To be documented

Public variables


To be documented

Function declarations


To be documented


Return to Unit Reference