Commit Graph

27 Commits

Author SHA1 Message Date
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
Santiago Carot-Nemesio
14803c4e4f btio: Fix byte order conversion when getting L2CAP CID
The L2CAP CID is passed and received in little endian byte order
through the socket interface so a conversion is in place before
passing it onwards.
2011-12-08 14:23:04 +02:00
Santiago Carot-Nemesio
035c0bc524 btio: Fix byte order conversion when getting L2CAP PSM
The L2CAP PSM is passed and received in little endian byte order through
the socket interface so a conversion is in place before passing it
onwards.
2011-11-30 23:25:31 +02:00
Anderson Lizardo
467fcb8094 btio: Fix errno handling convention
Variables which are assigned to the errno variable (usually called
"err") should be negative, and "-err" should be used where a positive
value is needed.
2011-11-17 13:57:53 +02:00
Luiz Augusto von Dentz
992f24762f btio: add BT_IO_OPT_PRIORITY option
BT_IO_OPT_PRIORITY uses SO_PRIORITY to set the priority of the socket
2011-11-04 15:41:41 +02:00
Vinicius Costa Gomes
c141fcc366 btio: Fix the return value of bt_io functions
Some bt_io methods were ignoring the value stored in errno when
reporting the error to the caller.
2011-07-09 19:22:50 +03:00
Marcel Holtmann
29a46bf7db btio: Add workaround for not defined BT_FLUSHABLE 2011-05-27 10:22:07 -07:00
Johan Hedberg
9c7a6a48f2 btio: Fix unused variable warning 2011-05-15 01:55:16 +03:00
Anderson Briglia
b806430037 Fix btio.c compilation warning
This patch fixes a compilation warning regarding btio/btio.c. Actually
this warning seems a false positive by Ubuntu Natty GCC version. A new
bug on Ubuntu bug system was opened but if you do not want to wait until
it is analyzed, just apply this minor fix.

btio/btio.c: In function 'bt_io_get':
btio/btio.c:803:11: warning: 'flushable' may be used uninitialized in
this function
2011-05-05 22:14:03 +03:00
Johan Hedberg
071f7742be Add BT_FLUSHABLE support to BtIO
This patch adds support for the BT_FLUSHABLE L2CAP socket option through
BtIO. This can be used to mark data from specific L2CAP sockets to have
the flushable flag set in their corresponding ACL packets.
2011-04-21 10:15:04 +03:00
Luiz Augusto von Dentz
aef577312e Fix error message when getting SCO connection handle
Error message should indicate the transport correctly which is SCO
not RFCOMM.
2011-03-25 11:10:40 +02:00
Santiago Carot-Nemesio
85bf920f1f Get mode option for L2CAP sockets 2010-10-18 17:14:53 +03:00
Claudio Takahasi
afba441542 Add L2CAP fixed channels support for BTIO
Add new option BT_IO_OPT_CID to allow listen and connect using a fixed
L2CAP channel for BTIO.
2010-09-30 17:25:40 -03:00
Zhenhua Zhang
f57cb78379 btio: Seperate btio.[ch] into btio directory
Seperate btio.[ch] from src directory to btio sub-folder.
2010-09-13 11:23:02 +03:00