Commit Graph

494 Commits

Author SHA1 Message Date
Johan Hedberg
c87e0ec647 mgmt: Rename pairable to bondable 2014-07-30 10:32:16 +03:00
Marcel Holtmann
355d0dac25 lib: Add definition for New Configuration Options mgmt event 2014-07-04 19:07:43 +02:00
Marcel Holtmann
22ddae4b34 lib: Adjust for new Set External Configuration mgmt command 2014-07-04 13:10:35 +02:00
Marcel Holtmann
653476ff78 lib: Add definitions for set public address command 2014-07-04 00:47:28 +02:00
Marcel Holtmann
9461686284 lib: Add definitions for reading controller configuration info 2014-07-04 00:00:34 +02:00
Marcel Holtmann
afb9c8ffe0 lib: Update company identifiers 2014-07-03 16:12:38 +02:00
Marcel Holtmann
928258470f lib: Add definition for Read Unconfigured Index List command 2014-07-02 21:38:26 +02:00
Marcel Holtmann
5509d61174 lib: Add definition for Unconfigured Index Removed event 2014-07-02 21:32:10 +02:00
Marcel Holtmann
2517c3cb65 lib: Add definition for Unconfigured Index Added event 2014-07-02 20:57:15 +02:00
Johan Hedberg
460d1656ce lib/mgmt: Add definitions for Load Connection Parameters 2014-07-02 16:48:17 +03:00
Marcel Holtmann
c6bb2f223c lib: Add strings for connection parameters management opcodes 2014-07-02 00:50:58 +02:00
Andre Guedes
a1451db1fe lib/mgmt: Add New Connection Parameter Event
This patch adds struct and macro for New Connection Parameter Event.
2014-07-02 00:45:51 +02:00
Marcel Holtmann
36a1811287 lib: Add device found flag for not connectable 2014-07-01 13:56:32 +02:00
Johan Hedberg
09b9ffbd81 lib/mgmt: Add defines for Add/Remove Device responses 2014-07-01 11:04:29 +03:00
Marcel Holtmann
36d58cdd1b lib: Add mgmt event for Device Added and Device Removed 2014-06-29 22:32:59 +02:00
Marcel Holtmann
b04e8f186b lib: Add defines for Add Device and Remove Device mgmt commands 2014-06-29 15:27:38 +02:00
Luiz Augusto von Dentz
85eb28a8d3 lib/uuid: Add define for Battery UUID 2014-06-29 14:52:36 +02:00
Marcel Holtmann
7f3adaeb6f lib: Remove not yet implemented management commands and events 2014-06-29 14:02:45 +02:00
Marcel Holtmann
718e7cfea3 lib: Update with the new mgmt command opcodes 2014-06-29 13:58:59 +02:00
Marcel Holtmann
73de6ea5fe lib: Add strings for connection parameter and clock info opcodes 2014-06-28 19:02:43 +02:00
Johan Hedberg
17926da6e8 lib/mgmt: Add defines for Get Clock Information 2014-06-28 17:51:35 +03:00
Luiz Augusto von Dentz
0df04a3f3a lib/uuid: Add define for Scan Parameter UUID 2014-06-27 18:09:43 +02:00
Marcel Holtmann
0d8eab2a17 lib: Update company identifiers 2014-06-18 13:52:43 +02:00
Szymon Janc
0b01caab7b lib/sdp: Add attributes and service class for MPS 2014-05-26 11:07:28 +02:00
Andrzej Kaczmarek
62e9043c16 lib: Add definitions for Get Connection Information command 2014-05-19 08:21:35 +03:00
Marcel Holtmann
b4755d7f8c lib: Update company identifiers 2014-05-16 15:56:35 -07:00
Lukasz Rymanowski
d499eb81ed lib: Add more GATT characteristics UUIDs
These characteristics UUIDs will be used in following patch.
2014-04-30 17:30:01 +02:00
Marcel Holtmann
1fa1738427 lib: Update company identifiers 2014-04-12 10:31:10 -07:00
Marcel Holtmann
9c02efcf84 lib: Update company identifiers 2014-03-25 20:20:06 -07:00
Claudio Takahasi
0086e34fc0 lib: Fix UUID 16/32-bits to 128-bit conversion
16 and 32-bit UUIDs are always created using host order. However,
no matter the system type, 128-bit UUID must use big-endian byte
order format (similar to human-readble format).
2014-03-24 22:06:13 +02:00
Claudio Takahasi
05a9545a82 lib: Remove hton128() from bt_uuid_to_string()
bt_uuid_to_string() helper should get the raw UUID value. Caller should
convert the 128-bit UUID before call this helper (if applicable).
bt_uuid_t stores 128-bit UUID using big-endian format (human-readable
format), swapping byte order is not necessary.
2014-03-24 22:05:08 +02:00
Claudio Takahasi
3c3d0a8a32 lib: Remove ntoh128() from bt_string_to_uuid128()
No matter the system, 128-bit UUIDs should not be converted to any byte
order when creating the UUID. Conversion to big/little endian should be
performed when transfering the data over-the-air only. bt_uuid_t should
handle 128-bit UUID on big-endian format (human-readable format).
2014-03-24 22:04:37 +02:00
Luiz Augusto von Dentz
a32e8d927f lib/sdp: Add MapSupportedFeatures attribute
This adds MapSupportedFeatures which is used for MAP v1.2 and later.
2014-03-21 16:13:44 +02:00
Luiz Augusto von Dentz
2f5f3eb48f lib/sdp: Add PbapSupportedFeatures attribute
This adds PbapSupportedFeatures which is used for PBAP v1.2 and later.
2014-03-21 16:13:44 +02:00
Marcel Holtmann
fafe80c699 lib: Update company identifiers 2014-03-11 09:32:13 -07:00
Marcel Holtmann
3d7959495e lib: Add management event structure for signature resolving key 2014-03-09 12:10:41 -07:00
Marcel Holtmann
133c7fb17c core: Rename IRK key variable from irk to key 2014-03-09 12:01:21 -07:00
Johan Hedberg
061692d55f core: Store EDiv and Rand as logical integers
This patch acknowledges the endianess of ediv and rand as they are
received from the kernel and stores them as logical decimal integers in
storage. This involves converting to little endian before passing to the
kernel and from little endian after receiving from the kernel.
2014-03-06 11:43:02 +02:00
Marcel Holtmann
530a89e573 lib: Update company identifiers 2014-03-02 09:58:24 -08:00
Andre Guedes
5b0a7d9c0d gatt: Add helper for creating GATT services
This patch adds the btd_gatt_add_service() helper which adds a
GATT Service declaration to the local attribute database.
2014-02-24 10:18:47 +02:00
Claudio Takahasi
67b976dc33 lib: Move GATT UUID to uuid.h
This patch moves GATT UUIDs definitions to a common header. uuid.h contains
helper functions to manipulate Bluetooth UUIDs and some common BR/EDR services
UUIDs.
2014-02-24 10:18:45 +02:00
Johan Hedberg
85edf04e32 lib/mgmt: Add definition for Set Privacy command 2014-02-22 16:36:37 +02:00
Marcel Holtmann
188aac21b8 lib: Update company identifiers 2014-02-21 21:39:13 -08:00
Marcel Holtmann
01cf316648 lib: Add strings for new mgmt commands and events 2014-02-21 21:29:37 -08:00
Marcel Holtmann
1bde19d427 lib: Add constant for management privacy setting 2014-02-21 21:25:16 -08:00
Anderson Lizardo
cb7a38247e lib/sdp: Fix printing of multiple record fields
If there are multiple fields to print, sdp_record_print() was missing a
newline between entries.
2014-02-21 14:05:28 +02:00
Anderson Lizardo
a0d40b384a lib/sdp: Add missing Service Class ID for GAP
Also reorder last ID so the list remains ordered.
2014-02-21 14:05:28 +02:00
Johan Hedberg
e240ddf32c lib/mgmt: Add defines for New IRK event 2014-02-19 14:49:04 +02:00
Johan Hedberg
c4e7ee80c1 lib/mgmt: Add defines for mgmt_load_irks 2014-02-18 10:14:57 +02:00
Marcel Holtmann
5c69dbc1c7 lib: Add constants for handling debug keys setting 2014-02-01 23:53:19 -08:00
Marcel Holtmann
a68c2cbbf6 core: Rename authentication to key_type in mgmt_ltk_info 2014-02-01 18:01:20 -08:00
Marcel Holtmann
efd41362b6 lib: Update company identifiers 2014-01-20 17:50:57 -08:00
Szymon Janc
c8260c5acb lib: Add flag to force large MTU size used for SDP connection
This will allow to workaround Dualshock4 not respecting L2CAP MTU
size while sending SDP response. Use same L2CAP MTU value base on
RFCOMM.
2014-01-20 15:19:25 +02:00
Marcel Holtmann
16d8bce688 lib: Add management setting for secure connections 2014-01-11 01:10:36 -08:00
Marcel Holtmann
f7750cb8f6 lib: Add structure for local OOB extended data information 2014-01-09 19:50:18 -08:00
Marcel Holtmann
2ecff492e3 lib: Add constant for secure connections support command 2014-01-09 19:46:45 -08:00
Andrei Emeltchenko
091616204c lib/sdp: Fix incorrect sizeof argument
length is a pointer to int table not int* table.
2014-01-09 18:23:08 +02:00
Lukasz Rymanowski
c296b09915 sdp: Add MAP_PROFILE_ID 2014-01-02 15:48:45 +02:00
Marcel Holtmann
3592931845 lib: Update company identifiers 2013-12-27 09:33:15 -08:00
Marcel Holtmann
905935a11c lib: Add version information for Bluetooth 4.1 2013-12-10 02:00:37 -08:00
Marcel Holtmann
2b34347828 lib: Update company identifiers 2013-12-10 01:41:38 -08:00
Johan Hedberg
e02433c0b0 lib: Add BT_SNDMTU and BT_RCVMTU socket option defines 2013-12-05 11:58:45 +02:00
Johan Hedberg
7d3a607247 lib: Add missing BT_POWER socket option defines 2013-12-03 11:16:00 +02:00
Marcel Holtmann
c5b9aa2263 lib: Update company identifiers 2013-11-29 07:24:42 -08:00
Marcel Holtmann
97e344952f lib: Update company identifiers 2013-11-15 14:52:53 -08:00
Marcel Holtmann
89bbe0aed8 lib: Add definitions for Set Scan Parameters command 2013-10-11 14:48:58 -07:00
Marcel Holtmann
855f18f7b5 lib: Update company identifiers 2013-10-10 16:10:52 -07:00
Luiz Augusto von Dentz
75e0c32af6 lib/sdp: Replace VIDEO_CONF_SVCLASS_ID with AV_REMOTE_CONTROLLER_SVCLASS_ID
VCP apparently was never adopted so 0x110f was latter reused by AVRCP 1.3
controller as per current assigned numbers page:

