Age | Commit message (Collapse) | Author | Files | Lines |
|
Update algorithm to select bt adapter from bluez's
list of available adapters:
1) use system default (default_adapter); if not
found then
2) fallback to first available adapter from the
list; if the list is empty then
3) fallback to no adapter present scenario.
Bug-AGL: SPEC-3577
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: Ifb35070a42a2306cc867993a22bcbb730803c33d
|
|
Adding outgoing pairing request with another BT device when we call pair verb.
"RequestPinCode" is handled as xml into bluetooth-agent.c to confirm a pincode and send it to BT device when we call pair request from AGL device to other device.
Bug-AGL: SPEC-3610
Signed-off-by: saman <mahmoudi.saman1@gmail.com>
Change-Id: I4fa8c9ab5d3bbf323cee7645f217bb1056d93b65
|
|
If not provide a new adapter or if new adapter is the same one with
default, reply with existing defalut adapter.
At the same time, clean some unnecessary code, following up the change
of
https://gerrit.automotivelinux.org/gerrit/c/apps/agl-service-bluetooth/+/25292
Bug-AGL: SPEC-3577
Change-Id: If3cbf8d1fb36a144f321db1056c38fd335ef9a28
Signed-off-by: Li, Xiaoming <lixm.fnst@cn.fujitsu.com>
|
|
Add logic to create an entry for 'default_adapter'
in the persistence database.
This will enable having the stored value available
between power up/power down cycles.
Bug-AGL: SPEC-3577
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I158dcc1d37ccaf8dfe5d53e262f0619ad780c26a
|
|
log:
[ 22%] Building C object binding/CMakeFiles/afm-bluetooth-binding.dir/bluetooth-api.c.o
/home/devel/xds-workspace/app/agl-service-bluetooth/binding/bluetooth-api.c: In function ‘bluetooth_get_adapters_count’:
/home/devel/xds-workspace/app/agl-service-bluetooth/binding/bluetooth-api.c:540:9: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
return count;
^~~~~
Change-Id: I05263a24322e928d5cd5dfdddec68372eeff3e62
Signed-off-by: Li, Xiaoming <lixm.fnst@cn.fujitsu.com>
|
|
When running in qemu, there seems to be a rare race condition
where the timeout waiting on BlueZ during init happens with the
timing such that bluetooth_func doesn't finish before init returns,
resulting in an invalid access to the init_data structure that was
on the init function's stack. To fix this, init_data is now
allocated and refcounted using glib's atomic refcounted memory
allocator API.
Bug-AGL: SPEC-3301
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I1ea8831ca5c008a2916909671e62cbd770906e5e
|
|
This change should have been part of commit c5db00e,
but was by mistake left behind. This change includes
guards against null pointers in case of a system with
no bluetooth adapter.
Bug-AGL: SPEC-3301
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I01cf72515a8e1e28fa26974927adb605c1a06dbd
|
|
During start up, there are races between the
bluetooth, persistence, bluetooth-map and
bluetooth-pbap bindings; on top of it, in the
case there's no bluetooth controller in the system,
various key parameters can exhibit a null value.
The combination of these races and the lack of
bluetooth controller can manifest in a number of
segfaults in the bluetooth binding (it's very easy
to reproduce on qemu).
This commit brings in several changes to make the
bluetooth binding resilient to the races and lack
of bluetooth controller:
* on startup, retrieve the default adapter from
the persistence binding from the init thread
* store the system default adapter in the service
init data structure, and store the active adapter
in the bluetooth state structure.
* update get_default_adapter to return value
obtained from persistence biding, without further
processing;
* add guards to make sure the userdata retrieved
from the application framework is valid;
* on verbs processing, ensure the caller provides
an adapter to apply the verb to, or that at least
there's a valid adapter associated to the
bluetooth state structure;
* initialize agent_data's device_path following free
operation;
* add guards for mediaplayer_path.
Bug-AGL: SPEC-3301
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: Ia5a0dc9a61024ff43cd247216d0dff6918046f7e
|
|
The initialization sequence for dbus services is not
fixed, and some races have been observed between
blutoothd and agl-service-bluetooth when running on
qemu: sometimes Bluetooth-Manager can be ready before
org.bluez and this results in reporting no adapter,
even though it's not accurate.
Also, although this issue has been seen only using qemu,
the race is there and it could also manifest in
other platforms with a bluetooth controller attached.
This patch simply provides the logic to discern between
'no org.bluez service found' and 'no bluetooth
controller present':
- in the case of no org.bluez
service detected, an error is returned to allow for
retries,
- in the case of no controller present, no error is
returned and agl-service-bluetooth completes the
initialization.
Bug-AGL: SPEC-3301
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I4868803bcfbd36fb65028cea5c997c4f174675a0
|
|
Only unregister agent on exit path if it had been
registered beforehand.
Bug-AGL: SPEC-3301
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I60fc2af01800521e0d5b026dbf7404b445eff6f9
|
|
Add logic to obtain the number of bluetooth
controllers in the system, if there's at least
one, then apply the existing logic: register the
agent, etc; if there's none, simply add a line to
record this case in the journal, skip agent
registration and signal that the Bluetooth-Manager
service initialization completed without errors, to
keep the service running.
Also fixed indentation on 2 lines on the same file
where the mentioned changes are applied:
binding/bluetooth-api.c.
Bug-AGL: SPEC-3301
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
Change-Id: I43a7aac709845bef71295ebd470546f252db8fa0
|
|
No other applications/bindings check the version verb to figure
which schema version to use.
Bug-AGL: SPEC-3156
Change-Id: I5baea8d7a38101bc9378f90c40981e73074ed558
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
/work/agl-service-bluetooth/binding/bluetooth-util.c:170:14: warning:
integer overflow in expression ‘-2147483648’ of type ‘long int’
results in ‘-2147483648’ [-Woverflow]
if (i64 >= -(1L << 31) && i64 < (1L << 31))
^
In file included from /xdt/sdk/sysroots/
armv7vet2hf-neon-vfpv4-agl-linux-gnueabi/usr/include/afb/afb-binding.h:
116,
from /work/agl-service-bluetooth/binding/
bluetooth-util.c:36:
/work/agl-service-bluetooth/binding/bluetooth-util.c:291:16: warning:
format ‘%lu’ expects argument of type ‘long unsigned int’, but argument
7 has type ‘gsize’ {aka ‘unsigned int’} [-Wformat=]
AFB_WARNING("Can't handle variants with more than one children
(%lu)", nitems);
Bug-AGL: SPEC-2422
Change-Id: Ic0f1a9f20c8bbe17040c3c9727922bc930b6f786
Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
|
|
Remove follow warnings by switching from int to size_t
warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
Bug-AGL: SPEC-2535
Change-Id: I28330f92097adc6aa03480078d168d37a60fc051
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Use the BLUEZ_AT_DEVICE macro instead of explicit string
references.
Bug-AGL: SPEC-2361
Change-Id: I2e892a7b6e2d838765cfa12dadd970e34c2f5d86
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
To avoid memory leaks g_variant_unref() needs to be called on
dbus replies.
Bug-AGL: SPEC-2361
Change-Id: Ie8db961f182e77fe5a36c91acddff1e549e7f60a
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Use the BLUEZ_AT_DEVICE macro instead of explicit string
references.
Bug-AGL: SPEC-2361
Change-Id: Icddf5914433123e65d2a7d40629bab362b60c1c1
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Remove function prototype from bluetooth-common.h for the deleted
bluetooth-rfkill.c source file.
Change-Id: I2bc9e789868a01a0b62643b6406970c436308567
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
In order to upgrade to future versions easier don't use versioned
structs but the respective typedefs
Change-Id: Ic789dc7c74e0a2a1352effa1cfeea4998cbc56f3
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Report back property changes in the adapter_changes event, which is
required for detecting when an adapter is truly powered on.
Bug-AGL: SPEC-2295
Change-Id: I58441369277d2e778f2bb077e7b1be4aa3a3b1b4
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Previously org.bluez.MediaPlayer1 paths could only resolve to player0 but certain
phones request another instance for another application (e.g. player1).
This patchset changes the default media player path to last connected, and which
in theory should be from the media application in use on the phone. From limited
experiments not in use interfaces will be reaped shortly after going idle.
Bug-AGL: SPEC-2281
Change-Id: Id4bdc89cd395d5cd3ac043394761a95b306e5c6d
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
adapter_changes event allows clients to know when an adapter's status changes
as in addition or removal.
Bug-AGL: SPEC-1763
Change-Id: I7a442ece7cf6b508d6290130a939fccc1bddebb9
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-2047
Change-Id: I55a080af35dad1514ee0423eff80e65331891bc7
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Remove bluetooth-rfkill.c and replace with agl-service-network calls
which in turn allows ConnMan to correctly manage bluetooth rfkill state.
Bug-AGL: SPEC-2124
Change-Id: Ibe0460be0f29957f99ea06975a1fa12d01840080
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Allow clients to select what Bluetooth transport they want a discovery
scan to attempt to detect. This will improve scanning in for example
when a client only wants to detect bredr or ble devices .
Bug-AGL: SPEC-2094
Change-Id: I2a983f5243aefcb582a7476bbae34d6ba88c39a6
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
There is sometimes when you don't want AFB_ERROR to be displayed on a dbus
failure. Example would be in the initial autoconnect attempt on binding startup.
Don't display the AFB_ERROR if error pointer that is passed is NULL
Bug-AGL: SPEC-1630 SPEC-1986
Change-Id: I2bc1e8575037a8e84721d2c2c369a409986eda43
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Fix logic check and run g_variant_unref() on reply of dbus call
Bug-AGL: SPEC-1630
Change-Id: I7e89031d8cad64c3303227c0ec7fd85a6c85f0c3
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
To allow initial reporting of MediaTransport1 of audio transports
add them to the managed_objects verb.
Bug-AGL: SPEC-1630 SPEC-1986
Change-Id: Icc09ae063e5dfc52e5396b9ea7149178b1d8aaac
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-1630
Change-Id: I6ad1f85d4edc00239f891edf6994db416e8a2dbd
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Allow setting of default adapter for use by other verbs within
the binding. This allows to select an adapter on boards with more than one.
Bug-AGL: SPEC-1630
Change-Id: Iec77b0abaa9f4c092dc5c827522efb1744953fce
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Allow subscribers to connect/disconnect to a2dp/avrcp Bluetoothp profiles
Bug-AGL: SPEC-1630
Change-Id: I5c4c2a2f06636b2b74cb453a3af576beb8026ab1
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Report back MediaPlayer1 interface events for A2DP media playback
Bug-AGL: SPEC-1630
Change-Id: I777f19af2de247fe676d5bede4bacbbad8ca9844
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Since MediaPlayer1 controls are part of bluez it makes sense
to keep them here for now
Bug-AGL: SPEC-1630
Change-Id: Ia02341179a322082357b0e7eff07264e34197d57
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Attempt connection on each paired device till one is successful
on startup.
Bug-AGL: SPEC-1630
Change-Id: I213876f65528d0eaeaa5b55a745f541b286f26b5
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-1630
Change-Id: I615cbf19d180556b0650dbf6b5ba48848be49f97
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Don't send adapter name in 'device' parameter on removal of
bluetooth interface.
Bug-AGL: SPEC-1630
Change-Id: I15cb4dcc791d36beb8e8b41993644cad331d3cae
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Validate device input to filter out special characters being sent that
may cause the dbus call to hang or segfault.
Bug-AGL: SPEC-1630
Change-Id: I31aa458154c030181b905b7ccc9d6a8aa0f84ef0
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-1630
Change-Id: Iae18f069b7a8091331efda97a270b70d05de3e79
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Allow clients to request devices only with certain profile UUIDs to be
displayed in an discovery scan. This allows to filter out things like
location tokens, smart scales, and etc which can't possibly have a2dp
or hfp profiles for instance.
NOTE: This is a write only setting. In the future should be read/write
to see current discovery filters.
Bug-AGL: SPEC-1630
Change-Id: Ic8b18656f84ac8047b170d6e601fcc2e63786af0
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-1630
Change-Id: I8e55d273ab58992e6f6327523853c6d330505278
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Concatenate adapter and device parameters to return a bluez path for
usage within the binding's dbus calls.
Bug-AGL: SPEC-1630
Change-Id: I4c96fa48baaf12b23aac98ba35f1ca82f7005bcb
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
segfaults can happen if the dbus call reply fails but doesn't set a
GError.
Bug-AGL: SPEC-1630
Change-Id: I83ea2f7997a8fcef1cdd73a7df2cf9ad97e00d91
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
To allow this binding API to be bluetooth stack agnostic remove pure
bluez paths, and replace with generic fields.
Bug-AGL: SPEC-1630
Change-Id: Iadba73782b6339df2ca5937e16a654e7ef3e477b
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Possible to have an PropertiesChanged events that produces no changes
that are useful to report.
Bug-AGL: SPEC-1630
Change-Id: I09b25943e3676abd5dd0f1c8caa2c0a2414f409f
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Report API as 2.0 to middleware + application clients
Bug-AGL: SPEC-1630
Change-Id: I4ce889a06a0cd287af2d08068a59bbc7d359c20b
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|
|
Bug-AGL: SPEC-1630
Change-Id: I33cfec70283fa29f47b76f9e6be3e8e6cd6a2f54
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
|