Commit Graph

22877 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz
05e124ab1d test/example-gatt-server: Add encrypt attributes
This adds new attributes that requires encryption for TestService.
2015-04-28 14:40:05 +03:00
Luiz Augusto von Dentz
afdd25e820 core/gatt: Add Flags property to GattDescriptor
This adds the implementation of Flags property to GattDescriptor
interface and properly convert it to permissions when adding the
descriptor to the database.
2015-04-28 14:40:04 +03:00
Luiz Augusto von Dentz
fe2cf29b3b doc/gatt-api: Add Flags property to GattDescriptor
This adds Flags property to GattDescriptor so the server can define
permissions and authentication requirements for descriptors.
2015-04-28 14:40:03 +03:00
Luiz Augusto von Dentz
6b068eb7ea shared/gatt-server: Check attribute permissions 2015-04-28 13:28:51 +03:00
Luiz Augusto von Dentz
4f410864a8 shared/att: Add own security definitions
This defines security level at ATT level so it is not necessary to use
transport specific defines.
2015-04-28 13:28:51 +03:00
Luiz Augusto von Dentz
758c4ebf39 core/gatt: Add support for encryption flags
This adds support to encryption related flags as defined in the
documentation.
2015-04-28 13:28:51 +03:00
Luiz Augusto von Dentz
98258d28e2 doc/gatt-api: Add encryption flags
This add encryption flags which can be used when registering a service to
require encryption when accessing a characteristic.
2015-04-28 13:28:50 +03:00
Jakub Pawlowski
d68ff94580 client: main: add support for SetDiscoveryFilter
This patch adds set-scan-filter-* commands to sample DBus client that
might be used to modify discovery filter.

set-scan-filter-uuids - sets filter uuids field
set-scan-filter-rssi - sets filter rssi and clears pathloss
set-scan-filter-pathloss - sets filter pathloss and clears rssi
set-scan-filter-transport - sets filter transport
set-scan-filter-clear - clears filter

