API Implemented Connect API. This can be used to establish A2DP connection.
Change-Id: I8cf714283a452c40b33fd46de442514a1341264c
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
The maximum allowed values in Kconfig were quite conservative.
Change-Id: Icd2d09a2d52fbbaf03671147f08e08385c6776c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
As per the coding guidelines spaces should be used for allignment
of macros.
Change-Id: I8947af32ec64ef3791a88bc3ff151f2fbb3c8480
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
The reference counting has been an internal trick to handle the TX
fiber, but it's not really needed since we can do the same thing with
the help of the state value.
Change-Id: I9cdaed9afb0b0c07e23d599637328cb863c123b3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
dlc will be destroyed when ref count reaches 0.
This also moves calling user disconnected callback to destroy
since disocnneted callback will be called whenever dlc is
destroyed regardless of dlc previously been in connected state
or not.
Change-Id: I4a13f8118704c59a88923b74e538063c0db11d77
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
DM (Disconnect mode) response is to inform the peer that dlc
is in logically disconnected state. It can be used to reject
an incoming SABM or PN request as well.
For example if a PN request comes to a server channel which is
not registered, a DM response can be sent.
> ACL Data RX: Handle 256 flags 0x02 dlen 18
Channel: 64 len 14 [PSM 3 mode 0] {chan 0}
RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
Address: 0x03 cr 1 dlci 0x00
Control: 0xef poll/final 0
Length: 10
FCS: 0x70
MCC Message type: DLC Parameter Negotiation CMD (0x20)
Length: 8
dlci 2 frame_type 0 credit_flow 15 pri 7
ack_timer 0 frame_size 195 max_retrans 0 credits 7
< ACL Data TX: Handle 256 flags 0x00 dlen 8
Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
RFCOMM: Disconnect Mode (DM) (0x0f)
Address: 0x0b cr 1 dlci 0x02
Control: 0x1f poll/final 1
Length: 0
FCS: 0x73
Change-Id: I1f7576ad97590eed147505802f59faadacc790ea
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This ensures ADVTP patches are build tested with debug enabled.
Change-Id: I5c09afea4a9df84b054d2383f0b53ff85fa5dcd5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
conn->handle belongs to core stack space. Apps shouldn't get access to
it. This fixes build/compiler error when Kconfig's DEBUG_AVDTP is defined.
Change-Id: Id188b367e1e4b7d377a7ef59c0f672229ad98fd8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
The protocol for audio distribution shouldn't have references to internal
core stack space.
Change-Id: Ifce00856dfb8e48d406f815d54cf4b493a7a2770
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
The profile code as sort of user application shouldn't use internal core
stack headers.
Change-Id: I3c6aabf0ee8e1bedac0bd99ebc8526d735219369
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This board was recently renamed, but apparently this reference was
left out.
Change-Id: I9789fa45eab6a9b3118f0f0857ef2207311597f3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This makes it possible for protocols to reserve headroom for their own
headers.
Change-Id: I64530febc4b86b45a379660197f0ff63671fab6e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Whenever turning on HFP HF support there's a need to toggle on
automatically RFCOMM support.
Change-Id: I2fb75c09534d0b6e49a403a527e1caa7d6f9ffaf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
As part of an effort to closely integrate with Zephyr OS,
removed the custom implementation of IRQ interfaces used
in controller code.
Jira: ZEP-841
Change-id: Ie427f45aeecad51053112371526cb7dc4817248f
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Code under SCHED_ADVANCED macro in ctrl.c is used to
disable advanced radio time space scheduling calculations
used for placing non-overlapping observer and master roles;
to populate connection parameter request/response PDU
fields, and autonomous generation of slave initiated
connection parameter requests.
This macro shall always be enabled for optimal and correct
operation of the controller, It shall only be disabled to
debug failures in other part of the controller, to rule out
this code's influence, if any, on the failure being
debugged.
Change-id: I04e5f837ef0a5658361bd3668f583f1e13504570
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
The profile (application layer) shouldn't use direct (de)references
to internal stack context members.
Change-Id: I772134a5016de6706c30f058545b3c64c0894202
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Place __packed at the end of the structure definition in line
with the rest of the Zephyr codebase.
Jira: ZEP-732
Change-Id: I25aa731cbd188a6e23ca2035eb22fa919295bb25
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This makes all flags used for BR/EDR L2CAP be stored in single place.
Connection oriented flags and signaling flags are now sharing same
atomic.
Change-Id: If01b29009f9c60ed529338122992b9b5e31f883a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Leftover from previous commits, this macro is not used anymore in
the HCI implementation.
Change-Id: I376c92a6b68432d2ff818ea25e68f087131e8479
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Sends UA response for the DISC request from peer and clean up
dlc. Disconnected callback will be called to profile. Dummy
buf and credit will be used to wake up the tx fiber for exit
and cleanup.
> ACL Data RX: Handle 256 flags 0x02 dlen 8
Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
RFCOMM: Disconnect (DISC) (0x43)
Address: 0x0b cr 1 dlci 0x02
Control: 0x53 poll/final 1
Length: 0
FCS: 0xb8
< ACL Data TX: Handle 256 flags 0x00 dlen 8
Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
RFCOMM: Unnumbered Ack (UA) (0x63)
Address: 0x0b cr 1 dlci 0x02
Control: 0x73 poll/final 1
Length: 0
FCS: 0x92
Change-Id: I4ec19a93d13a95a9cf4fc5a9beaf48ba8c98689d
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This fixes data passed to the BTP Device Found event.
Change-Id: I1ab465b87ce24f3ea10b7217c254aafaee494c91
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Moves RFCOMM frames max length settings directly under the main RFCOMM
selector for better relations readability. It uses 'depends on' clause
for RFCOMM dependency and proper indentation.
Change-Id: Ic4dc0ffddaf8b438ace1f455191b7a707c0e9ed6
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Use the net_buf structure directly when populating incoming
ACL data or asynchronous events. This ensures that no additional
memcpy() operations are required and removes completely the
statically allocated buffers in hci.c.
Jira: ZEP-726
Change-Id: I6ac8bd0becb7037ce8ecfac109f44832d23fcfd2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This was initialy done in SMP code but was lost when moved to HCI ECC
emulation. With this patch if CONFIG_BLUETOOTH_USE_DEBUG_KEYS is set
ECC emulation code uses debug public and private keys as specified
in Core Specifitation 4.2 Vol 3. Part H 2.3.5.6.1.
Change-Id: I626e7e1c6bde2baeae642d6f2c60c324fdd0369f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
gen_method_legacy is used only if SMP SC only mode is not enabled.
This fix compilation warning on some GCC version.
Change-Id: I183c5d0072c2f76da78bf0d2b1077c8d0620f688
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This is no longer used and can produce warning on some GCC versions.
Change-Id: Ib19903ea41d6446983a738ea99912dc5ba9b88f8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Preallocate a response event net_buf buffer before processing an
incoming command and provide it to hci.c so that it populates
the event directly, instead of using a temporary buffer than
must then be copied into the return net_buf.
This applies exclusively to Command Complete and Command
Status, since those are the only events that are sent in
direct respone to an incoming command.
Jira: ZEP-726
Change-Id: Ia3ea71ac497690af929c44308760f68491ea829e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
If an indication is received while there is an outstanding request the
code will attempt to get a buffer from req_pool to confirm which may
block causing the RX fiber to lock and probably crash as the request
won't release the buffer until it gets a response or timeout.
JIRA: ZEP-940
Change-Id: I3df30db473a0c6c6c3e63b1d0b410a50bdd3accf
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Instead of copying the net_buf contents into a temporary
buffer byte-by-byte, the Controller HCI code now handles
incoming commands and ACL packets from the Host directly
in the net_buf containers, to avoid unnecessary memory
copying and to align with the rest of the Bluetooth stack.
Jira: ZEP-726
Change-Id: I9802607d84ee6206218b711e7e6e23dafb70581a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This makes sure A2DP support is build tested on each patch.
Change-Id: I9dba5c20d44d8ac92910e80c1ad97ac8d2207652
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes sure AVDTP support is build tested on each patch.
Change-Id: Ia7cf94ca84fa01bd676a99b0df58ac745bbfc8c7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes sure RFCOMM support is build tested on each patch.
Change-Id: I9cd60da1b0ab0db2b41487393fb59fe1b415ea01
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
As part of the effort to consolidate the BLE Controller's
HCI layer, the functions in hci_driver.c now use the "hci_driver_"
prefix when it is sensible to do so, and prefixes have been
removed altogether when they are not required.
Jira: ZEP-726
Change-Id: Icd3e56e0170f15636245ea12a389a5a9e86c166c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add PTB22, PTE26, and PTB21 to the frdm_k64f pinmux table, and helper
macros to board.h to map them to red, green, and blue LEDs respectively.
Change-Id: I257621467e71dfd9bdc5d97d6da444dfb5c58b2b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Add PTC6 and PTA4 to the frdm_k64f pinmux table, and helper macros in
board.h to map them to SW2 and SW3 respectively.
Change-Id: Ia30df9015d6d3c09131b4fbb2f2009ee745f7268
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Building samples or running sanitycheck script fails with
the following error using python 3:
Using /home/xekarfwtos/projects/zephyr as source for kernel
GEN ./Makefile
CHK include/generated/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/gen_idt/version.o
HOSTCC scripts/gen_idt/gen_idt.o
HOSTLD scripts/gen_idt/gen_idt
HOSTCC scripts/gen_offset_header/gen_offset_header.o
HOSTLD scripts/gen_offset_header/gen_offset_header
CHK misc/generated/configs.c
CHK include/generated/offsets.h
CHK misc/generated/sysgen/prj.mdef
UPD misc/generated/sysgen/prj.mdef
File "/home/xekarfwtos/projects/zephyr/scripts/sysgen", line 687
kernel_main_c_out("K_MSGQ_DEFINE(_k_fifo_obj_%s, %s, %s);\n" %
^
TabError: inconsistent use of tabs and spaces in indentation
This patch fixes the indentation inconsistency allowing building
using python 3.
Change-Id: I51bda9452e7ff97fe9f07544927d76ce981700d1
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
The '__unused' tag can be used to inform the compiler that a variable
might be deliberately unused. It can be used instead of ARG_UNUSED().
Change-Id: I0ec4ee92dcec29b5f9cbda362d0d6b051055628a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Mirrors kernel.h to allow both nanokernel and microkernel applications
easy access to section tags such as __noinit.
Change-Id: Ie01395ac63393b7afbebfe26c723702918bfe9ff
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>