We shouldn't respond with an error if the read of UUID failed.
It's because we don't know if this UUID was the one that client
requested in the Find by Type Value request.
Change-Id: I34c336b9afc3520194fbddaaee8a44d51beabad5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This fixes bug where wrong service handles have been sent while
discovering the primary services. We should skip Secondary Service
contained in range 0x0006-0x0009 in this case:
> ACL Data RX: Handle 64 flags 0x02 dlen 13 [hci0] 619772.398445
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0001-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Access Profile (0x1800)
< ACL Data TX: Handle 64 flags 0x00 dlen 9 [hci0] 619772.403821
ATT: Find By Type Value Response (0x07) len 4
Handle range: 0x0001-0x0009
With this patch:
> ACL Data RX: Handle 64 flags 0x02 dlen 13 [hci0] 618945.922607
ATT: Find By Type Value Request (0x06) len 8
Handle range: 0x0001-0xffff
Attribute type: Primary Service (0x2800)
UUID: Generic Access Profile (0x1800)
< ACL Data TX: Handle 64 flags 0x00 dlen 9 [hci0] 618945.927933
ATT: Find By Type Value Response (0x07) len 4
Handle range: 0x0001-0x0005
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Change-Id: I7bb743e8787bc294ba447be5e21e250f0128ec68
This makes sure the code behind CONFIG_BLUETOOTH_GATT_DYNAMIC_DB builds
properly and sanity_check is able to detect problems whenever there is
a change affecting it.
Change-Id: If46d1d9723f9daa494611e5a1799afd943e6519c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enable applications to build with a single table representing the
database where attributes don't have to store a pointer to the next
attribute thus reducing its size.
Change-Id: I4c84e2d50f9088a2f9879068890f0646e586e007
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This fixes invalid att pointer dereference to get the tx MTU size.
Change-Id: Ifc7911ee58fd4ddff10d1839aff5df9a6e805de8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This fixes bug where wrong service handles have been sent while
discovering the primary services. We should skip Secondary Service
contained in range 0x0006-0x0009 in this case:
ATT: Read By Group Type Response (0x11) len 13
Attribute data length: 6
Attribute group list: 2 entries
Handle range: 0x0001-0x0009
UUID: Generic Access Profile (0x1800)
Handle range: 0x000a-0x000e
UUID: Unknown (0xaa50)
With this patch:
ATT: Read By Group Type Response (0x11) len 13
Attribute data length: 6
Attribute group list: 2 entries
Handle range: 0x0001-0x0005
UUID: Generic Access Profile (0x1800)
Handle range: 0x000a-0x000e
UUID: Unknown (0xaa50)
Change-Id: I8121521e76476826296a2bedf9e18ef008f81363
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Disabling ARC core allows to flash only lakemont and decrease unneeded
debug output.
Change-Id: Ifb913274302d7c69f1fb9c2e1747742d7a810627
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Define configuration for Nordic chip connected to UART0.
Change-Id: Ia6007def747932e5f9fbd57f1ea8005892a2f793
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Test Nordic BLE on platforms which has support for it, at least we
need a UART configured to be connected to the chip.
Change-Id: I040fbb33436ae6bf973b521d52bf7b971993559a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add API definition and stubs for directed advertising.
Change-Id: Ib22d3acb6d2e76b0c638b26b8e07860cd189f640
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
All of the authentication APIs deal with bt_conn objects. For
consistency it makes therefore sense to use the proper bt_conn name
space with them.
Change-Id: I47912d542373df511524cc6ad2532d6c9a76ca68
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To have some proper split of conn.h and bluetooth.h APIs make sure all
bt_conn related ones are in conn.h. This also helps avoid forward
declarations for some upcoming patches where we need bluetooth.h
defines from within conn.h.
Change-Id: Ief3d32118a6749fb5785dab6cb3fee4ebb86ddb4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's not a good idea to silently truncate the data if we got a too
large array from the app.
Change-Id: Ie4541599c6846efd53c81310c8d1e4dd5ec00cee
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The advertising data and scan response data HCI commands are almost
identical so we can save some code size by having a helper function
for them.
Change-Id: I9f80477ab7837c0a8efa0f9219552ea1426978d4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This option will be used to determine if bt_gatt_attr need to store the
next attribute or if it directly accessible by index.
Change-Id: I98fd43931d67d6c3be3b7a130e6fd2f97f2c4a3a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This is needed for GATT Server tests to implement larger attribute
databases.
Change-Id: Id160ac81b3e393697bdacd3e19033e9ff7c10fde
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This way we can pass any errors back to the application.
Change-Id: Ic53b858a73436e1c9c4d03e358aeffae7fd837ab
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is essential so that the application can be notified of
connection failures and also be able to know the reason for the
disconnection.
Change-Id: I30108958963f6aeac690612bb26738dc4c67ca80
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a minimal fix as for now only LE fixed channels are supported.
Change-Id: Id88cae49f5cdbe3b9d3695995929d601a3b561bd
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This function is always called with valid connection.
Change-Id: I756990a22f7c56939fd8e92c498d722a0467ab84
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no need for using conn security calback while l2cap
channel provides encryption callback.
Change-Id: I84872bca7a7b4334b52810bafd0faa2bb1e381de
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
The authentication APIs may fail, so it's fair to give the application
a chance to catch these errors.
Change-Id: I323df86b94a823b201fe22d412e6bbcaa9029550
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use __packed so that enums consume the smallest possible size (in our
case the same as uint8_t).
Change-Id: I0440113e88a24509f406375d99173ddb54890925
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Update the advertising API according to what has recently been
discussed and agreed upon.
Naming-wise the most important change is the removal of "EIR" which
was confusing since this is mainly used with LE at the moment. The
Core Specification Supplement consistently uses the generic terms data
and data type to describe what we're dealing with here, so the new
names are bt_data and BT_DATA.
Another change is to detach the actual data from the struct by
converting it from an array to a pointer. This is not only essential
for supporting BR/EDR (which has a different length) but to also
minimize memory usage.
Another change is to require the caller of bt_le_adv_start() to
provide the array lengths of the ad and sd paramters. This way we
don't have to have the empty (8-byte) element at the end of each
array.
Lastly, the bt_le_adv_start() logic is slightly modified so that it
will always clear the respective data if necessary. Previously the
user might have been left with a previous callers data if it passed
NULL to the API.
Change-Id: I318026ceb1b52bb688edf4dcfed82613bd15c3e1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Uses proper bluetooth address during printing to standard output
when monitors connected, disconnected and security changed states
based on established connection transport type.
Change-Id: I87b54ee619c329ffa645bfbb5e453cf673b93181
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Change default board for nble app to arduino_101
Change-Id: I5f8cd57c9834e38125d9e17cd4c3a96427db702a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
If device is operating in security mode 3 PIN request callback
is called before connected.
Change-Id: Ie36363ae7af2398276f9cc4d07126344588b9ae6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Allow to query for connection info in every state. For BR/EDR
connection destination address is valid in every state. For LE
addresses are initialized to BT_ADDR_LE_ANY until connection is
completed.
Change-Id: I0f0abcd0ff0119a82ef8eeb40c8ee3af25eb89b4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This timeout is used only on LE link to cancel ongoing LE connection.
For BR/EDR link controller will handle page timeout.
> HCI Event: PIN Code Request (0x16) plen 6
Address: XX:XX:XX:XX:XX:XX (Sony Mobile Communications AB)
< HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0
> HCI Event: Command Complete (0x0e) plen 4
LE Create Connection Cancel (0x08|0x000e) ncmd 1
Status: Command Disallowed (0x0c)
Change-Id: I6a03da7f935f0c560d57f18abc16069d79e2be69
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This patch updates SM PICS to PTS 6.4 version.
Change-Id: I6944698ea4f91d94f69a6968a123e30b106f8164
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This patch updates GATT PICS to PTS 6.4 version.
Change-Id: I9e1416c1295c273a55a715c7207791e69b36919b
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This patch updates GAP PICS to PTS 6.4 version.
Change-Id: I3a132ffbb1db0da1b0b882a24ef4adbf2b1a77cf
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This is almost exactly the same as the peripheral app, except that it
uses CONFIG_NBLE.
Change-Id: Ia6854bce2a0babd03a3ce3251a173ce7ddbfe374
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Introduce the basic skeleton for NBLE, which is the Bluetooth LE API
implementation targeting a custom firmware running on Nordic
Semiconductor nRF51 chips.
Change-Id: I1ce69d6ee0205e71f6bd8d256d9233c93d2cde41
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If connection was not found or PIN handler is not present legacy
pairing should be terminatde with negative PIN reply.
Change-Id: I8a8658f6eb28173537f39226c3792957a28aa7b2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Move PIN checks up to caller and make pin_code_reply handle just
HCI command.
Change-Id: I159aada8f097407d8ccdc53031ea280e69204091
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no need for tracking if connection object exists.
Change-Id: I14047631b4697f892139a414c248542a2b3ae3d6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Always enable in connection object context fields related to security
requirements and encryption.
So far they were enabled only when Kconfig BLUETOOTH_SMP option is on.
Change-Id: Ib7da9ba1df97df5c08b00769c8ba078dfa63ff56
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Converts bt_keys type to atomic_t flags to enable consistent and
compact key type management.
Change-Id: Ie384168da6d5d0d1b305a33988ce7689ba3a4c6a
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Unified bluetooth address types will simplify tester code.
Change-Id: I6d973ff05a8a8dcabb12c9543cd4d747db3e6680
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Removing unneeded check makes code consistent since there is check only
in one branch. Moreover since code is executed in tx_fiber frag cannot
be NULL (result of bt_conn_create_pdu()).
Change-Id: Id2f19279f604ad52019d9c334bc29641e4341037
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>