We were checking by a positive return value instead of checking by -1
and errno. However when there's no support for TTY kernel returns
EOPNOTSUPP as usual, which in the end will have a return value of -1
and errno will be set to EOPNOTSUPP.
This patch enables the Intel Bluetooth device (UART sku) over the H4
protocol. It is responsible for bring up the device into known state by
configuring the baudrate and applying the patches, if required.
The current link-establishment implementation times out if a packet is
not received after the link is active (i.e. reception of CONF_RESP).
Fix by making sure that the link establishment loop in open is
terminated when ubcsp sets the UBCSP_PACKET_SENT flag (on reception of
CONF_RESP) rather than UBCSP_PACKET_RECEIVED (on reception of any later
packages).
LanguageBaseAttributeIDList is set from few places and each time static
function was copied and used for that. Move this funtion to sdp code
and use that instead of copying code.
Variables which are assigned to the errno variable (usually called
"err") should be negative, and "-err" should be used where a positive
value is needed.
Variables which are assigned to the errno variable (usually called
"err") should be negative, and "-err" should be used where a positive
value is needed.
There were missing buffer size checks and wrong assumptions about the
EIR data length (core spec 4.0 defines it to be max 31 bytes, so the
name can be max 29 bytes).
override speed setting if firmware script issues serial settings command,
otherwise the value given in the firmware script will be overridden.
Example:
hciattach /dev/ttyO1 texas 115200
will fail, because /dev/ttyO1 will be opened with 115200 b/s, then
the firmware script will set the buadrate to 3000000 b/s, after UART init
hciattach.c will set the baudrate to 115200, so communication is broken.
The only correct way is to set both speeds:
hciattach -s 115200 /dev/ttyO1 texas 3000000
With this patch only initial speed must be specified. The former semantic
will be preserved in case the firmware script doesn't provide serial
settings action.
Tested with wl1271 and firmware TIInit_7.2.31.bts
The timeout value has been hardcoded on hci_send_req call and, instead,
it should be passed from above (for ex from hci_le_set_scan_enable).
This patch removes the hardcoded value from hci_send_req and it
increases the timeout to 1000ms.
Set interval and window parameters properly if --discovery option
is present in lescan command.
According to the Bluetooth spec, during a general or limited discovery
procedure the scan interval and the scan window should be set to
11.25 ms. If --discovery option isn't present, both parameters are set
to the default value (10 ms) defined in LE Set Scan Parameters Command.
According to that command description, the interval and window parameters
should be set as follows:
Time = N * 0.625 msec
So, in order to set the time values to 11.25 and 10 ms, the parameters
should be equal to 18 (0x0012) and 16 (0x0010), respectively.
This patch adds the option [--discovery=g|l] to lescan command. Use
this option to enable the general or limited discovery procedure.
If discovery option is not given scanning will display all results
ignoring the AD flags.
Allows the LE master to start the Connection Parameter Update Procedure.
Parameters values consistency are not verified on purpose allowing
invalid values to test fail scenarios.
hciconfig: warrning user on unknown commands
hcitool: return error on unknown command in hcitool
fix length size in comparision to avoid ambiguity commands
check if command number of arguments is correct
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.
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.
The Texas specific initialization code sends HCI commands over the
bluetooth socket, but does not bring up the device. This gives these
errors when running "hciattach /dev/ttyUSB0 texas":
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/TIInit_XX.Y.ZZ.bts
Loaded BTS script version 1
Cannot send hci command to socket: Network is down
Can't initialize device: Network is down
This patch implements two new hciconfig commands: leadv and noleadv.
These new hciconfig flags are responsible to LE_SET_ADVERTISE_ENABLE
command implementation.
This patch implements support for the Atheros AR300x Bluetooth chip in
hciattach. It supports configuration download and power management
configure feature.
This provides a new option for hciattach to enable hardware specific
power management from host.
This option by default will be disabled for existing devices
Extend sdptool to allow to add GATT SDP record. Devices that support
GATT over BR/EDR shall publish GATT record. This implementation intend
to be a reference for GATT SDP record creation and it can be a helper
to GATT servers implemented outside BlueZ.
This patch adds a -r switch to hciattach that can be used to initialize
a device into raw mode. This is accomplished with the help of the new
HCIUARTSETFLAGS ioctl.
This command allows the creation of LE Connections to remote devices.
The command is useful for testing if the local device is able to start
connections and if the remote device is able to receive connection
requests.
This fixed an issue with sending an image from OSX. OSX would show a
warning that the bluez stack does not support this file type, but offer
to send it anyway (which works). This change to advertise support for
all object types will remove this warning.
The list of file types that can be advertised in the SDP record is very
limited anyway. It is best to list that we support all file types here,
and then filter at the OPP/OBEX connection instead.
For reference:
0x01 = vCard 2.1
0x02 = vCard 3.0
0x03 = vCal 1.0
0x04 = iCal 2.0
0x05 = vNote
0x06 = vMessage
0xFF = any type of object.
Fix to pass PTS case TC_SDAS_BV_03_I(since PTS3.2 update2).
The code tried to append the UINT type value to the supported
respositories. However, the wrong function sdp_seq_alloc()
was used. This function adds 2 redundant bytes (SDP_SEQ8 as
0x35, seq) ahead of 0x08, so that latest PTS IOPT will fail.
According to spec, PBAP attributes should report 0x08 0x01
or 0x08 0x03 right after 0x0314. The correct function to use
is sdp_data_alloc(), with clean 0x08 0x01 appended as
SDP_ATTR_SUPPORTED_REPOSITORIES.
These errors were caused from trying to detach the kernel driver from
the interface, which was unnecessary. A simple usb_claim_interface is
all that is necessary. It is however, important to ensure the interface
claim is successful.
This means that the hid2hci tool will not have to run on every bootup
for every machine with BlueZ installed. It instead gets ran on demand
if a product that is called out from a udev rules file contains the
correct attributes and/or VID/PID.
It also makes it easier for users to manually test new VID/PID
combinations to determine if they should be supported by BlueZ.