summaryrefslogtreecommitdiff
path: root/emulator/bthost.c
Commit message (Collapse)AuthorAgeFilesLines
* tools/iso-tester: Add Broadcast tests for encrypted BIGIulia Tanasescu2023-04-191-1/+4
| | | | | | | This adds the following tests for encrypted broadcast: ISO Broadcaster Encrypted - Success ISO Broadcaster Receiver Encrypted - Success
* Split bt_iso_qos into dedicated structuresIulia Tanasescu2023-03-311-14/+17
| | | | | Split bt_iso_qos into dedicated unicast and broadcast structures and add additional broadcast parameters.
* bthost: Allow sending ISO packets with sequence number and timestampPauli Virtanen2023-02-271-13/+32
| | | | | | | | Change bthost_send_iso to take packet sequence number and timestamp, and allow it to send timestamped HCI ISO data packets. Currently, btdev passes through ISO packets, so this can also be used to test RX timestamping.
* bthost: Add callback to accept ISO connectionsLuiz Augusto von Dentz2022-12-061-3/+18
| | | | | This enables setting an accept callback which can return reject reason if the connection shall not be accepted.
* bthost: Add destroy callback to bthost_add_iso_hookLuiz Augusto von Dentz2022-08-221-1/+7
| | | | | This adds a destroy callback to bthost_add_iso_hook so its user can detect when the hook is freed when the connection is disconnected.
* bthost: Add qos support to bthost_set_cig_paramsLuiz Augusto von Dentz2022-08-051-11/+15
| | | | This enables setting QoS other then the mandatory 16_2_1.
* bthost: Fix not setting all parameters when using Create BIG cmdLuiz Augusto von Dentz2022-04-141-1/+4
| | | | Create BIG shall set proper values for interval, latency, rtn and phy.
* bthost: Add support for Create CISLuiz Augusto von Dentz2022-04-141-0/+42
| | | | This introduces bthost_set_cig_params and bthost_create_cis.
* bthost: Add support for Create BIGLuiz Augusto von Dentz2022-03-071-0/+13
| | | | This adds bthost_create_big
* bthost: Add support for Periodic AdvertisingLuiz Augusto von Dentz2022-03-071-0/+23
| | | | This adds bthost_set_pa_params and bthost_set_pa_enable.
* bthost: Add support for BT_H4_ISO_PKTLuiz Augusto von Dentz2022-03-071-42/+314
| | | | This adds sending and receiving BT_H4_ISO_PKT packets.
* bthost: Increase number of creditsLuiz Augusto von Dentz2022-02-091-1/+1
| | | | | This increase the number of credits so bigger packets can be sent by the likes of rfcomm-tester.
* bthost: Fix length calculation for RFCOMM headerLuiz Augusto von Dentz2022-02-091-3/+10
| | | | | This fixes the length calculation for large packets that requires more than 1 byte.
* bthost: Fix not handling ACL fragmentationLuiz Augusto von Dentz2022-02-091-21/+100
| | | | | Large packets requires the support of ACL fragmentation in order to be properly processed.
* emulator: Fix uninitiailzed scalar variableTedd Ho-Jeong An2021-11-151-0/+3
| | | | | This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan.
* emulator: bthost: Add support LE Ext Adv ReportTedd Ho-Jeong An2021-10-251-0/+118
| | | | This patch adds support LE_Extended_Advertising_Report Eevnt in bthost.
* bthost: Fix not initializing address types properlyLuiz Augusto von Dentz2021-08-131-6/+12
| | | | | | | | | | The address type given to the init_conn is the peer address type (btdev) not the bthost address type, the old code assume it could use since only BDADDR_BREDR or BDADDR_LE_PUBLIC was tested but with the upcoming support for LL Privacy the peer address type would become BDADDR_LE_RANDOM which cannot be used as address type of bthost as that doesn't support random addresses and would likely cause SMP to fail when pairing.
* bthost: Add bthost_debug and use it on smp.cLuiz Augusto von Dentz2021-08-121-23/+27
| | | | | This adds bthost_debug which wraps util_debug and make use of it in smp.c.
* emulator/bthost: Create ext adv params before setting adv dataTedd Ho-Jeong An2021-06-231-6/+20
| | | | | | | Based on the SPEC 5.2 Vol 4, Part E, Section 7.8.54, the LE_Set_Extended_Advertising_Data_Command may be issued after an advertising set identifed by the Advertising_Handle has been created using the HCI_LE_Set_Extended_Advertising_Parameters command.
* bthost: Add support for address types other then publicLuiz Augusto von Dentz2020-12-171-2/+7
| | | | | This properly initialize the address type according to the connection address.
* bthost: Fix sending uninitilized dataLuiz Augusto von Dentz2020-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syscall param writev(vector[...]) points to uninitialised byte(s) at 0x4A8A497: writev (in /usr/lib64/libc-2.31.so) by 0x1365C1: send_packet (bthost.c:509) by 0x1365C1: send_packet (bthost.c:492) by 0x1365C1: next_cmd (bthost.c:737) by 0x137578: evt_cmd_complete (bthost.c:882) by 0x137578: process_evt (bthost.c:1343) by 0x137578: bthost_receive_h4 (bthost.c:2414) by 0x12DF49: receive_bthost.part.0 (hciemu.c:134) by 0x48B978E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x48B9B17: ??? (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x48B9E32: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x14A664: mainloop_run (mainloop-glib.c:66) by 0x14AA41: mainloop_run_with_signal (mainloop-notify.c:188) by 0x149A7B: tester_run (tester.c:871) by 0x129C77: main (mgmt-tester.c:10219) Address 0x4c48c05 is 21 bytes inside a block of size 280 alloc'd at 0x483CAE9: calloc (vg_replace_malloc.c:760) by 0x136487: queue_command (bthost.c:472) by 0x136487: send_command (bthost.c:715) by 0x13948A: bthost_set_ext_adv_enable (bthost.c:2581) by 0x12CEBF: trigger_device_found (mgmt-tester.c:8513) by 0x148C9A: wait_callback (tester.c:749) by 0x48BA330: ??? (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x48B978E: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x48B9B17: ??? (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x48B9E32: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.6400.6) by 0x14A664: mainloop_run (mainloop-glib.c:66) by 0x14AA41: mainloop_run_with_signal (mainloop-notify.c:188) by 0x149A7B: tester_run (tester.c:871)
* bthost: Fix running request callbacks for remote requestsLuiz Augusto von Dentz2020-11-131-2/+30
| | | | | | Ident are only unique per request/response pair so if a remote request is initiated we shall not attempt to run the callback even if the ident matches.
* emulator/bthost: Add support for LE CIS RequestLuiz Augusto von Dentz2020-11-021-0/+18
| | | | This enables bthost to act as acceptor of LE CIS Request.
* emulator/bthost: Add debug supportLuiz Augusto von Dentz2020-11-021-10/+63
| | | | | This adds bthost_set_debug which can be used to debug internals of bthost.
* emulator: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- LGPL-2.1-or-later : 20 GPL-2.0-or-later : 2 License: LGPL-2.1-or-later emulator/server.c emulator/amp.c emulator/hciemu.c emulator/vhci.c emulator/btdev.c emulator/serial.h emulator/le.h emulator/le.c emulator/main.c emulator/amp.h emulator/hciemu.h emulator/bthost.h emulator/btdev.h emulator/vhci.h emulator/serial.c emulator/phy.c emulator/smp.c emulator/phy.h emulator/bthost.c emulator/server.h License: GPL-2.0-or-later emulator/b1ee.c emulator/hfp.c
* tools/l2cap-tester: Add test for waiting disconnection responseArchie Pusaka2020-06-041-1/+16
| | | | | | 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.
* emulator/bthost: Add support for ECRED Connection request/responseLuiz Augusto von Dentz2020-03-301-0/+72
| | | | | This adds support for ECRED Connection request/response which will be used by l2cap-runner to test L2CAP_MODE_EXT_FLOWCTL mode.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-0/+1
|
* emulator: Add 5.0 feature supportJaganath Kanakkassery2018-06-181-0/+99
| | | | | This adds new hciemu for BT 5.0. Also adds extended advertising, scanning and connection support in btdev and bthost
* emulator: Include Link Key in key distribution if BR/EDR is supportedJohan Hedberg2016-06-071-0/+5
|
* emulator: Fix sending valid HCI_LE_Create_Connection parametersJohan Hedberg2015-11-121-0/+6
|
* emulator/bthost: Add support for setting custom ADV dataSzymon Janc2015-05-171-18/+17
| | | | This allows to set any ADV data and not just flags.
* emulator: Add support for LE remote features commandMarcel Holtmann2015-04-081-0/+15
|
* emulator: Handle event for LE connection update complete indicationMarcel Holtmann2015-04-011-0/+15
|
* emulator/bthost: Fix calling RFCOMM callback for zero-length dataJohan Hedberg2015-02-271-10/+14
|
* emulator: Use local includes for libbluetooth headersMarcel Holtmann2015-02-121-1/+1
|
* emulator: Fix L2CAP & RFCOMM state changesJohan Hedberg2015-01-231-9/+14
| | | | | | | | | We should only move to do RFCOMM operations once we exist the CONFIG state. This means not doing anything if we get a "pending" response and moving to RFCOMM only once the config req/rsp messages are exchanged. This patch still isn't a "complete" fix in that it only waits for a response to our config request, but it's good enough for now and makes the RFCOMM server tests in rfcomm-tester pass again.
* emulator/bthost: Add support for triggering SMP over BR/EDRJohan Hedberg2015-01-071-0/+13
|
* emulator/bthost: Add support for requesting L2CAP fixed channelsJohan Hedberg2015-01-071-0/+40
|
* emulator: Add SMP over BR/EDR supportJohan Hedberg2014-12-171-1/+4
|
* emulator: Fix Write_LE_Host_Supported command sendingJohan Hedberg2014-12-171-1/+7
|
* emulator: Improve L2CAP info request support in bthostJohan Hedberg2014-12-171-5/+36
|
* emulator: Track LE enable status in bthostJohan Hedberg2014-12-171-0/+2
|
* emulator: Avoid 'unknown command' for user confirm req neg replyJohan Hedberg2014-12-171-0/+2
|
* emulator: Provide API to enable LE host supportJohan Hedberg2014-12-171-0/+7
|
* emulator: Avoid 'unknown command' for HCI_Write_Secure_Conn_Support completionJohan Hedberg2014-12-171-0/+2
|
* emulator/bthost: Add API to wait for bthost readinessJohan Hedberg2014-12-031-0/+19
|
* emulator/bthost: Add API to enable SC supportJohan Hedberg2014-12-031-2/+27
|
* emulator/bthost: Remove empty bthost_stop functionSzymon Janc2014-11-041-4/+0
|
* emulator/bthost: Move smp_start to bthost_createSzymon Janc2014-11-041-6/+8
| | | | | | This creates smp while creating bthost allowing for early bailout if kernel doesn't support crypto. Fix crash if smp_start failed due to SMP code always assuming valid pointer.