https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery
2013-10-09 17:37:46 +02:00
Marcel Holtmann
3cf65b88c5 lib: Add missing structure for accept physical link command 2013-10-08 06:08:56 -07:00
Marcel Holtmann
f095b87f55 lib: Fix a few whitespace damages 2013-10-08 04:12:25 -07:00
Marcel Holtmann
757ad2e6f7 lib: Update company identifiers 2013-10-07 23:45:52 -07:00
Marcel Holtmann
4feaf68bf2 lib: Add special functions for PAL version mapping 2013-10-07 15:32:40 -07:00
Marcel Holtmann
ea0fa83ebf lib: Add define for mgmt_set_static_address 2013-10-02 06:15:52 -07:00
Anderson Lizardo
fd8d0713e8 lib: Fix invalid "whitespace" on company identifier string
Somehow, the invalid multibyte sequence "\xC2\xA0" (which is displayed
as a whitespace) was inserted on a company identifier string. Fix this
to avoid a bogus diff when running tools/update_compids.sh.
2013-10-02 14:09:01 +03:00
Johan Hedberg
7c6c6e179a lib: Add define for mgmt_set_bredr 2013-10-02 12:16:57 +03:00
Szymon Janc
cf8a492dfd lib: Fix use of uninitialized variable in sdp_set_profile_descs
Error path on default case was not breaking loop. To keep error
handling similar all error path were converted to use goto.