Sample output:
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# set-scan-filter-uuids babe
SetDiscoveryFilter success
[bluetooth]# set-scan-filter-transport le
SetDiscoveryFilter success
[bluetooth]# set-scan-filter-rssi -69
SetDiscoveryFilter success
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: yes
[CHG] Device 44:89:1C:C5:67:94 RSSI: -66
[CHG] Device 44:89:1C:C5:67:94 TxPower: -21
[CHG] Device 44:89:1C:C5:67:94 RSSI: -65
[CHG] Device 44:89:1C:C5:67:94 RSSI: -58
[CHG] Device 44:89:1C:C5:67:94 RSSI: -64
[CHG] Device 44:89:1C:C5:67:94 RSSI: -59
[CHG] Device 44:89:1C:C5:67:94 RSSI: -65
[CHG] Device 44:89:1C:C5:67:94 RSSI: -59
[CHG] Device 44:89:1C:C5:67:94 RSSI: -64
[bluetooth]# set-scan-filter-rssi -90
SetDiscoveryFilter success
[CHG] Device 44:89:1C:C5:67:94 RSSI: -76
[CHG] Device 44:89:1C:C5:67:94 RSSI: -82
[CHG] Device 44:89:1C:C5:67:94 RSSI: -75
[CHG] Device 44:89:1C:C5:67:94 RSSI: -81
[CHG] Device 44:89:1C:C5:67:94 RSSI: -76
[CHG] Device 44:89:1C:C5:67:94 RSSI: -76
[CHG] Device 44:89:1C:C5:67:94 RSSI: -81
[CHG] Device 44:89:1C:C5:67:94 RSSI: -75
[CHG] Device 44:89:1C:C5:67:94 RSSI: -82
[CHG] Device 44:89:1C:C5:67:94 RSSI: -82
[bluetooth]# scan off
[CHG] Device 44:89:1C:C5:67:94 TxPower is nil
[CHG] Device 44:89:1C:C5:67:94 RSSI is nil
Discovery stopped
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: no
2015-04-28 10:43:14 +03:00
Hsin-Yu Chao
b669604f43 src/profile: Set service to connecting in ext_connect
For the profile connection initiated by remote device,
ext_connect() function is triggered without advance the state
of device's service to BTD_SERVICE_STATE_CONNECTING.
This is causing a problems when the later 'NewConnection'
dbus method call is made to registered application. If
the remote device gets disconnected during the period of
time waiting for the reply of 'NewConnection' method, the
btd_service_disconnect() call will fail at the service state
check and never handle the profile disconnection due to that
state was incorrectly left as BTD_SERVICE_STATE_DISCONNECTED.
Fix the problem by use service_accept() call in ext_connect()
to assure the service state has changed. Also modify the logic
of service state check in btd_service_connecting_complete()
to prevent the problem when the 'NewConnect' reply changes
service state to BTD_SERVICE_STATE_CONNECTED while the device
has already disconnected before it arrives.
2015-04-27 16:37:46 +03:00
Arman Uguray
75b0bf3ddb test/example-advertisement: Use IncludeTxPower
This patch changes the example-advertisement script to use
IncludeTxPower rather than IncludeTXPower.
2015-04-23 17:14:15 -07:00
Arman Uguray
3106df8aa0 core/advertising: Rename IncludeTXPower
This patch renames IncludeTXPower to IncludeTxpower to keep consistency
across D-Bus interfaces.
2015-04-23 17:14:15 -07:00
Arman Uguray
fbe157987e doc/advertising-api.txt: Rename IncludeTXPower
This patch renames IncludeTXPower to IncludeTxPower to keep consistency
across D-Bus interfaces.
2015-04-23 17:14:01 -07:00
Jakub Pawlowski
e1bc7c9c4b client: Make command info print TxPower and RSSI
This makes command info to also print TxPower and RSSI if available.
2015-04-23 22:03:18 +02:00
Jakub Pawlowski
c22de2887c core: Add implementation of TxPower
This adds 'TxPower' property to Device interface.
2015-04-23 22:03:03 +02:00
Jakub Pawlowski
7ba34ac7c5 doc/device-api: Add TxPower
This adds TxPower from advertisement data.
2015-04-23 22:02:49 +02:00
Gowtham Anandha Babu
9cec25ab75 monitor: Add support for decoding bnep DestOnly pkt
BNEP: Compressed Ethernet DestOnly (0x04|0)
         dst 00:00:00:00:00:00 [proto 0x0000]
        00 00 00 00 00 00 61 62 63 64 65 66 30 31 32 33
        34 35 36 37 38 39 5f 62 6e 65 70 5f 74 65 73 74
2015-04-23 17:10:28 +02:00
Gowtham Anandha Babu
b196e76fbc monitor: Add support for decoding bnep SrcOnly pkt
BNEP: Compressed Ethernet SrcOnly (0x03|0)
         src 00:00:00:00:00:00 [proto 0x0300]
        3c 3b 3a 39 38 37 36 35 34 33 32 31 30 2f 2e 2d
        2c 2b 2a 29 28 27 26 25 24 23 22 21 20 1f 1e 1d
2015-04-23 17:10:28 +02:00
Gowtham Anandha Babu
f83bca6282 monitor: Add support for decoding bnep Compressed pkt
BNEP: Compressed Ethernet (0x02|0)
         [proto 0x0300]
        3c 3b 3a 39 38 37 36 35 34 33 32 31 30 2f 2e 2d
        2c 2b 2a 29 28 27 26 25 24 23 22 21 20 1f 1e 1d
2015-04-23 17:10:28 +02:00
Gowtham Anandha Babu
6939f973ff monitor: Add support for decoding bnep Control pkt
BNEP: Control (0x01|0)
         Filter MultAddr Set (0x05)
        00 30 ff ff ff ff ff ff ff ff ff ff ff ff 33 33
        00 00 00 01 33 33 00 00 00 01 01 00 5e 00 00 01
2015-04-23 17:10:28 +02:00
Gowtham Anandha Babu
97591b03dd monitor: Add support for decoding bnep General pkt
BNEP: General Ethernet (0x00|0)
         dst 00:00:00:00:00:00 src 00:00:00:00:00:00 [proto 0x0300]
        3c 3b 3a 39 38 37 36 35 34 33 32 31 30 2f 2e 2d
        2c 2b 2a 29 28 27 26 25 24 23 22 21 20 1f 1e 1d
