All API's receiving bt_conn as parameter shall check if that is in fact
connected.
Change-Id: Ia96c0d4f49d09fa6559f62ce69547636ad346e64
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This patch provides basic functions to send and parse the AT commands.
This patch is the basic version developed with reference to Bluetooth
Handsfree profile.
Change-Id: Ib44774fb0c6f8ce1639d464f12082af8bde72013
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
The bt_driver API was created when Zephyr only had a Bluetooth host
stack, but no controller-side functionality. The only "driver" that
was needed for the host was the HCI driver, and hence "HCI" was
omitted from the name.
With support both for host and controller Zephyr will be getting more
Bluetooth driver types, in particular radio drivers. To prepare for
this, move all HCI drivers to drivers/bluetooth/hci/ and rename the
bt_driver API bt_hci_driver.
Change-Id: I82829da80aa61f26c2bb2005380f1e88d069ac7d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This moves duplicated code that has handling discover rounds into a
helper function.
Change-Id: I0d2d0f64ecee73b83f588949df634f5adda552eb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The controller implementation also uses BLUETOOTH_MAX_CONN, so it
needs to be available even when the host hasn't been configured to be
part of the build.
Change-Id: I31ab42a4f0abe21ae613f5408391446eaf72b35f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Once fragments no longer have any data delete them.
Change-Id: I71e4360d5fb56dea061248210159daf542c3dab1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Those are not needed as convention for internal headers is that
c-file includes required headers in correct order.
Change-Id: Ia5bc0fa056921675e32da4e513d096e1479a38e5
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Use helper for accesing nano_sem count. This fix build error on unified
kernel where nano_sem is wrapped by k_sem.
Change-Id: Iad840e3c635a0fbc3b5eeee2e61479fa3d39ca30
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Those were leftovers copied around when new files were added.
Change-Id: I283d59255a302f15fb027764ae9f761ebf646961
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Make sure global headers are included before local.
Change-Id: I5b80dad1ecc75e3e40249da2e5f7fd7f8d7b3e8f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Remove redundant stack var. The status of connection response is set
directly in l2cap_br_conn_req_reply() based on result parameter.
Change-Id: I6f1f5def51a1a027751930b67caf31eed383e4e6
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Uses more apropriate semantically value to status field applied to
connection response by default.
Change-Id: Icfd9cc6a25674ef1df49138f3fcc79e58f419759
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This simplify buffer handling so that no extra references are needed.
Change-Id: Id99a0a75b39ca8db2216668f76c5a672713075ae
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds support for using SYS_LOG macros instead of prinf when logging.
Change-Id: I4611bfe3b541b6e323dd50e587994a57dcd477f7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes CONFIG_NET_BUF_DEBUG a lot less verbose if the purpose
is not to debug memory operations but just references and fragmentation.
Change-Id: Ie034c2c66715470d8d6d7d29d055678c65a519e5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
zephyr.h includes required headers and has guards for unified kernel
config.
Change-Id: I40b5d95218cee5594c06e5ba3de496a0aca16f2c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Insufficient authentication can be used with almost any security level to
indicate the security need to be escalated not only to high but to medium
and fips depending on the current security level.
Jira: ZEP-1074
Change-Id: Iea261f2814caf5b290997beedcbb0aa7f5a9e890
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Removes the code responsible for reset channel object internals. These
internals will be reset automatically on chan 'destroy' ops as a result
of disconnection that taking place in this case.
Change-Id: I7bb3aaf225797a7c4b17ed2b578f6825114307c9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Reduces code in main handler servicing connection request by use of helper
routine l2cap_br_conn_req_reply() to send connection response. It
involves moving the helper up in code to skip forward declaration and also
makes slight refactor of it to adjust 'pending result' condition in response.
Change-Id: I0a51d908b14ed3b5d6c497d57a99422fc9c44573
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Since for LE CoC connection response 'result' errors can have different
values and semantics this adds proper, according to Core Spec 4.2 [Vol 3,
Part A, 4.3], values relevant for BR/EDR L2CAP CoC 'result' field
in connection response protocol package.
Change-Id: Ie43c87466aaaf47e16520795f3cb7335d86aa57d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Add a new sample application in sample/bluetooth/hci-uart
that acts as a bridge between a UART and the BLE Controller.
It receives commands and ACL data in H4 format over the UART
and passes them on to the BLE Controller to be processed.
It also conversely forwards all events and incoming ACL data
generated by the BLE Controller to the UART.
The application uses the hci_raw interface to pipe the data
to and from the BLE Controller and UART.
Change-Id: Iff7696166a82fe363b2ad4e1abea40103899f927
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Adds internal helper routine sending response to connection request when
BR/EDR CoC channel operates in acceptor role. The routine additionally
can drive the response 'result' value for failure reasons.
Use it then to adjust 'l2cap_br_conn_pend' function to accept remote's
connection request.
Change-Id: I906e07e30939c57b206e9806426897f6e4f2b3dd
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
BT_L2CAP_MAX_LE_MPS tracks exactly how big a single buffer can be so use
that as size for outgoing segment pool instead of the minimun MTU.
Change-Id: I48cfba0e2c4c88f390f2f8a1ce63ff6adfce7c7a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net_buf_frag_add already adds a reference to the fragment.
Change-Id: I28c6bde862c09d1dea0182bc0d08bfc1f4565d06
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Buffer with fragments shall not be reused as they may free unprocessed
fragments on unref.
Change-Id: I09bdc84ccaef03a99d53d87b2b70c8c3a32b5e90
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Instead of requesting the full length just request one buffer at time.
Change-Id: I8f97ecf0a959316e1fadfdedf9e500e61ed26c27
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This change adds support for registering new service records.
Change-Id: I0ff2264d08787fe5f8edf6300259961c3ca52fbb
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
Adds helper defines to mark valid CID values and ranges for CoC on BR/EDR
and LE.
Change-Id: Ib2db3a6a8f4b6565920f47b520e27e3b8cc6c85c
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This way the application can reuse the same callback for multiple CCC
since it can track what CCC is affect by checking the attribute pointer.
Change-Id: I608da643aea07de26b65d67e6db3268d717d0f53
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
There's no need to keep the custom swap_buf & swap_in_place helpers
anymore since system-wide helpers are now available.
Change-Id: I424e3592ab955410455c4226e5bf03df6f522c52
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The Bluetooth initialization now also sets the page timeout value.
Change-Id: I367591c587bdfe135befc07b637af4cf532f55e2
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
Added an option to set the page timeout value. Default the timeout
is set to 5.12 sec.
Change-Id: I196b59f18b9cbf0aaa226ffd85e0bb1699667af2
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
Master is starting SMP over BR/EDR and it may not be a device that
started BR/EDR pairing. Although specification isn't very clear in this
it seems to be the case when checking TS for cross-transport tests.
Change-Id: I7b0a42ab0123fa444b06a4986f6b1410bf1f2789
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This enabled L2CAP CoC to store data in fragmented buffers, due to
increase in memory init_17 test has to be disabled ARC for Arduino 101
otherwise sanity test would not pass.
Change-Id: If04289a03e591473de4e722031c1687a14420fc2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fix following error if BR/EDR support was build without signing
support enabled.
CC net/bluetooth/smp.o
zephyr/net/bluetooth/smp.c: In function 'smp_br_signing_info':
zephyr/net/bluetooth/smp.c:1166:13: error: 'struct bt_keys' has no
member named 'remote_csrk'
memcpy(keys->remote_csrk.val, req->csrk, sizeof(keys->remote_csrk.val));
^
zephyr/net/bluetooth/smp.c:1166:54: error: 'struct bt_keys' has no
member named 'remote_csrk'
memcpy(keys->remote_csrk.val, req->csrk, sizeof(keys->remote_csrk.val));
^
Change-Id: I05393c1b2e12c9a66d8ad3e7906d3aa94a57b193
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If BR/EDR is enabled Pairing Request can also be sent without support
for LE central role.
zephyr/net/bluetooth/smp.c:1326:12: warning: 'smp_br_send_pairing_req'
defined but not used [-Wunused-function]
static int smp_br_send_pairing_req(struct bt_conn *conn)
^
net/built-in.o: In function `hci_encrypt_change':
zephyr/net/bluetooth/hci_core.c:2006: undefined reference to
`bt_smp_send_pairing_req'
net/built-in.o: In function `bt_smp_br_connected':
zephyr/net/bluetooth/smp.c:738: undefined reference to
`bt_smp_send_pairing_req'
Change-Id: I1b68d2412b49f02f42aa146a327252ce107523ca
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This enabled L2CAP CoC to send buffers that contains fragments.
Change-Id: I898b8375f634d3f0652ec1e7f5a206aa47dd232d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
l2cap_chan_create_seg attempts to reuse the original buffer but it did
not check if there is enough space in the user_data in order to send
the buffer with bt_conn_send.
Change-Id: Iad54f5868dfce299903f5e392b3ea3b908d1e533
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When BR/EDR pairing is completed and we are pairing initiator start
SMP over BR/EDR if supported.
Change-Id: I9ff095cb89524693ea0e50a94db41bc1b3ab161f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>