This fix following:
target  C: libbluetooth <= external/bluetooth/bluez/android/../lib/sdp.c
lib/sdp.c: In function 'sdp_set_profile_descs':
lib/sdp.c:487:10: warning: 'values[0]' may be used uninitialized in
    this function [-Wmaybe-uninitialized]
lib/sdp.c:2562:19: note: 'values[0]' was declared here
lib/sdp.c:545:11: warning: 'dtds[0]' may be used uninitialized in this
    function [-Wmaybe-uninitialized]
lib/sdp.c:2562:9: note: 'dtds[0]' was declared here
2013-09-30 21:16:41 +03:00
Marcel Holtmann
24d9643a10 lib: Update company identifiers 2013-09-28 00:05:50 -07:00
Johan Hedberg
8c77159a72 mgmt: Add defines for new advertising setting 2013-09-25 13:51:11 +03:00
Marcel Holtmann
3719c6d257 lib: Update company identifiers 2013-09-21 11:40:31 -07:00
Marcel Holtmann
c0b7506c42 lib: Add definition for HCI_CHANNEL_USER 2013-09-02 11:17:05 -07:00
Marcel Holtmann
a24e0a151f lib: Update company identifiers 2013-08-07 12:21:46 -07:00
Frédéric Dalleau
c594291320 lib: SCO voice setting support header
Modify headers to enable support for changing SCO voice setting.
Corresponding commit implements functionality on kernel side.
2013-08-01 12:32:11 +03:00
Anderson Lizardo
9b686b14f2 lib: Remove duplicated HSP_HS_UUID definition
There is an identical definition on the same header file (next to
HSP_AG_UUID).
2013-07-18 12:33:08 +03:00
Szymon Janc
a727297039 lib: Add range check for SDP_SVC_ATTR_RSP/SDP_SVC_SEARCH_ATTR_RSP
This is an improved version of recently reverted commit 1796f00e84.
Response size is verified against minimal allowed value only if it is
complete response. If response is partial it is allowed by spec that
it will be split in arbitrary manner.

