summaryrefslogtreecommitdiff
path: root/android/bluetooth.c
Commit message (Collapse)AuthorAgeFilesLines
* android/bluetooth: Fix retriggering the discoveryJakub Tyszkowski2014-08-041-5/+13
| | | | | | | | Previously le device found callback was set every time we triggered the scan from gatt. But it does no longer work like that. This callback is now set when gatt profile is registered and should not be used for checking if we should be retriggering the scan. Expected discovery flag should be used directly instead.
* android/bluetooth: Clear auto connect list on startupLukasz Rymanowski2014-08-041-0/+29
| | | | | | In android we add devices to auto connect list when application trigger connect. We need to make sure that when bluetooth is turn on there is no devices in auto connect list in the kernel.
* android/bluetooth: Add API to remove device from auto connect listLukasz Rymanowski2014-08-041-0/+28
|
* android/bluetooth: Add API to add device to auto connect listLukasz Rymanowski2014-08-041-0/+31
|
* android/bluetooth: Add flag for kernel connection controlLukasz Rymanowski2014-08-041-0/+13
| | | | | | | This patch set option kernel connection control to TRUE if mgmt interface is 1.7 or higier. Kernel connect control means that things like background scan, auto connect or white list are supported by kernel and can be used by daemon.
* android/core: Use g_clear_error instead of free and assignmentAndrei Emeltchenko2014-08-011-2/+1
| | | | | g_clear_error() frees err and set it to NULL. This fixes dead code warnings from analyzers.
* android/bluetooth: Fix loading LTKsMarcin Kraglak2014-07-301-1/+1
|
* mgmt: Rename pairable to bondableJohan Hedberg2014-07-301-2/+2
|
* android/bluetooth: Add function for checking last seen bearerSzymon Janc2014-07-111-0/+11
|
* android/bluetooth: Fix updateing bond stateSzymon Janc2014-06-301-2/+10
|
* android/bluetooth: Fix adding device to bonded list multiple timesSzymon Janc2014-06-301-2/+2
| | | | | | | Current bearer pair state needs to be checked as well since event triggering state update can be received multiple times. This fix crash on bluetoothd shutdown due to double free of device.
* android/bluetooth: Log error if loading LTKs or IRKs failedSzymon Janc2014-06-241-2/+20
|
* android/gatt: Use proper address when connectingSzymon Janc2014-06-241-0/+14
| | | | If device was using RPA but address was resolved IDA must be used.
* android/bluetooth: Map RPA to Identity address on New IRK eventSzymon Janc2014-06-241-9/+71
| | | | | | | | | This patch allows to pair with devices using RPA. There is no API to notify HAL about new Identity Address. When New IRK event is received ID address is stored in device and map to RPA is done. This allows to use RPA after address was resolved making this transparent to Android Framework. When daemon is restarted device is advertised to Framework with ID address.
* android/bluetooth: Add get_device_android_addr helperSzymon Janc2014-06-241-14/+29
| | | | This will be used to fake address for Android Framework.
* android/bluetooth: Fix passing address type to SSP repliesSzymon Janc2014-06-241-9/+11
|
* android/bluetooth: Pass device to send_bond_state_change functionSzymon Janc2014-06-241-3/+3
|
* android/bluetooth: Add helper for finding device with android addressSzymon Janc2014-06-241-29/+38
|
* android/bluetooth: Fix loading device address type from storageSzymon Janc2014-06-201-4/+4
| | | | | Address type is stored as "AddressType" key. Also this is valid only for LE capable devices.
* android/bluetooth: Pass device to send_device_property functionSzymon Janc2014-06-201-11/+9
|
* android/bluetooth: Update bonding state after receiving new CSRK.Marcin Kraglak2014-06-171-0/+3
| | | | Set bonded state if received new CSRK.
* android/bluetooth: Clear CSRK information after unpairMarcin Kraglak2014-06-171-0/+6
| | | | CSRK information should be removed when unpaired.
* android/bluetooth: Fix not setting expected discovery typeLuiz Augusto von Dentz2014-06-131-1/+4
| | | | | The code was not setting the expected discovery type for the next round when discovering is active.
* android/bluetooth: Add bt_device_set_uuidsLuiz Augusto von Dentz2014-06-131-0/+13
|
* android/gatt: Fix not detecting device found by Bluetooth HALLuiz Augusto von Dentz2014-06-131-14/+28
| | | | | This is necessary so that devices found during regular discovery can be handled by gatt HAL.
* android/bluetooth: Add bt_is_device_le functionLuiz Augusto von Dentz2014-06-131-0/+11
|
* android: Load Identity Resolving KeysJakub Tyszkowski2014-06-121-0/+62
| | | | Load IRKs from file.
* android: Store remote's Identity Resolving KeyJakub Tyszkowski2014-06-121-0/+58
| | | | Persistent storage is used so we can load IRKs on startup.
* android: Add gatt CCC value storageJakub Tyszkowski2014-06-061-0/+52
| | | | | | Client Characteristic Configuration for Service Changed Characteristic should be stored for every bonded device, so we know if we should be sending value (range affected by changes) indication.
* android/bluetooth: Register SDP record for MPSSzymon Janc2014-05-261-0/+106
| | | | | This was affecting TC_AG_SRC_HFAV_ACT_SD_BV_01_I and TC_SDP_CTH_SD_BV_01_I PTS qualification tests.
* android: Fix sending uninitialised dataJakub Tyszkowski2014-05-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following: ==25759== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised byte(s) ==25759== at 0x521C570: __sendmsg_nocancel (syscall-template.S:82) ==25759== by 0x41688F: ipc_send (ipc.c:366) ==25759== by 0x40ECF8: send_ssp_request (bluetooth.c:1028) ==25759== by 0x4110A6: user_confirm_request_callback (bluetooth.c:1055) ==25759== by 0x4094FE: queue_foreach (queue.c:186) ==25759== by 0x409FCF: can_read_data (mgmt.c:287) ==25759== by 0x408E4C: read_callback (io-glib.c:168) ==25759== by 0x4E79D12: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) ==25759== by 0x4E7A05F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) ==25759== by 0x4E7A459: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4) ==25759== by 0x40454D: main (main.c:538) ==25759== Address 0x7ff00085d is on thread 1's stack ==25759== Uninitialised value was created by a stack allocation ==25759== at 0x40EC77: send_ssp_request (bluetooth.c:1018)
* android/bluetooth: Store sign counter needed for aes-cmac signLukasz Rymanowski2014-05-261-2/+39
| | | | | If CSRK is valid between sessions we should remember sign counter. Therefor store it.
* android/bluetooth: Read CSRK from the storage on startupLukasz Rymanowski2014-05-261-0/+22
|
* android/bluetooth: Store CSRKLukasz Rymanowski2014-05-261-1/+44
| | | | | CSRK is generated while paring and should be used for sign att packets when LE devices uses write signed command.
* android/bluetooth: Add support to read CSRK from the kernelLukasz Rymanowski2014-05-261-0/+40
|
* android/bluetooth: Expose API to update sign counterLukasz Rymanowski2014-05-261-0/+14
| | | | | This is needed so GATT can notify GAP that write sign has been done and sign counter shall be increased as per spec.
* android/bluetooth: Expose API to get CSRK for deviceLukasz Rymanowski2014-05-261-0/+31
| | | | | GATT will take CSRK key and sign counter each time it needs it to sign att package or to verify att package
* android/bluetooth: Add bonded information to found device callbackLukasz Rymanowski2014-05-221-1/+2
| | | | | | If device is bonded then discoverable flag is not set. This cause that gatt application will not get scan callback with advertising bonded device.
* android/bluetooth: Simplify check if device type changedSzymon Janc2014-05-191-17/+13
| | | | | This makes code easier to follow. Also LE address type is not lost if dual mode device connected over BR/EDR.
* android/bluetooth: Track if paired device is bondedSzymon Janc2014-05-191-19/+36
| | | | | | | | | 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).
* android/bluetooth: Fix unpairing dual mode deviceSzymon Janc2014-05-191-6/+19
| | | | | If device is paired on LE and BR/EDR it should be unpaired on both bearers.
* android/bluetooth: Fix pairing of dual mode devicesSzymon Janc2014-05-191-48/+124
| | | | | | | | | 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)
* android/bluetooth: Track device last connected bearerSzymon Janc2014-05-191-13/+62
| | | | | This allows to correctly choose address type when pairing dual mode devices.
* android/bluetooth: Add support to read connection RSSIAndrzej Kaczmarek2014-05-191-0/+56
|
* android/bluetooth: Fix minor codestyle issuesSzymon Janc2014-05-161-2/+2
|
* android/bluetooth: Add function for checking device bond stateGrzegorz Kolodziejczyk2014-05-141-0/+8
| | | | This will be used by GATT HAL.
* android/bluetooth: Make sure proper controller mode is set on startSzymon Janc2014-05-131-7/+24
| | | | | BR/EDR and LE features can be toggled before daemon is started and we should not assume their state.
* android/bluetooth: Always create device object in create bondSzymon Janc2014-05-091-14/+8
| | | | | If device is not known (ie. OOB pairing) create new device object so it can be later used in pairing events.
* android/bluetooth: Pass device to send_ssp_requestSzymon Janc2014-05-091-13/+9
| | | | This allows to fill event with all required data.
* android/bluetooth: Pass device to set_device_bond_stateSzymon Janc2014-05-091-36/+68
| | | | | This is in preparation for always having device object present when handling events.