In addition to blocking the mainloop hci_send_req changes the socket
filters which makes it unusable for the per-adapter HCI socket in
hciops.c. Using hci_send_cmd makes much more sense here.
Previously simultaneous authentication requests to the same device caused
bluetoothd crash. Now if ongoing authentication occurs error is returned,
preventing from simultaneous requests to the same device.
This changes hook telephony driver de/initialization to powered state so
telephony drivers can now free their resources when there is no adapter
active in the system.
This patch lets set_speed function changing UART baud rate to return an
error code if any one operation fails instead of returning only the last
operation's status.
When a io_watcher is added to an MDL or an MCL channel, its reference
should be incremented because the watcher should keep its own reference
the the structure.
Also a destroy function is added in order to decrement the reference
once the watcher is removed.
The value 0x03 isn't something that exists in the core spec, so it
shouldn't be used in the same API as SCO/ACL link types. Since there are
some experimental kernel patches that use it this patch makes it private
to hcitool.c.
Due to a possible kernel bug, sometimes the very first HCI commands that
the kernel sends might go unnoticed. Therefore check for this when one
of the last commands (read_local_name) that the kernel sends completes.
Since the connections can be cancelled while still not complete the
GIOChannel must be stored in order to be properly closed when freeing
avdtp session or stream and thus avoid any callbacks to be called after
that.
The spec clearly suggested that abort can be send while on idle state:
"AVDTP_ABORT_CMD can be sent or received in IDLE state. In the event that
an AVDTP_ABORT_CMD is received in IDLE state, ACP or INT shall reply with
an AVDTP_ABORT_RSP, no state change is required."
In fact abort is the only way to cancel set_configuration and open
commands.
The array of service UUIDs used by the DeviceFound signal contains the
same information from the GSList of services. Instead of reallocating
this array on each signal, store it on the remote_dev_info structure and
only reallocate it if there are new UUIDs.
These flags will be used to decide if GATT service discovery will happen
over LE (for single mode devices) or BR/EDR (for dual mode and non-LE
devices).
Sub-procedure used to read a Characteristic Value when the client
only knows the characteristic UUID and doesn't know the handle.
More than one handle and attribute value pair can be returned,
it is up to the user define the handles range based on the service
handles range.
Usage example:
$gatttool --char-read --uuid=2a00 -i hcix -b xx:xx:xx:xx:xx:xx
Implement only the first interaction of the discovery procedure. If the
response doesn't fit in the MTU, "start" and "end" options can be used
to discover the handles ranges of the remaining primary service instances.
UUID16 and UUID128 are supported in the uuid option.
Usage example:
$gatttool -i hcix -b xx:xx:xx:xx:xx:xx --uuid=1801 --primary
Extends discover primary function to perform discover by UUID. UUID
parameter defines which procedure will be executed: Discover All
Primary Services or Discover Primary Service by Service UUID.
GATT Discover Primary Service by Service UUID sub-procedure is based
on ATT Find By Type Value Request/Response.
Implement an extra verification for broken requests: "Ending Handle"
different than 0xFFFF. The Group End Handle may be greater than the
"Ending Handle" in the Find By Type Value Request. Forces the "Ending
Handle" in the response to 0xFFFF to avoid another request from the
clients. 0xFFFF means that the sub-procedure is complete.