2015-04-23 17:10:27 +02:00
Bharat Panda
b311b1fced monitor: Add support for AVRCP GeneralReject
Support for AVRCP GeneralReject added to btmon.
2015-04-23 16:45:02 +02:00
Bharat Panda
50ed625e24 monitor: Add support for AVRCP Search
Support for AVRCP Search item added to btmon.

      Channel: 65 len 17 ctrl 0x0000 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: Search: len 0x0007
          CharsetID: 0x006a (UTF-8)
          Length: 0x0003 (3)
          String: New
2015-04-23 16:45:02 +02:00
Bharat Panda
a3a07c7432 monitor: Add Support for AVRCP GetItemAttributes
Support for decoding AVRCP GetItemAttributes added to btmon.

      Channel: 65 len 26 ctrl 0x0102 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 1 ReqSeq 1
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: GetItemAttributes: len 0x0010
          Scope: 0x01 (Media Player Virtual Filesystem)
          UID: 0x0000000000000001 (1)
          UIDCounter: 0x0000 (0)
          AttributeCount: 0x01 (1)
          AttributeID: 0x00000001 (Title)
2015-04-23 16:45:01 +02:00
Bharat Panda
4edb7bfb57 monitor: Add AVRCP ChangePath support
Add support for decoding AVRCP ChangePath in bluetooth monitor.

      Channel: 65 len 21 ctrl 0x0000 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: ChangePath: len 0x000b
          UIDCounter: 0x0000 (0)
          Direction: 0x01 (Folder Down)
          FolderUID: 0x               1 (1)
2015-04-23 16:33:58 +02:00
Luiz Augusto von Dentz
23fe43014b unit/test-gdbus-client: Fix hanging if D-Bus fails to launch
In case D-Bus fails to launch make the test fails so it does not hang
other tests.
2015-04-22 13:47:13 -07:00
Luiz Augusto von Dentz
dbcbfa9953 unit/test-eir: Add ad/uri-beacon test
This adds test for uir-beacon define bellow:

https://github.com/google/uribeacon/blob/master/specification/AdvertisingMode.md
2015-04-20 15:03:56 +03:00
Bharat Panda
aa79627cbc monitor: Add MediaElementItem for GetFolderItems
Add support for decoding GetFolderItems(MediaElementItem) for avrcp in
bluetooth monitor.

      Channel: 65 len 20 ctrl 0x0000 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x000a
          Scope: 0x01 (Media Player Virtual Filesystem)
          StartItem: 0x00000000 (0)
          EndItem: 0x0000000a (10)
          AttributeCount: 0xff (255)
          AttributeID: 0x0000326e (Reserved)
2015-04-17 16:56:30 +03:00
Bharat Panda
f1c6c3a7b5 monitor: Add FolderItem support for GetFolderItems
Add support for decoding GetFolderItems(FolderItem) for avrcp in
bluetooth monitor.

      Channel: 65 len 20 ctrl 0x0000 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x000a
          Scope: 0x01 (Media Player Virtual Filesystem)
          StartItem: 0x00000000 (0)
          EndItem: 0x0000000a (10)
          AttributeCount: 0xff (255)
          AttributeID: 0x0000326e (Reserved)
2015-04-17 16:56:26 +03:00
Bharat Panda
aff80675b1 monitor: Add MediaPlayerItem for GetFolderItems
Add support for decoding GetFolderItems(MediaPlayerItem) for avrcp
in bluetooth monitor.

      Channel: 65 len 20 ctrl 0x0306 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 3 ReqSeq 3
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x000a
          Scope: 0x00 (Media Player List)
          StartItem: 0x00000000 (0)
          EndItem: 0x00000064 (100)
          AttributeCount: 0x00 (0)