Verified against Nokia BH217 on which original commit caused
regression.
2013-07-10 12:36:34 +03:00
Johan Hedberg
c71e098d2e lib: Update company identifiers 2013-06-26 14:30:11 +03:00
Johan Hedberg
550dab5ce2 Revert "lib: Add range check for SDP_SVC_ATTR_RSP/SDP_SVC_SEARCH_ATTR_RSP"
This reverts commit 1796f00e84.

This patch causes a regression with the Nokia BH217 headset. A correct
patch must take into account fragmented responses.
2013-06-25 21:44:17 +03:00
Szymon Janc
d82a3f679e lib: Cleanup SDP logs to not include double new lines
SDPERR and SDPDBG already add new line to prints.
2013-06-24 11:08:03 +03:00
Alex Deymo
0585258ea1 lib: Fix two size constants
Fixes the value of RESET_FAILED_CONTACT_COUNTER_RP_SIZE and
RESET_FAILED_CONTACT_COUNTER_RP_SIZE macros to respect the
associated struct.
2013-06-16 18:25:46 +03:00
Johan Hedberg
4f8952b201 mgmt: Add support for new MGMT_STATUS_RFKILLED 2013-05-29 09:49:21 +03:00
Luiz Augusto von Dentz
7913d91635 lib: Fix sdp_seq_alloc_with_length accessing invalid index/memory
The sequence itself is not an index of dtds, values, lengths, thats why
SDP_SEQ8 is used directly as dtd, so accessing length[i] is always off
by one.

