summaryrefslogtreecommitdiff
path: root/profiles/health
Commit message (Collapse)AuthorAgeFilesLines
* build: Fix errors with glibc < 2.25Fabrice Fontaine2022-02-152-5/+5
| | | | | | | | | | | | | | | | | | getrandom and sys/random.h are only available since glibc 2.25: https://www.gnu.org/software/gnulib/manual/html_node/sys_002frandom_002eh.html resulting in the following build failures since version 5.63 and https://git.kernel.org/pub/scm/bluetooth/bluez.git/log/?qt=grep&q=getrandom: plugins/autopair.c:20:24: fatal error: sys/random.h: No such file or directory #include <sys/random.h> ^ To fix this build failure, add util_getrandom and a fallback (borrowed from pipewire and licensed under MIT): https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/utils.c Fixes: - http://autobuild.buildroot.org/results/6b8870d12e0804d6154230a7322c49416c1dc0e2
* profiles: Fix the reusing gerror without re-initializationTedd Ho-Jeong An2022-02-111-3/+3
| | | | | | | | | | | | When the GError variable is freeed with g_error_free(), it is not set to NULL and reusing the same variable again can cause the seg_fault because it is still pointing the old memory address which is freed. This patch relaces the g_error_free() to g_clear_error() which frees the variable and set it to NULL if the variable is used in the function again. Fixes: 4ad622d592ba5 ("profiles/a2dp: Fix unchecked return value")
* profiles/health: Replace random number generation functionTedd Ho-Jeong An2021-12-082-6/+22
| | | | | | | | This patch replaces the rand() function to the getrandom() syscall. It was reported by the Coverity scan rand() should not be used for security-related applications, because linear congruential algorithms are too easy to break
* profiles: Inclusive language changesArchie Pusaka2021-09-212-11/+11
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central" and "peripheral". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* profiles: Use timeout_add_secondsFrédéric Danis2021-03-162-18/+19
| | | | | Replace calls to g_timeout_add_seconds() by the timeout_add_seconds() wrapper which takes care of 0 delay.
* profiles: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-2110-140/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- GPL-2.0-or-later : 72 LGPL-2.1-or-later : 6 License: GPL-2.0-or-later profiles/deviceinfo/dis.c profiles/deviceinfo/deviceinfo.c profiles/health/hdp_types.h profiles/health/mcap.c profiles/health/hdp_manager.c profiles/health/hdp_main.c profiles/health/mcap.h profiles/health/hdp_util.h profiles/health/hdp_manager.h profiles/health/hdp_util.c profiles/health/hdp.c profiles/health/hdp.h profiles/network/server.c profiles/network/connection.h profiles/network/connection.c profiles/network/manager.c profiles/network/bnep.c profiles/network/server.h profiles/network/bnep.h profiles/battery/battery.c profiles/cups/cups.h profiles/cups/sdp.c profiles/cups/main.c profiles/cups/spp.c profiles/cups/hcrp.c profiles/scanparam/scpp.c profiles/scanparam/scan.c profiles/audio/transport.h profiles/audio/avdtp.h profiles/audio/source.c profiles/audio/player.c profiles/audio/avctp.c profiles/audio/control.h profiles/audio/a2dp.c profiles/audio/source.h profiles/audio/transport.c profiles/audio/sink.c profiles/audio/avrcp.h profiles/audio/avdtp.c profiles/audio/a2dp.h profiles/audio/avrcp.c profiles/audio/media.h profiles/audio/avctp.h profiles/audio/control.c profiles/audio/sink.h profiles/audio/player.h profiles/audio/media.c profiles/sap/server.c profiles/sap/sap-dummy.c profiles/sap/main.c profiles/sap/sap.h profiles/sap/manager.c profiles/sap/server.h profiles/sap/manager.h profiles/iap/main.c profiles/gap/gas.c profiles/midi/midi.c profiles/midi/libmidi.c profiles/midi/libmidi.h profiles/input/server.c profiles/input/suspend.h profiles/input/uhid_copy.h profiles/input/device.c profiles/input/hog.c profiles/input/device.h profiles/input/hidp_defs.h profiles/input/manager.c profiles/input/suspend-none.c profiles/input/sixaxis.h profiles/input/hog-lib.c profiles/input/suspend-dummy.c profiles/input/server.h License: LGPL-2.1-or-later profiles/deviceinfo/dis.h profiles/battery/bas.h profiles/battery/bas.c profiles/scanparam/scpp.h profiles/audio/a2dp-codecs.h profiles/input/hog-lib.h
* health: Fix use of L2CAP modes with bt_ioLuiz Augusto von Dentz2020-06-082-10/+10
| | | | | bt_io modes are no longer compatible with L2CAP modes so the later shall not used with bt_io APIs.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-063-2/+6
|
* health: Fix compiler warning from casting functionsMarcel Holtmann2018-05-241-5/+16
|
* health: Fix compiler warning from casting functionsMarcel Holtmann2018-05-231-2/+12
|
* profiles: Fix includes for gdbus.h headerMarcel Holtmann2015-03-011-2/+2
|
* profiles: Use local libbluetooth includesMarcel Holtmann2015-02-282-12/+9
|
* profiles: Use local libbluetooth includesMarcel Holtmann2015-02-281-3/+6
|
* profiles: List all enum values in switchSzymon Janc2014-12-081-0/+1
| | | | As described in coding style M10.
* health: Keep struct element indentions consistGrzegorz Kolodziejczyk2014-11-021-6/+6
| | | | Indentions should be tabbed to keep consist with other structs.
* mcap: Rename mcap-lib to mcapRavi kumar Veeramally2014-10-024-3/+3
|
* mcap: Unify libmcap usage for Android and non-Android versionsRavi kumar Veeramally2014-10-028-1567/+1457
| | | | | Now profiles/health/ , android/health and mcaptest will use profiles/health/mcap-lib.
* health: Use proper type for tidSzymon Janc2014-09-241-1/+1
| | | | | | | | | | | | tid holds glib source id and should be of guint type. This fix following compilation error with musl: CC profiles/health/bluetoothd-hdp.o profiles/health/hdp.c:84:2: error: unknown type name 'uint' uint tid; /* echo timeout */ ^ Please enter the commit message for your changes. Lines starting
* HDP: Fix adding missing breaksAndrei Emeltchenko2014-06-301-0/+2
|
* HDP: Fix NULL checkAndrei Emeltchenko2014-06-251-1/+1
| | | | Improves readability of the code using similar check for not NULL.
* HDP: trivial: Remove empty linesAndrei Emeltchenko2014-06-251-2/+0
|
* HDP: Fix possible memory leakAndrei Emeltchenko2014-06-251-7/+9
|
* mcap: Fix possible overflowAndrei Emeltchenko2014-06-251-1/+1
|
* HDP: Fix checking always constant error codeAndrei Emeltchenko2014-06-251-5/+2
| | | | | Function sdp_set_add_access_protos() always returns 0, so there is no sense to check for error code.
* HDP: Fix checking always constant error codeAndrei Emeltchenko2014-06-251-4/+1
| | | | | sdp_set_access_protos() always returns 0, there is no sense to check for error code. Fixes compile warnings.
* HDP: Remove extra debug statementsAndrei Emeltchenko2014-06-251-9/+11
| | | | DBG() includes function name by default, so including it is not needed.
* HDP: Add length checkAndrei Emeltchenko2014-06-181-0/+3
| | | | | Fixes static analyzer warnings related to casting possible error code to unsigned.
* HDP: trivial: Make code more readableAndrei Emeltchenko2014-06-181-1/+1
|
* profiles/health/hdp: Fix memory leak in SDP record preparationRavi kumar Veeramally2014-06-171-0/+2
| | | | | | | | | | | | | | | | | | | Sdp record preparation part is copied to android/health.c from profiles/health/hdp_utils.c. Memory leak is noticed while testing. Memory summay is from android daemon, but code snippet is same. It is already fixed in android/health.c while submitting android related patches. ==12515== 286 (16 direct, 270 indirect) bytes in 1 blocks are definitely lost in loss record 158 of 165 ==12515== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==12515== by 0x44AC45: sdp_list_append (sdp.c:1743) ==12515== by 0x4398F9: register_features (health.c:381) ==12515== by 0x4091CC: queue_foreach (queue.c:219) ==12515== by 0x43A31F: bt_health_mdep_cfg_data (health.c:398) ==12515== by 0x418B50: cmd_watch_cb (ipc.c:144) ==12515== by 0x4E7FCE4: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0) ==12515== by 0x4E80047: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0) ==12515== by 0x4E80309: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0) ==12515== by 0x4044F2: main (main.c:538)
* HDP: Set error message on error conditionAndrei Emeltchenko2014-06-131-1/+4
| | | | | | | | | | | Fixes clang warning: ... CC profiles/health/bluetoothd-hdp.o profiles/health/hdp.c:1778:13: warning: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'gerr') "%s", gerr->message); ^~~~~~~~~~~~~ ...
* HDP: trivial: Fix redundant debug printAndrei Emeltchenko2014-06-131-1/+2
|
* health: Fix HealthDevice dbus registrationAndre Guedes2014-02-171-1/+2
| | | | For some reason, HealthDevice property table wasn't been registered.
* profiles: Make btio/btio.h include localMarcel Holtmann2014-01-254-4/+5
|
* profiles: Use full include path for header filesMarcel Holtmann2014-01-256-28/+31
|
* health: Remove useless define for hton64Marcel Holtmann2014-01-241-2/+0
|
* Rename glib-helper to uuid-helperJohan Hedberg2014-01-212-2/+2
|
* core: Add flags parameter to bt_search_serviceSzymon Janc2014-01-201-3/+3
| | | | This allows to pass custom SDP flags to sdp_connect.
* health: Fix struct mcap_csp "csp_req" field typeAnderson Lizardo2014-01-061-1/+1
| | | | | | | | | | The values to which this field is set have nothing to do with MCAPCtrl. Fixes clang error: profiles/health/mcap_sync.c:767:24: error: comparison of constant 17 with expression of type 'MCAPCtrl' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
* Rename adapter_get_address to btd_adapter_get_addressSzymon Janc2013-11-272-5/+7
| | | | Allow this symbol to be exported and usable from external plugins.
* Rename adapter_get_device to btd_adapter_get_deviceSzymon Janc2013-11-271-2/+2
| | | | Allow this symbol to be exported and usable from external plugins.
* adapter: Handle removing of SDP recordsSzymon Janc2013-09-232-2/+3
| | | | | Make adapter in charge of updating SDP database. This allow to decouple SDP of code used for notifying adapters about SDP database change.
* adapter: Handle adding new SDP recordsSzymon Janc2013-09-231-2/+1
| | | | | Make adapter in charge of updating SDP database. This allow to decouple SDP of code used for notifying adapters about SDP database change.
* health: Get rid of gintLucas De Marchi2013-05-014-14/+14
| | | | | Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
* profile: Use btd_service for probing profilesMikel Astiz2013-04-261-2/+7
| | | | | | | | | | | | | | Change the profile probe mechanism in order to pass the btd_service instance representing the remote service. This object is bound to a btd_profile and a btd_device, thus replacing the previous parameters. The probe callback is allowed to hold a reference to the btd_service by means of btd_service_ref(), which should be unreferenced during removal. Keeping such a reference of the btd_service allows supporting multiple instances of the same UUID, since the reference can serve as a handle during the interactions between the profile implementation and the core.
* profile: Remove UUID list from probe functionMikel Astiz2013-04-261-2/+1
| | | | | | Each instance of btd_profile is associated to one single remote UUID and therefore the list provided by the callback is redundant and can be removed.
* profile: Limit to one remote UUID per profileMikel Astiz2013-03-101-2/+2
| | | | | The code can be considerably simplified by constraining struct btd_profile to one single remote UUID.
* health: Split health into two btd_profileMikel Astiz2013-03-101-5/+15
| | | | Register a separate btd_profile for each health device role.
* health: Update to new adapter_get_device APIJohan Hedberg2013-01-251-3/+1
|
* health: Fix possible use after freeSyam Sidhardhan2013-01-221-1/+1
| | | | | A pointer to freed memory is dereferenced if we call function hdp_get_dcpsm_cb() with out any earlier reference.
* profiles: Fix includes for uuid.hMarcel Holtmann2013-01-092-4/+4
|