| 1 |
~~~~~~~~~~~~~~~~~~ |
| 2 |
Device Identifiers |
| 3 |
~~~~~~~~~~~~~~~~~~ |
| 4 |
|
| 5 |
.. include:: prologue.rst |
| 6 |
|
| 7 |
Description |
| 8 |
=========== |
| 9 |
|
| 10 |
The general syntax of a device identifier is: |
| 11 |
|
| 12 |
.. parsed-literal:: qualifier:parameter=value+... |
| 13 |
|
| 14 |
More specifically, with [brackets] meaning optional, the syntax is: |
| 15 |
|
| 16 |
.. parsed-literal:: [qualifier:][parameter=]value[+parameter=value]... |
| 17 |
|
| 18 |
The qualifier specifies which class of device is being identified. |
| 19 |
It is separated from the rest of the device identifier by a colon (``:``). |
| 20 |
It may be one of: |
| 21 |
|
| 22 |
========== ======================= |
| 23 |
Qualifier Assumed First Parameter |
| 24 |
---------- ----------------------- |
| 25 |
serial: name= |
| 26 |
usb: serialNumber= |
| 27 |
bluetooth: address= |
| 28 |
hid: address= |
| 29 |
null: |
| 30 |
========== ======================= |
| 31 |
|
| 32 |
The qualifier is case insensitive, and any abbreviation may be used. |
| 33 |
For backward compatibility (to when a device identifier was |
| 34 |
strictly interpreted as the absolute path to a serial device), |
| 35 |
the qualifier (along with its colon delimiter) is optional, |
| 36 |
and, if it isn't supplied, ``serial`` is assumed. |
| 37 |
|
| 38 |
One or more parameters may be supplied after the qualifier. |
| 39 |
Each parameter is specified as its name and its value, |
| 40 |
in that order, separated by an equals (``=``) sign. |
| 41 |
Parameters are separated from one another by a plus (``+``) sign. |
| 42 |
Parameter names are case insensitive, and any abbreviation may be used. |
| 43 |
Supplying a zero-length value means to use the parameter's default value. |
| 44 |
|
| 45 |
For backward compatibility |
| 46 |
(to when device identifier parameters weren't supported), |
| 47 |
the first supplied parameter is special |
| 48 |
in that its name (along with its equals sign delimiter) is optional. |
| 49 |
If the name of the first parameter isn't supplied then the |
| 50 |
class-dependent parameter that most specifically identifies the device is assumed. |
| 51 |
See the table above for which parameter is assumed for each class. |
| 52 |
|
| 53 |
It isn't possible to supply no parameters at all. |
| 54 |
Specifying only the qualifier is equivalent to also specifying |
| 55 |
a zero-length value for the assumed first parameter for that class. |
| 56 |
For example, specifying ``usb:`` is equivalent to specifying ``usb:serialNumber=``. |
| 57 |
|
| 58 |
An example to illustrate the optionality of both the qualifier |
| 59 |
and the name of the first supplied parameter: |
| 60 |
|
| 61 |
* On Linux, the name of the first serial device is ``ttyS0``. |
| 62 |
All of the following device identifiers refer to the same serial device:: |
| 63 |
|
| 64 |
serial:name=ttyS0 |
| 65 |
serial:ttyS0 |
| 66 |
ttyS0 |
| 67 |
name=ttyS0 |
| 68 |
|
| 69 |
Serial Device Identifiers |
| 70 |
------------------------- |
| 71 |
|
| 72 |
Serial device identifiers support the following parameters: |
| 73 |
|
| 74 |
=============== ========================================================= |
| 75 |
Name Value |
| 76 |
--------------- --------------------------------------------------------- |
| 77 |
``name`` name of, relative path to, or absolute path to the device |
| 78 |
``baud`` the data transmission/reception rate (bits per second) |
| 79 |
``dataBits`` the number of data bits per character |
| 80 |
``stopBits`` the number of stop bits per character |
| 81 |
``parity`` ``none``, ``odd``, ``even``, ``space``, ``mark`` |
| 82 |
``flowControl`` ``none``, ``hardware`` |
| 83 |
=============== ========================================================= |
| 84 |
|
| 85 |
All of the parameters are optional, |
| 86 |
although the ``name=`` parameter should be supplied. |
| 87 |
It shouldn't normally be necessary to supply any of the others, |
| 88 |
especially since, in most cases, the braille driver overrides them. |
| 89 |
|
| 90 |
``name=`` |
| 91 |
Specify the host device to use. It must be the name of the device, the |
| 92 |
relative path to the device, or the absolute path to the device. If it's either |
| 93 |
a name or a relative path then the host's device directory (usually ``/dev`` |
| 94 |
on Unix-based platforms) is used. If this parameter isn't supplied then the |
| 95 |
primary (first) serial device is assumed. |
| 96 |
|
| 97 |
``baud=`` |
| 98 |
Specify the speed, in bits per second, at which to communicate with the |
| 99 |
device. It must be a positive integer. Typical values are: ``9600``, ``19200``, |
| 100 |
``38400``, ``57600``, ``115200``. If this parameter isn't supplied then |
| 101 |
``9600`` is assumed. |
| 102 |
|
| 103 |
``dataBits=`` |
| 104 |
Specify the number of bits to use to represent a character, not including |
| 105 |
any metadata (start bit, stop bit(s), parity, etc). It must be a positive integer, |
| 106 |
and is usually within the range ``5``-``8``. If this parameter isn't |
| 107 |
supplied then ``8`` is assumed. |
| 108 |
|
| 109 |
``stopBits=`` |
| 110 |
Specify the number of stop bits to inject after a character has been |
| 111 |
transmitted and to expect after a character has been received. It must be |
| 112 |
a positive integer, and is usually either ``1`` (for higher speeds) or ``2`` (for |
| 113 |
lower speeds). If this parameter isn't supplied then ``1`` is assumed. |
| 114 |
|
| 115 |
``parity=`` |
| 116 |
Specify the type of error detection to use. It must be one of: ``none``, |
| 117 |
``odd``, ``even``, ``space``, ``mark``. If this parameter isn't supplied |
| 118 |
then ``none`` is assumed. |
| 119 |
|
| 120 |
``flowControl=`` |
| 121 |
Specify the kind of flow control to use. It must be one of: ``none``, |
| 122 |
``hardware``. If this parameter isn't supplied then ``none`` is assumed. |
| 123 |
|
| 124 |
USB Device Identifiers |
| 125 |
---------------------- |
| 126 |
|
| 127 |
USB device identifiers support the following parameters: |
| 128 |
|
| 129 |
====================== =================================================== |
| 130 |
Name Value |
| 131 |
---------------------- --------------------------------------------------- |
| 132 |
``serialNumber=`` one or more arbitrary characters |
| 133 |
``vendorIdentifier=`` an integer within the range 1-65535 (0X0001-0XFFFF) |
| 134 |
``productIdentifier=`` an integer within the range 1-65535 (0X0001-0XFFFF) |
| 135 |
``genericDevices=`` ``yes``, ``no`` |
| 136 |
====================== =================================================== |
| 137 |
|
| 138 |
All of the parameters are optional. It shouldn't normally be necessary to |
| 139 |
supply any of them. |
| 140 |
|
| 141 |
``serialNumber=`` |
| 142 |
Specify the serial number that the device must have. The match is case |
| 143 |
sensitive and must be exact. If this parameter isn't supplied then the |
| 144 |
serial number of the device isn't verified. |
| 145 |
|
| 146 |
``vendorIdentifier=`` |
| 147 |
Specify the vendor identifier that the device must have. It must be an |
| 148 |
integer within the range ``1``-``65535`` (or, in hexadecimal, |
| 149 |
``0X0001``-``0XFFFF``). If this parameter isn't supplied then the vendor |
| 150 |
identifier of the device isn't verified. |
| 151 |
|
| 152 |
``productIdentifier=`` |
| 153 |
Specify the product identifier that the device must have. It must be an |
| 154 |
integer within the range ``1``-``65535`` (or, in hexadecimal, |
| 155 |
``0X0001``-``0XFFFF``). If this parameter isn't supplied then the product |
| 156 |
identifier of the device isn't verified. |
| 157 |
``genericDevices=`` |
| 158 |
Specify whether or not a device that has a generic vendor/product identifier |
| 159 |
pair may be used. It's value must be either ``yes`` or ``no``. The check is |
| 160 |
case insensitive, and any abbreviation may be used. If this parameter isn't |
| 161 |
supplied then ``yes`` is assumed. |
| 162 |
|
| 163 |
Bluetooth Device Identifiers |
| 164 |
---------------------------- |
| 165 |
|
| 166 |
Bluetooth device identifiers support the following parameters: |
| 167 |
|
| 168 |
============= ============================================================= |
| 169 |
Name Value |
| 170 |
------------- ------------------------------------------------------------- |
| 171 |
``address=`` six two-digit hexadecimal numbers separated by ``:`` or ``-`` |
| 172 |
``name=`` one or more arbitrary characters |
| 173 |
``channel=`` an integer within the range ``1``-``30`` |
| 174 |
``discover=`` ``yes``, ``no`` |
| 175 |
``timeout=`` an integer within the range ``1``-``59`` |
| 176 |
============= ============================================================= |
| 177 |
|
| 178 |
All of the parameters are optional except that |
| 179 |
the ``address=`` parameter is required on platforms where |
| 180 |
BRLTTY can't yet detect a Bluetooth device based on its name. |
| 181 |
It shouldn't normally be necessary to supply any of the others. |
| 182 |
|
| 183 |
BRLTTY can detect a Bluetooth device by name on the following platforms: |
| 184 |
|
| 185 |
* Android |
| 186 |
* Linux (if the Bluetooth version is at least 5) |
| 187 |
* Windows |
| 188 |
|
| 189 |
``address=`` |
| 190 |
Specify the MAC address of the device. It must be six two-digit |
| 191 |
hexadecimal numbers (the "letter" digits may be in either case) separated |
| 192 |
from one another by either a colon (``:``) or a minus (``-``) sign. |
| 193 |
|
| 194 |
``name=`` |
| 195 |
Specify the name of the device. It must be one or more |
| 196 |
arbitrary characters. They need only match the beginning (so not |
| 197 |
necessarily all) of the name. Case is significant. |
| 198 |
Only the names of paired devices are considered. |
| 199 |
This parameter is ignored if the ``address=`` parameter has been specified. |
| 200 |
|
| 201 |
``channel=`` |
| 202 |
Specify the RFCOMM channel to use. It must be an integer within the range |
| 203 |
``1``-``30``. If this parameter isn't supplied then either a driver-supplied |
| 204 |
default channel number is assumed or service discovery is performed. |
| 205 |
|
| 206 |
``discover=`` |
| 207 |
Specify whether or not service discovery is to be performed. In other words, |
| 208 |
this parameter specifies whether or not the device is to be "asked" for the |
| 209 |
RFCOMM channel number. It must be either ``yes`` or ``no``. The check is |
| 210 |
case insensitive, and any abbreviation may be used. If this parameter isn't |
| 211 |
supplied then whether or not service discovery is performed is decided |
| 212 |
according to the following sequence of tests: |
| 213 |
|
| 214 |
1) If the ``channel=`` parameter has been supplied, then **no**. |
| 215 |
2) If the driver has requested service discovery, then **yes**. |
| 216 |
3) If the driver has specified a default channel number, then **no**. |
| 217 |
4) Otherwise, **no**. |
| 218 |
|
| 219 |
``timeout=`` |
| 220 |
Specify the number of seconds to wait for a connection to the device to be |
| 221 |
acquired. It must be an integer within the range ``1``-``59``. If this |
| 222 |
parameter isn't supplied then a reasonable default is assumed. |
| 223 |
|
| 224 |
HID Device Identifiers |
| 225 |
---------------------- |
| 226 |
|
| 227 |
HID device identifiers support the following parameters: |
| 228 |
|
| 229 |
================= ============================ |
| 230 |
Name Value |
| 231 |
----------------- ---------------------------- |
| 232 |
``address=`` Bluetooth MAC address |
| 233 |
``name=`` Bluetooth device name |
| 234 |
``manufacturer=`` USB device manufacturer |
| 235 |
``description=`` USB product description |
| 236 |
``serialNumber=`` USB serial number |
| 237 |
``vendor=`` four hexadecimal digits |
| 238 |
``product=`` four hexadecimal digits |
| 239 |
================= ============================ |
| 240 |
|
| 241 |
All of the parameters are optional, although, in most cases, |
| 242 |
either the ``serialNumber=`` parameter (for a USB device) |
| 243 |
or the ``address=`` parameter (for a Bluetooth device) |
| 244 |
should be supplied. |
| 245 |
USB-specific and Bluetooth-specific parameters may not be combined. |
| 246 |
|
| 247 |
``address=`` |
| 248 |
The MAC address of a Bluetooth device. |
| 249 |
It must be six two-digit hexadecimal numbers |
| 250 |
separated from one another by a colon (``:``). |
| 251 |
The letter digits may be in either case. |
| 252 |
|
| 253 |
``name=`` |
| 254 |
The name of a Bluetooth device. |
| 255 |
Only the start of the name is matched. |
| 256 |
Matching is case insensitive. |
| 257 |
|
| 258 |
``manufacturer=`` |
| 259 |
The name of the manufacturer of a USB device. |
| 260 |
Only the start of the name is matched. |
| 261 |
Matching is case insensitive. |
| 262 |
|
| 263 |
``description=`` |
| 264 |
The product description of a USB device. |
| 265 |
Only the start of the description is matched. |
| 266 |
Matching is case insensitive. |
| 267 |
|
| 268 |
``serialNumber=`` |
| 269 |
The serial number of a USB device. |
| 270 |
Only the start of the serial number is matched. |
| 271 |
Matching is case insensitive. |
| 272 |
|
| 273 |
``vendor=`` |
| 274 |
The vendor identifier of the device. |
| 275 |
It must be four hexadecimal digits. |
| 276 |
The letter digits may be in either case. |
| 277 |
|
| 278 |
``product=`` |
| 279 |
The product identifier of the device. |
| 280 |
It must be four hexadecimal digits. |
| 281 |
The letter digits may be in either case. |
| 282 |
|
| 283 |
Null Device Identifiers |
| 284 |
----------------------- |
| 285 |
A ``null`` endpoint has the following properties: |
| 286 |
|
| 287 |
* It always indicates that input is available. |
| 288 |
* Reading from it always yields end-of-file. |
| 289 |
* Writing to it is always successful but does nothing. |
| 290 |
|