2015-04-17 16:56:21 +03:00
Bharat Panda
ddb01ec673 monitor: Add AVRCP GetFolderItems Support
Support for decoding AVRCP GetFolderItems added in btmon.

      Channel: 65 len 20 ctrl 0x0000 [PSM 27 mode 3] {chan 1}
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
      AVCTP Browsing: Command: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x000a
          Scope: 0x01 (Media Player Virtual Filesystem)
          StartItem: 0x00000000 (0)
          EndItem: 0x0000000a (10)
          AttributeCount: 0xff (255)
          AttributeID: 0x0000326e (Reserved)
2015-04-17 16:48:24 +03:00
Gowtham Anandha Babu
45e762c477 doc/test-coverage: Update test-gatt count 2015-04-17 16:37:52 +03:00
Gowtham Anandha Babu
2737bf7eda unit/gatt: Add TP/GAW/CL/BI-19-C test
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to insufficient encryption
key size.
2015-04-17 16:37:52 +03:00
Gowtham Anandha Babu
19bc2d9335 unit/gatt: Add TP/GAW/CL/BI-18-C test
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to insufficient authentication.
2015-04-17 16:37:52 +03:00
Gowtham Anandha Babu
6de60cb9d3 unit/gatt: Add TP/GAW/CL/BI-17-C test
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to insufficient authorization.
2015-04-17 16:37:51 +03:00
Gowtham Anandha Babu
10340ab36d unit/gatt: Add TP/GAW/CL/BI-15-C test
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to write not permitted.
2015-04-17 16:37:51 +03:00
Gowtham Anandha Babu
cf8463051f unit/gatt: Add TP/GAW/CL/BI-14-C test
Verify Generic Attribute Profile client behavior when the Characteristic
Value Reliable Write procedure fails due to invalid handle.
2015-04-17 16:37:51 +03:00
Gowtham Anandha Babu
82eff76b10 unit/gatt: Add TP/GAW/CL/BV-06-C test
Verify that a Generic Attribute Profile client can reliably write
a characteristic selected by handle.
2015-04-17 16:37:51 +03:00
Luiz Augusto von Dentz
dce0b7df9b core/adapter: Create device even if not-connectable
If the device is in fact discoverable it should be no problem to create
a D-Bus object for it as the object is required in order to attach the
advertisement data in case a broadcaster/beacons come in range.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
e3f36f586c core/eir: Fix service data parsing
The UUID type was not being set correctly.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
09000e29db client: Make command info print ServiceData
This makes command info to also print ServiceData if available.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
b7caed7b06 core: Add implementation of ServiceData
This adds 'ServiceData' property to Device interface.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
3004552cd0 shared/ad: Add bt_ad_has_service_data
This adds bt_ad_has_service_data function that can be used to
verify if data exists or in case of NULL if any data has been added.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
2196a1a889 shared/ad: Add bt_ad_foreach_service_data
This adds bt_ad_foreach_service_data function that can be used
list entries added as service data.
2015-04-17 14:15:48 +03:00
Luiz Augusto von Dentz
a926593bef client: Make command info print ManufacturerData
This makes command info to also print ManufacturerData if available.
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
9797b12a39 client: Fix no handling dict properly
D-Bus dict may contain keys that are not of string type.
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
4a7e909f2c core: Add implementation of ManufacturerData
This adds 'ManufacturerData' property to Device interface.
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
54a3f7b2b1 core/dbus-common: Add dict helpers for basic keys
The specification allows any basic type to be key:

  'A DICT_ENTRY works exactly like a struct, but rather than parentheses
   it uses curly braces, and it has more restrictions. The restrictions
   are: it occurs only as an array element type; it has exactly two
   single complete types inside the curly braces; the first single
   complete type (the "key") must be a basic type rather than a
   container type...'
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
5e418c30cb shared/ad: Add bt_ad_has_manufacturer_data
This adds bt_ad_has_manufacturer_data function that can be used to
verify if data exists or in case of NULL if any data has been added.
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
5722661684 shared/ad: Add bt_ad_foreach_manufacturer_data
This adds bt_ad_foreach_manufacturer_data function that can be used
list entries added to manufacturer data.
2015-04-17 14:15:47 +03:00
Luiz Augusto von Dentz
93ff31d835 doc/device-api: Add ServiceData and ManufacturerData
This adds ServiceData and ManufacturerData from advertisement data.
2015-04-17 14:15:47 +03:00