summaryrefslogtreecommitdiff
path: root/android
Commit message (Collapse)AuthorAgeFilesLines
* build: Replace use of g_memdup with util_memdupLuiz Augusto von Dentz2022-01-066-45/+56
| | | | | | | | | | | This replaces the uses of g_memdup with util_memdup since the former has been deprecated: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations] g_memdup2 requires bumping glib version which would likely have its own problems thus why util_memdup was introduced.
* uinput: Remove local copy of uinput.hLuiz Augusto von Dentz2021-11-221-5/+3
| | | | | | | | | | uinput.h is part of kernel uapi nowadays so it can be included directly from linux/uinput.h which has a compatible definition with 32 bits systems: https://github.com/bluez/bluez/issues/84#issuecomment-942155841 Fixes: https://github.com/bluez/bluez/issues/84
* hciemu: Use vhci_open to instanciate a vhci btdevLuiz Augusto von Dentz2021-10-181-0/+2
| | | | | This makes use of vhci_open to isntanciate the vhci btdev since that has proper support for reading the index assigned to it.
* src: Inclusive language changesArchie Pusaka2021-09-211-1/+1
| | | | | | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", "accept list", and "reject list". Note that some suggestions come from https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf Also use "primary" to refer the global mgmt struct. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* emulator: Inclusive language changesArchie Pusaka2021-09-211-1/+1
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", and "accept list". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* btio: Inclusive language changesArchie Pusaka2021-09-211-1/+1
| | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL uses "central" as it is deemed to be more appropriate. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* lib: Inclusive language changesArchie Pusaka2021-09-211-2/+2
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", and "accept list". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* shared/util: use 64-bit bitmap in util_get/clear_uidPauli Virtanen2021-09-061-1/+1
| | | | | | | | | | | The util_get/clear_uid functions use int type for bitmap, and are used e.g. for SEID allocation. However, valid SEIDs are in range 1 to 0x3E (AVDTP spec v1.3, 8.20.1), and 8*sizeof(int) is often smaller than 0x3E. The function is also used in src/advertising.c, but an explicit maximum value is always provided, so growing the bitmap size is safe there. Use 64-bit bitmap instead, to be able to cover the valid range.
* android: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-21131-1653/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- Apache-2.0 : 80 LGPL-2.1-or-later : 42 GPL-2.0-or-later : 9 License: Apache-2.0 android/bluetoothd-wrapper.c android/tester-hidhost.c android/tester-map-client.c android/hal-audio-aptx.c android/hal-audio.c android/hal-handsfree-client.c android/tester-gatt.c android/hal-pan.c android/hal-socket.c android/tester-hdp.c android/tester-pan.c android/tester-avrcp.c android/hal-a2dp-sink.c android/hal-gatt.c android/hal-avrcp.c android/tester-a2dp.c android/hal-audio.h android/hal-bluetooth.c android/tester-socket.c android/hal-health.c android/hal-a2dp.c android/hal-ipc.c android/hal-avrcp-ctrl.c android/hal-sco.c android/hal-ipc.h android/tester-main.c android/hal-audio-sbc.c android/hal-utils.c android/hal-map-client.c android/hal-handsfree.c android/hal-log.h android/hal.h android/hal-utils.h android/tester-bluetooth.c android/hal-hidhost.c android/audio_utils/resampler.h android/audio_utils/resampler.c android/system/audio.h android/hardware/bt_sock.h android/hardware/bt_gatt_client.h android/hardware/bt_hh.h android/hardware/bluetooth.h android/hardware/hardware.h android/hardware/bt_hf_client.h android/hardware/bt_rc.h android/hardware/bt_hf.h android/hardware/bt_pan.h android/hardware/bt_gatt_types.h android/hardware/hardware.c android/hardware/audio_effect.h android/hardware/audio.h android/hardware/bt_gatt_server.h android/hardware/bt_gatt.h android/hardware/bt_hl.h android/hardware/bt_mce.h android/hardware/bt_av.h android/client/if-hh.c android/client/if-sco.c android/client/pollhandler.h android/client/haltest.c android/client/tabcompletion.c android/client/if-hf-client.c android/client/history.h android/client/if-audio.c android/client/terminal.h android/client/if-av.c android/client/if-main.h android/client/if-av-sink.c android/client/terminal.c android/client/if-mce.c android/client/if-hf.c android/client/pollhandler.c android/client/if-sock.c android/client/if-rc-ctrl.c android/client/if-rc.c android/client/history.c android/client/if-pan.c android/client/if-gatt.c android/client/if-bt.c android/client/if-hl.c License: LGPL-2.1-or-later android/sco.h android/socket.c android/tester-main.h android/hidhost.h android/map-client.h android/utils.h android/hal-msg.h android/health.h android/avrcp-lib.c android/bluetoothd-snoop.c android/a2dp.c android/bluetooth.h android/a2dp-sink.c android/handsfree-client.c android/audio-msg.h android/main.c android/pan.c android/ipc-tester.c android/health.c android/socket.h android/handsfree.h android/avrcp-lib.h android/a2dp-sink.h android/system-emulator.c android/gatt.c android/avrcp.h android/pan.h android/test-ipc.c android/hidhost.c android/a2dp.h android/avrcp.c android/sco-msg.h android/bluetooth.c android/map-client.c android/handsfree-client.h android/ipc.c android/handsfree.c android/gatt.h android/ipc.h android/ipc-common.h android/compat/wordexp.h android/cutils/properties.h License: GPL-2.0-or-later android/avdtp.h android/avctp.c android/avdtptest.c android/sco.c android/log.c android/avdtp.c android/avctp.h android/compat/readline/history.h android/compat/readline/readline.h
* lib: Move HOG UUID definitionManish Mandlik2020-06-161-2/+0
| | | | | HOG UUID is defined at multiple places in the code. Move that definition to lib/uuid.h where all other UUIDs are defined.
* tools/l2cap-tester: Add test for waiting disconnection responseArchie Pusaka2020-06-041-1/+1
| | | | | | This is to test the behaviour of L2CAP channel when closed with shut_down(sock, SHUT_WR). In this case, we should wait until we receive a disconnection response before raising G_IO_HUP.
* android: Fix build with GCC 10Szymon Janc2020-04-201-2/+2
| | | | | | status and state are used to hold various enum types depending on test and callback passed. Define them as int to avoid warnings about enum assignment from invalid type.
* android/handsfree: Fix unaligned struct accessBastien Nocera2019-05-131-1/+3
| | | | | | | android/handsfree.c: In function ‘bt_sco_get_fd’: android/handsfree.c:2913:47: error: taking address of packed member of ‘struct sco_rsp_get_fd’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 2913 | if (!dev || !bt_sco_get_fd_and_mtu(sco, &fd, &rsp.mtu)) | ^~~~~~~~
* android/hal-bluetooth: Fix unaligned struct accessBastien Nocera2019-05-131-1/+3
| | | | | | | android/hal-bluetooth.c: In function ‘set_adapter_property’: android/hal-bluetooth.c:659:46: error: taking address of packed member of ‘struct hal_cmd_set_adapter_prop’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 659 | adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val); | ^~~~~~~~~
* android/avrcp-lib: Fix unaligned struct accessBastien Nocera2019-05-131-4/+5
| | | | | | | android/avrcp-lib.c: In function ‘get_element_attributes’: android/avrcp-lib.c:967:24: error: taking address of packed member of ‘struct get_element_attributes_req’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 967 | if (!parse_attributes(* (&req->attrs), params_len - sizeof(*req), | ^~~~~~~~~~~~~~~
* a2dp-codecs: Fix SBC_MAX_BITPOOL and add SBC quality modesPali Rohár2019-01-311-3/+3
| | | | | | | | | | | | | According to A2DP specification; section SBC; Codec Specific Information Elements; Minimum / Maximum Bitpool Value, range for Bitpool value is from 2 to 250. A2DP specification also defines bitpool values for two SBC modes: Middle Quality and High Quality. They depends on channel mode and frequency. So add definitions for them into a2dp-codecs file too. File android/hal-audio-sbc.c was updated to use High Quality mode for chosen frequency.
* a2dp-codecs: Define a2dp_vendor_codec_t struct in endian neutral wayPali Rohár2018-12-283-18/+14
| | | | | | And define new macros A2DP_GET_VENDOR_ID(), A2DP_GET_CODEC_ID() and A2DP_SET_VENDOR_ID_CODEC_ID() for easily filling a2dp_vendor_codec_t struct.
* a2dp-codecs: Add SBC prefix for MIN/MAX_BITPOOL constantsPali Rohár2018-12-281-6/+6
| | | | Those two constants are SBC codec specific.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-0649-6/+54
|
* shared/mainloop: Remove mainloop_set_signalLuiz Augusto von Dentz2018-12-052-17/+2
| | | | | This removes mainloop_set_signal and replaces it usage with mainloop_run_with_signal.
* build: make building with --coverage work againJan Engelhardt2018-11-291-2/+2
| | | | | | | | | | | | | | | When `./configure --enable-coverage` is given and lcov is present, MISC_CFLAGS and MISC_LDFLAGS will be set to --coverage. However, 1. obexd uses per-target LDFLAGS and, in doing so, forget to re-mention $(AM_LDFLAGS). This problem existed for a long time. 2. obexd uses per-target CFLAGS and, in doing so, forgot to re-mention $(AM_CFLAGS). This got broken in 06dbb223fbe50acc48b3ba1d33cb424275b4baaa. This led to no --coverage showing up in the linker line for obexd, causing a link failure indicating unresolved symbols like __gcov_exit.
* build: -D/-I arguments go into CPPFLAGSJan Engelhardt2018-11-261-7/+7
| | | | | | | | | -D and -I are preprocessor directives, they are therefore to appear in CPPFLAGS, not CFLAGS. (It is unfortunate that pkg-config does not make the distinction / or it was misnamed, because only -D/-I make sense to be emitted by pkg-config in the first place — anything else (-f/-m) has the potential to mess up someone's compilation. So pkg-config's Cflags is actually used to convery Cppflags.)
* build: -l arguments to belong into LDADD/LIBADD not LDFLAGSJan Engelhardt2018-11-261-7/+8
| | | | | | It is an error to put -l arguments into LDFLAGS, because the linker command line is order-sensitive and libs must appear in certain places. For this, automake has the LDADD/LIBADD.
* build: change @foo@ to $(foo) in automake makefilesJan Engelhardt2018-11-261-9/+9
| | | | | | When using automake, all AC_SUBSTed variables are made available as make variables, so that they can also be set at make time. Therefore, they need not use the @harcoded@ style.
* log: Use shared log codeLuiz Augusto von Dentz2018-11-202-0/+2
| | | | Use bt_log_* to send messages to the logging channel.
* android: Fix some compilation warningsSzymon Janc2018-05-253-5/+5
|
* android/client: Fix compilation with GCC 8Szymon Janc2018-05-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | CC android/client/android_haltest-if-gatt.o android/client/if-gatt.c: In function ‘multi_adv_set_inst_data_p’: android/client/if-gatt.c:2034:7: error: ‘set_scan_rsp’ may be used uninitialized in this function [-Werror=maybe-uninitialized] EXEC(if_gatt->client->multi_adv_set_inst_data, client_if, set_scan_rsp, ^~~~~~~ android/client/if-gatt.c:2034:7: error: ‘include_name’ may be used uninitialized in this function [-Werror=maybe-uninitialized] android/client/if-gatt.c:2034:7: error: ‘include_txpower’ may be used uninitialized in this function [-Werror=maybe-uninitialized] android/client/if-gatt.c: In function ‘set_adv_data_p’: android/client/if-gatt.c:1859:7: error: ‘set_scan_rsp’ may be used uninitialized in this function [-Werror=maybe-uninitialized] EXEC(if_gatt->client->set_adv_data, client_if, set_scan_rsp, ^~~~~~~ android/client/if-gatt.c:1859:7: error: ‘include_name’ may be used uninitialized in this function [-Werror=maybe-uninitialized] android/client/if-gatt.c:1859:7: error: ‘include_txpower’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors make[1]: *** [Makefile:6431: android/client/android_haltest-if-gatt.o] Error 1 make: *** [Makefile:3262: all] Error 2
* android: Fix a few compiler warningsMarcel Holtmann2018-05-242-3/+8
|
* tools: Add initial code for btmon-loggerSzymon Janc2018-04-241-1/+1
| | | | | | This is intended for use for automated logging or unatrended systems. It doesn't contain any packet decoding functionality which results in much smaller binary.
* android/tester: Fix race in discovering devicesSzymon Janc2017-12-222-81/+125
| | | | | | This makes sure that emulated device starts advertising only after discovery is ongoing and that tests go further only after device was found. Otherwise tests were randomly failing.
* android/tester: Clarify default properties match namesSzymon Janc2017-12-221-9/+9
|
* android/tester: Fix remote advertising dataSzymon Janc2017-12-211-2/+1
| | | | | Advertising Data doesn't have terminator field like EIR. This was causing error logs from kernel when data length was corrected.
* android: Enable multiadvertisingMartin Fuzzey2017-11-064-10/+454
| | | | | | | This is required for custom advertising data. The HAL entry points related to multiadvertising are now implemented and map to the mgmnt "add advertising" operation.
* android: Get max advertising instances from kernelMartin Fuzzey2017-11-061-1/+43
| | | | | Use the mgmnt "advinfo" operation to obtain the number of advertising instances supported by the kernel.
* android: Skip key loading for LE only devices.Martin Fuzzey2017-11-061-1/+5
| | | | Key loading is not supported for LE only devices.
* android: Add missing fall through declarationMarcel Holtmann2017-07-111-0/+1
|
* input/hog-lib: Add support to gatt-dbLuiz Augusto von Dentz2016-12-291-0/+4
| | | | | | This add support of passing a gatt-db to avoid having to discover the services again, this should also make it easier to port to bt_gatt_client once Android code support it.
* shared/btsnoop: Add support for providing cumulative drops countJohan Hedberg2016-05-041-1/+1
|
* monitor/a2dp: Decode SBC capabilitiesAndrzej Kaczmarek2015-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > ACL Data RX: Handle 256 flags 0x02 dlen 20 [hci0] 9.242155 Channel: 66 len 16 [PSM 25 mode 0] {chan 2} AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0 Service Category: Media Transport (0x01) Service Category: Media Codec (0x07) Media Type: Audio (0x00) Media Codec: SBC (0x00) Frequency: 0x30 44100 48000 Channel Mode: 0x0f Mono Dual Channel Stereo Joint Channel Block Length: 0xf0 4 8 12 16 Subbands: 0x0c 4 8 Allocation Method: 0x03 SNR Loudness Minimum Bitpool: 2 Maximum Bitpool: 53 Service Category: Content Protection (0x04) Content Protection Type: SCMS-T (0x0002) < ACL Data TX: Handle 256 flags 0x00 dlen 18 [hci0] 9.272120 Channel: 258 len 14 [PSM 25 mode 0] {chan 2} AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp 0 ACP SEID: 1 INT SEID: 3 Service Category: Media Transport (0x01) Service Category: Media Codec (0x07) Media Type: Audio (0x00) Media Codec: SBC (0x00) Frequency: 44100 (0x20) Channel Mode: Joint Channel (0x01) Block Length: 16 (0x10) Subbands: 8 (0x04) Allocation Method: Loudness (0x01) Minimum Bitpool: 2 Maximum Bitpool: 53
* monitor/avdtp: Add basic decoding of AVDTP signallingAndrzej Kaczmarek2015-12-011-0/+1
| | | | | | | | | | < ACL Data TX: Handle 256 flags 0x00 dlen 6 Channel: 258 len 2 [PSM 25 mode 0] {chan 2} AVDTP: Discover (0x01) Command (0x00) type 0x00 label 0 nosp 0 > ACL Data RX: Handle 256 flags 0x02 dlen 14 Channel: 66 len 10 [PSM 25 mode 0] {chan 2} AVDTP: Discover (0x01) Response Accept (0x02) type 0x00 label 0 nosp 0 04 08 14 08 0c 08 08 08 ........
* android/README: Fix typoAndrzej Kaczmarek2015-11-131-1/+1
|
* android/README: Update links to BfA on GitHubAndrzej Kaczmarek2015-11-131-11/+11
| | | | | Since code.google.com is now read-only, sample implementation of BfA is moved to GitHub. README is updated with new links.
* hog: Move code from android to profilesLuiz Augusto von Dentz2015-11-135-1578/+4
| | | | | This is a place holder until the code is ported to use shared API so it can be shared by android and D-Bus daemon.
* dis: Move code from android to profilesLuiz Augusto von Dentz2015-11-135-335/+4
| | | | | This is a place holder until the code is ported to use shared API so it can be shared by android and D-Bus daemon.
* scpp: Move code from android to profilesLuiz Augusto von Dentz2015-11-135-393/+4
| | | | | This is a place holder until the code is ported to use shared API so it can be shared by android and D-Bus daemon.
* bas: Move code from android to profilesLuiz Augusto von Dentz2015-11-135-375/+3
| | | | | This is a place holder until the code is ported to use shared API so it can be shared by android and D-Bus daemon.
* android/hog: Port fixes to profiles HoGLuiz Augusto von Dentz2015-11-131-1/+26
| | | | | | | | This align the 2 copies of Hog since the plan is to merge android version back to profiles and just reuse from there. The fix for incomplete discover is modified so the reports are keep while attempting to discover.
* android/log: Fix compilation error in AOSPAndrzej Kaczmarek2015-11-121-1/+1
| | | | btd_debug() has new parameter introduced in dcfdc556.
* btsnoop: Update file format identifiers for trace filesMarcel Holtmann2015-11-081-1/+1
|
* android: Remove dead codeSzymon Janc2015-10-3020-538/+67
| | | | | This removes dead code due to memory allocation with new0 not being able to fail.