Commit Graph

63 Commits

Author SHA1 Message Date
Iulia Tanasescu
f4c40dc410 btio: Remove POLLOUT check from bt_io_bcast_accept
For the Broadcast Sink defer setup scenario, there is no need to check
for the POLLOUT event on the PA sync socket before calling "read" to
issue the Create BIG sync command. This check has been inherited from
unicast, but it is unnecessary for broadcast, since currently after
accept and read, the event to signal BIG sync established is G_IO_IN.
2024-03-28 10:29:24 -04:00
Iulia Tanasescu
00fdb61d56 btio: Allow binding a bcast listener before accept
This adds btio support for binding a PA sync io to a number of BISes,
before proceeding with BIG Create Sync.
2023-10-24 11:08:04 -07:00
Iulia Tanasescu
769268f4b1 btio: Bind listener to bcaster addr based on dst opt
This updates the btio module to decide whether to bind a listening socket
to a broadcaster address or not, by looking at the dst address.
2023-10-05 12:16:16 -07:00
Iulia Tanasescu
ed0def339c btio: Add support for accepting BIS after defer setup
This adds btio support for accepting BIS connections when defer
setup is enabled on a Broadcast Receiver socket.
2023-09-07 12:49:52 -07:00
Claudia Draghicescu
dc13da09d7 btio: Fix BASE copy from getsockopt()
Fix copy of BASE from getsockopt() and update base length.
2023-09-06 16:27:05 -07:00
Claudia Draghicescu
7b3aa05323 btio: Add support for getsockopt(BT_ISO_BASE)
This adds the posibility for a broadcast sink to retrieve the
BASE information received from a source afeter a PA synchronization,
using the getsockopt(BT_ISO_BASE) function.
This needs the patch from bluetooth-next:
Bluetooth: ISO: Add support for periodic adv reports processing
2023-08-08 15:10:06 -07:00
Iulia Tanasescu
da85360a95 btio: Add options for binding iso broadcast address
This adds additional btio options, to allow binding a socket
to a broadcaster address.
2023-07-10 12:22:53 -07:00
Silviu Florian Barbulescu
7002ecc891 btio: Add support for setsockopt (BT_IO_OPT_BASE)
This adds btio support for setting the BT_IO_OPT_BASE socket option.
2023-05-26 15:33:20 -07:00
Iulia Tanasescu
c4d9b99db5 Split bt_iso_qos into dedicated structures
Split bt_iso_qos into dedicated unicast and broadcast
structures and add additional broadcast parameters.
2023-03-31 14:33:28 -07:00
Luiz Augusto von Dentz
b1b575cf17 btio: Add support for ISO sockets
This adds support to create objects that map to ISO sockets.
2022-07-22 13:31:44 -07:00
Archie Pusaka
a777d7d535 btio: Inclusive language changes
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>
2021-09-21 10:51:53 +02:00
Luiz Augusto von Dentz
dfc2829b8c btio: Use G_PRIORITY_HIGH for watches
This makes btio watches default to G_PRIORITY_HIGH instead of
G_PRIORITY_DEFAULT so it takes priority over regular traffic or
timeout handling.
2021-02-16 14:51:04 -08:00
Tedd Ho-Jeong An
66b360a5ba btio: Fix the unchecked return value
This patch fixes the unchecked return value.
2020-11-24 13:03:46 -08:00
Tedd Ho-Jeong An
69af7d92b5 btio: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 GPL-2.0-or-later     :      2

License: GPL-2.0-or-later
   btio/btio.h
   btio/btio.c
