This patch fixes queue_find definition to have const pointer as data to
be matched against. Match function already does have const pointers as
arguments. Also parameter name is updated to be 'match_data' since this
actually is not user_data, just data to be matched against.
With changes introduced in kernel by 6fd6b915 we no longer require MITM
when being pairing initiator (i.e. we indicate it to remote but do not
force it when remote does not require it) thus kernel will auto-accept
pairing when remote also does not require MITM. As a result it's not
possible for tester to reject user confirmation since there's no
request from kernel.
This patch sets acceptor authentication requirements to include MITM
so we'll have user confirmation request and tester can reject it.
This is a preparation for correctly handling no bond pairing.
Currently paired but not bonded devices are left on list of bonded
devices in Framework until BT is restarted on device. This is due to
Android Framework is not allowing stack to unpair device by its own
(setting bond state bonded->no_bond is ignored).
It is possible that dual mode device is paired both for LE and BR/EDR
link. This patch add tracking of this.
Due to HAL API contraints second pairing will result in following bond
state changed events:
bonded -> bonding (success) -> bonded (success/failed)
Currently kernel is lacking support for fine grained configuration of
advertising data but this is ignored for now.
Vendor data is not supported and if it is to be set command will fail.
This should be implemented when kernel support is added.
This fixes the following issue:
==8505== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to
uninitialised byte(s)
==8505== at 0x534133D: ??? (syscall-template.S:82)
==8505== by 0x7756346: hal_ipc_cmd (hal-ipc.c:359)
==8505== by 0x7750EB2: init (hal-health.c:206)
==8505== by 0x40DF7F: init_p (if-hl.c:86)
==8505== by 0x401961: main (haltest.c:417)
==8505== Address 0x7fefffb81 is on thread 1's stack
We prepare response by filling btgatt_response_t union's first member
only. The same thing is done by JNI in Android, which ignores second
member. There is also no parameter to tell which union member is set.
More to this, second union member seams to be redundant duplicate of
first member's inner member (broken API?). JNI method is always called
with auth_req set to 0 thus this parameter is omitted in haltest.
As we always send whole gatt_response_t struct through IPC,
but copy only cmd->len bytes, the rest should be initilised to 0.
This fixes the following issue:
==30585== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points
to uninitialised byte(s)
==30585== at 0x534133D: ??? (syscall-template.S:82)
==30585== by 0x7756336: hal_ipc_cmd (hal-ipc.c:359)
==30585== by 0x77546DF: send_response.part.0 (hal-gatt.c:1247)
==30585== by 0x408119: gatts_send_response_p (if-gatt.c:1777)
==30585== by 0x40219F: process_line (haltest.c:293)
==30585== by 0x402552: terminal_action_enter (terminal.c:666)
==30585== by 0x403184: terminal_process_char (terminal.c:781)
==30585== by 0x401B90: stdin_handler (haltest.c:308)
==30585== by 0x402261: poll_dispatch_loop (pollhandler.c:60)
==30585== by 0x401870: main (haltest.c:441)
==30585== Address 0x7fefff2a3 is on thread 1's stack
This is in preparation for a set_leds_sysfs() function.
Make set_leds_hidraw() return void, as its return value is never used
by the caller: the setup_leds() callback has to always return FALSE.