Furthermore the length is not really used by sdp_data_alloc_with_length
when the dtd is SDP_SEQ8 which is probably why it doesn't crash.
2013-05-23 14:57:09 -07:00
Johan Hedberg
3b60c35aba lib: Update company identifiers 2013-05-19 07:08:31 +03:00
Anderson Lizardo
cc11bc19c2 lib: Fix list of company identifiers
Fix minor typos on company names.
2013-04-30 13:16:12 +03:00
Christian Fetzer
41d61ddc98 lib: Add attributes MASInstanceID and SupportedMessageTypes 2013-04-17 13:43:45 +03:00
Marcel Holtmann
eb1f591c79 lib: Update list of company identifiers 2013-04-10 22:23:49 -07:00
Arkadiusz Lichwa
e63b0f9035 lib: Fix invalid memory access in sdp_service_search_attr_req
Browsing services using sdptool can lead to writing to invalid heap
locations.

valgrind's output of exemplary call: sdptool browse local

==2203== HEAP SUMMARY:
==2203==     in use at exit: 0 bytes in 0 blocks
==2203==   total heap usage: 251 allocs, 251 frees, 140,156 bytes allocated
==2203==
==2203== All heap blocks were freed -- no leaks are possible
==2203==
==2203== ERROR SUMMARY: 6 errors from 2 contexts (suppressed: 0 from 0)
==2203==
==2203== 1 errors in context 1 of 2:
==2203== Invalid write of size 2
==2203==    at 0x805B882: bt_put_be16 (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8062BD0: sdp_service_search_attr_req (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8052457: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x80525AE: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x805277F: cmd_browse (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8053199: main (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==  Address 0x4391359 is 7 bytes before a block of size 2,048 alloc'd
==2203==    at 0x402B6A8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2203==    by 0x8062B4B: sdp_service_search_attr_req (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8052457: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x80525AE: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x805277F: cmd_browse (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8053199: main (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==
==2203==
==2203== 5 errors in context 2 of 2:
==2203== Invalid write of size 1
==2203==    at 0x402D363: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2203==    by 0x80613E7: gen_dataseq_pdu (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8061472: gen_attridseq_pdu (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8062C00: sdp_service_search_attr_req (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8052457: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x80525AE: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x805277F: cmd_browse (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8053199: main (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==  Address 0x439135b is 5 bytes before a block of size 2,048 alloc'd
==2203==    at 0x402B6A8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==2203==    by 0x8062B4B: sdp_service_search_attr_req (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8052457: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x80525AE: do_search (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x805277F: cmd_browse (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==    by 0x8053199: main (in /home/xpu/gits/bluez.bin/bin/sdptool)
==2203==
==2203== ERROR SUMMARY: 6 errors from 2 contexts (suppressed: 0 from 0)
2013-04-04 15:35:50 +03:00
Marcel Holtmann
d3a95e3088 lib: Update list of company identifiers 2013-03-21 11:48:13 -07:00
Marcel Holtmann
786f0e0e33 lib: Update list of company identifiers 2013-02-23 12:00:03 +01:00
Anderson Lizardo
b52d10d7ab lib: Validate DTDs when parsing VersionNumberList 2013-02-18 10:01:27 +02:00
Anderson Lizardo
4c07609a59 lib: Add comment to BluetoothProfileDescriptorList parsing workaround
Commits 0f5a5a9580 and
46b3a3d2d0 introduced this workaround.
2013-02-18 10:01:23 +02:00
Anderson Lizardo
bbabc6792c lib: Validate DTDs when parsing BluetoothProfileDescriptorList
The "seq->val.dataseq != NULL" check is also removed from the for()
statement because it should be done after verifying that the data
element is a sequence (inside the "if (SDP_IS_SEQ(...))" block.)
2013-02-18 10:01:06 +02:00