2020-09-21 16:19:33 -07:00
Luiz Augusto von Dentz
81629d982c btio: Fix not translation mode to L2CAP mode
When using L2CAP_OPTIONS legacy modes need to be used since they are
not compatible with BT_MODE.
2020-06-05 11:16:40 -07:00
Pali Rohár
f0b7c11ad7 btio: Fix error number
In commit d20ee8273e was unintentionally
negated error number. Fix this mistake.
2020-04-24 10:03:55 -07:00
Pali Rohár
d20ee8273e btio: Show destination address in connect error message
When connect() fails it is not possible to retrieve destination address as
socket is not bound. So put destination address into error message.
2020-04-22 11:20:20 -07:00
Luiz Augusto von Dentz
f2418bf97d btio: Add mode to for Enhanced Credit Mode
This adds BT_IO_MODE_EXT_FLOWCTL which directly maps to
BT_MODE_EXT_FLOWCTL.
2020-03-30 15:23:11 -07:00
Luiz Augusto von Dentz
ba1c07d2c4 btio: Add BT_IO_PHY option
This adds BT_IO_PHY option which can be used to read the underline
packet types/PHY in use by the link layer.
2020-02-19 13:44:54 -08:00
Marcel Holtmann
261948090e build: Move declaration of _GNU_SOURCE back into individual source files 2018-12-06 21:28:18 +01:00
Marcel Holtmann
2f77283513 btio: Use local libbluetooth includes 2015-02-28 22:29:12 -08:00
Szymon Janc
552d63be30 btio: List all enum values in switch
As described in coding style M10.
2014-12-08 14:00:28 +01:00
Michael Janssen
6353123e76 btio: Fix uninitialized usage compilation error
When compiling with --enable-maintainer-mode these throw
errors because of -Werror=maybe-uninitialized
2014-11-03 17:17:12 +02:00
Marcel Holtmann
cf866e55ad btio: Make sure voice setting are all zeroed first 2014-09-20 02:24:40 +02:00
Szymon Janc
2c8e43efc9 btio: Fix not setting getsockopt optlen for BT_SNDMTU 2014-06-13 14:30:33 +03:00
Szymon Janc
24aaa5c9d6 btio: Fix typo in error message 2014-06-13 14:30:33 +03:00
Johan Hedberg
ccd67f611c btio: Remove unnecessary get_peers() function 2014-04-02 14:06:53 +03:00
Johan Hedberg
8dec0f65b4 btio: Do RFCOMM peer address lookup only when really necessary 2014-04-02 14:06:53 +03:00
Johan Hedberg
56f443387e btio: Do L2CAP peer address lookup only when really necessary 2014-04-02 14:06:53 +03:00
Johan Hedberg
e87dadbe1b btio: Add missing BT_IO_OPT_DEST_TYPE getting support 2014-02-21 15:36:35 +02:00
Johan Hedberg
31bcaff56e tools/l2cap-tester: Add MTU checks after successful connections 2014-01-26 00:09:42 +02:00
Johan Hedberg
df8c064867 btio: Fix falling back to L2CAP_OPTIONS if BT_RCVMTU fails 2013-12-30 14:15:58 +02:00
Johan Hedberg
2de1d5a179 btio: Update to support sockopts for LE CoC sockets 2013-12-13 12:51:23 +02:00
Frédéric Dalleau
cf721a5364 btio: Add option for SCO voice setting 2013-08-01 12:36:25 +03:00
Johan Hedberg
ad17eb4eba btio: Add BT_IO_OPT_SOURCE_TYPE option for source bdaddr type 2013-05-17 11:03:11 +03:00
Cristian Rodríguez
c43a49ba67 btio: Fix missing config.h includes 2012-12-23 18:59:41 -08:00
Luiz Augusto von Dentz
2d0b8b0bb2 btio: Fix type detection for L2CAP fixed channels 2012-11-14 15:19:46 +02:00
Luiz Augusto von Dentz
99cf59d0b4 btio: Fix type detection when psm or channel are 0
They could be set to 0 on purpose so the kernel would automatically pick
one available.

To fix this now the detection is done while parsing the options, so in
case the user set the option to 0 it will automatically set the type
as well.
2012-11-14 15:10:07 +02:00
Johan Hedberg
b643623460 btio: Remove BT_IO_L2ERTM
There's no need to have a separate type for ERTM. The mode parameter
takes care of most needs and if necessary a "reliable" parameter can be
added later which will map to SOCK_STREAM usage.
2012-08-29 09:03:39 -07:00
Johan Hedberg
a0d52c9ad0 btio: Make BtIOType private
Since the socket type can be inferred from the socket itself or from the
PSM/Channel/CID/etc parameters provided to listen() and connect() it
doesn't make sense to expose this in the BtIO API.
2012-08-28 17:18:28 -07:00
Johan Hedberg
84bc0d0e57 btio: Remove unneeded L2CAP raw socket support
Now that pairing is done through mgmt this support is no-longer needed.
2012-08-28 13:58:05 -07:00
Claudio Takahasi
58a1819a44 btio: Connect callback errors handling cleanup
Condition verification is not required for this watch since the
condition to watch for was previously informed when it was added
in the mainloop.
2012-07-29 17:01:17 +02:00
Claudio Takahasi
5a3507c104 btio: Replace g_set_error by ERROR_FAILED macro
This patch replaces the calls of g_set_error function by the local
defined macro "ERROR_FAILED".
2012-07-29 16:58:51 +02:00
Paulo Alcantara
d9e204c065 btio: Rescue lost errorneous numbers
The BT_IO_ERROR_* flags are not used for anything else and we just
loosing errorneous numbers set in the sockets that might be more
useful for handling specific errors.

A use case would be disconnect errors that should not allow BlueZ to
enable auto connections since the connection would never be possible in
some cases.

This patch removes BT_IO_ERROR_* flags and use the errors set in the
sockets instead. Now, the errors passed in connect/disconnect callbacks
should contain proper error numbers passed to them.
2012-07-24 11:48:21 +02:00
Claudio Takahasi
d94f9cbf75 btio: Add address type in bt_io_connect
This patch adds a new BtIO option to allow setting the remote Bluetooth
address type for BLE connections. Allowed values for BT_IO_OPT_DEST_TYPE
option are: BDADDR_BREDR, BDADDR_LE_PUBLIC, and BDADDR_LE_RANDOM.
2012-04-25 12:58:48 +03:00
Luiz Augusto von Dentz
c2452f3d45 btio: Add BtIOMode enum to be used with BT_IO_OPT_MODE 2012-02-02 15:55:07 -08:00
Luiz Augusto von Dentz
11dbefe49d btio: Add L2ERTM type
L2ERTM type uses L2CAP socket in SOCK_STREAM instead of SOCK_SEQPACKET
2012-01-31 18:32:34 -08:00
Vinicius Costa Gomes
1e4c7d4379 btio: Remove the default security level from btio
The default value of sec_level when setting *any* option
using bt_io_set() was BT_SECURITY_MEDIUM. This was causing
the security procedure being started in some situations that
it should not.
2012-01-24 16:19:26 +02:00
Vinicius Costa Gomes
51886914ef btio: Add support for getting the Encryption Key Size via btio
Some profiles specify some restriction depending on the length
of the key used to encrypt the link, this adds an way to retrieve
that value from the kernel.
2012-01-24 16:19:19 +02:00
Marcel Holtmann
1d7a0c6997 btio: Remove support for hciX source addresses 2012-01-17 11:47:59 +01:00