This change shortens the Service Class macro name from
BT_SDP_*_SVCLASS_ID to BT_SDP_*_SVCLASS
Change-Id: I1150baae24428c6b76f005d11003291016e0a03e
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
This change adds SPP as a sample SDP service during RFCOMM
server registration. The SPP channel is now used as the
fixed channel for RFCOMM register command.
Change-Id: I3b5ad3995725adca55db1497d4a35099f6311f3b
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@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>
Add Bluetooth protocol UUIDs to be used in SDP service records
Change-Id: I184cc114ff3fa172d9caa23d0b243a3191bb9773
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.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>
The keys BT_STORAGE_SLAVE_LTK, BT_STORAGE_LTK, BT_STORAGE_IRK allow to store
the distributed bonding keys for ble legacy pairing.
Change-Id: Iaee8b78456e9865a53a2f1228b6afa7ff44bc4db
Signed-off-by: Roger Lendenmann <roger.lendenmann@intel.com>
Added a OpCode definition that can be used to change the Page
timeout value.
Change-Id: I6ec06f6114f75665b161206ef3ebabbab193b04f
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
The list of remote devices for which we have information stored can be
retrieved using this key.
Change-Id: I1476c40177b631d6b2b4049623052245b25ed1b3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The bt_storage_clear() function doesn't modify the data behind the
addr parameter, so the pointer should be decared const.
Change-Id: Icce676f9df80bac26ba4877bb63752559a43339f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Layers (modules) above HCI like L2CAP need to know status of applied
security procedure when it's triggered on existing connection. It gives
them possibility to make action in layer specific context on
post-security-procedure conditions.
Change-Id: Ia10078469847b29bb7eb3b1fb376ac305dd0b0fc
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Fix the following compiler warnings/errors that show up with llvm:
tests/bluetooth/shell/src/main.c:594:2: error:
initializing 'const uint8_t *' (aka 'const unsigned char *') with an
expression of type 'char [11]' converts between pointers to integer types
with different sign [-Werror,-Wpointer-sign]
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/bluetooth/bluetooth.h:93:11: note: expanded
from macro 'BT_DATA'
.data = (_data), \
^~~~~~~
1 error generated.
net/bluetooth/hci_core.c:1759:22: error: passing
'uint8_t [248]' to parameter of type 'const char *' converts between
pointers to integer types with different sign [-Werror,-Wpointer-sign]
name_len = strlen(evt->name);
^~~~~~~~~
lib/libc/minimal/include/string.h:32:34: note: passing
argument to parameter 's' here
extern size_t strlen(const char *s);
^
CC net/bluetooth/log.o
net/bluetooth/hci_core.c:3136:10: error: passing
'uint8_t [248]' to parameter of type 'char *' converts between pointers to
integer types with different sign [-Werror,-Wpointer-sign]
strncpy(name_cp->local_name, CONFIG_BLUETOOTH_BREDR_NAME,
^~~~~~~~~~~~~~~~~~~
lib/libc/minimal/include/string.h:30:39: note: passing
argument to parameter 'd' here
extern char *strncpy(char *_Restrict d, const char *_Restrict s, size_t n);
net/bluetooth/conn.c:301:10: error: passing
'uint8_t [16]' to parameter of type 'char *' converts between pointers to
integer types with different sign [-Werror,-Wpointer-sign]
strncpy(cp->pin_code, pin, sizeof(cp->pin_code));
^~~~~~~~~~~~
lib/libc/minimal/include/string.h:30:39: note: passing
argument to parameter 'd' here
extern char *strncpy(char *_Restrict d, const char *_Restrict s, size_t n);
Change-Id: I342131c6c2b25445382b2317d673561c4087096b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
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 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>
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>
This adds the Read Remote Version Info Complete event,
used in both BR/EDR and LE and required by the LE Controller.
Change-Id: I650411ef2c582c20a90eb73bc4475b5e2d4aa2d9
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This adds the Authenticated Payload Timeout expired event,
used in both BR/EDR and LE and required by the LE Controller.
Change-Id: Ifbbccea6d44a7d432734090e56cbf4e7189362b0
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The advertising report (standard or direct) events require
a number of reports field that is used by the controller
to fill in the structure.
At the same time this fixes the subevent code of the direct
advertising report structure.
Change-Id: I0fdb9b1dcad03615ac9b3f1f38fdfbe9ab3f9c3a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Initialize Handsfree profile for HF Role and register RFCOMM server
channel number to the RFCOMM. And also exposes some basic callbacks
which is required for the application.
Change-Id: Ic79cbd66ef9529c4eb134cc21efcdbc388bb707d
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
Limited number of RFCOMM channels(1-31). Pre-allocated
for profile use and to avoid conflicts.
Change-Id: Ibd081435cf927aa7386161710e48b7371d20af24
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
_SysFatalErrorHandler referenced in BT_ASSERT() is arch
defined. Include nanokernel.h in bluetooth/log.h to include
the necessary arch definitions, as required.
Change-id: Ia39690d2a49db0c9db669a68147fe410abb4213b
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
The BT_HCI_OP_LE_CONN_PARAM_REQ_REPLY and
BT_HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY command complete events contain
a connection handle that serves to match the command with their
corresponding command complete event when there's more than one
pending. For now this just adds the structure definitions required,
and later on code will need to be added to handle possible mismatches.
Change-Id: I4585888b32ec995b18847c2a6ed488a2da9c8520
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The BT_HCI_OP_LE_LTK_REQ_REPLY and BT_HCI_OP_LE_LTK_REQ_NEG_REPLY
command complete events contain a connection handle that serves to
match the command with their corresponding command complete event
when there's more than one pending. For now this just adds the
structure definitions required, and later on code will need to
be added to handle possible mismatches.
Change-Id: I37e88070bc0d4d1b80f085f7e162c30715a82103
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The length of the commands array in the return parameters of
the HCI Read Local Supported Commands event is 64 bytes
according to the spec. This was mistakenly set as 36 bytes due
to the fact that only 36 out of the 64 bytes currently contain
meaningful data. The actual array as received from the driver
will always be 64 bytes however, and is therefore sized
accordingly.
Change-Id: Iee7f1fc18045dff96efcc808fd81661eced37b03
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Data sent by user will be queued in a FIFO. A TX fiber will be
started for each DLC which process this FIFO and write to L2CAP.
Fiber will sleep in two scenarios - no buffer in FIFO, no TX
credit. Credit is handled using semaphore. So if credit is 0
then fiber will wait on semaphore and will be scheduled when
it receives credit.
Change-Id: Id6e796eed594b28d6fb6e4259d3ed52634db9335
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This adds helper support for handling 32bit UUIDs
Change-Id: I4874b5f092bdbe30039b8031485bf856e4268f2a
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
To fully support BT Spec. v4.2 LE Topology use LE read supported
states HCI command to find the supported states in the
controller.
Change-id: I6b4cf4cbefdff44e51bb0a4242e0aef3755f43db
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This adds UUIDs related to HID Service as defined in the assigned
numbers.
Change-Id: I73e8659546587aa9330bcd7d483bc097448e5ced
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Profiles can use this helper to create buffer which reserves the
headroom for rfcomm, l2cap and acl headers
Change-Id: I22f97b54423d66fe0c133a8e9903b652fb6a6854
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
In preparation for the unification of the code in:
drivers/bluetooth/controller/hci
with the existing HCI definitions in Zephyr,
this change addresses both the required usage of spaces
in the alignment of line components that require matching
the alignment of other adjacent lines and also adds all
missing Bluetooth 4.2 LE commands and events so that the
controller code can make use of them.
Jira: ZEP-726
Change-Id: Iabcee6898a09ddaf4479cfe4ecb0eedc194da8a3
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The lmp_*_capable() macros were neither following the appropriate name
space (BT_*) nor the appropriate style (macros should be upper-case).
Introduce a new BT_FEAT_TEST() macro which gives a clearer mapping to
the feature tables found in the core specification. Each specific
feature test macro is now also named with the appropriate BT_FEAT_*
prefix.
Change-Id: Ia6b18b066927908f9bda646e737e63d46a1d17df
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make is possible to use lmp_ext_feat_capable() both for local as well
as remote features.
Change-Id: I05bb6a25303c0dd2f5e0bbc4f7f412210f668aa3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use Read Local Extended Features command to read local features and
extended local features on init.
Change-Id: I4c8594783895f439af36214881aeff24e116e783
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Adds functionality to do connect to remote PSM. Connecting to remote
PSM other than SDP when both support SSP involves raising security
to at least BT_SECURITY_MEDIUM before any CoC traffic on L2CAP layer.
If connection response is send back with status 'pending' it means
remote doing additional job, so restarts RTX timer. If the command
timer is fired detach the apps channel from connection and make it
ready for reuse.
Change-Id: I81f57bc2f5738754f872ce52cb25027db6db5ccf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Sends the data to l2cap after adding rfcomm header. Profile should
reserve the head room for rfcomm, l2cap and hci headers. Data length
should not be more than dlc mtu.
Flow control is not included in this patch
< ACL Data TX: Handle 256 flags 0x00 dlen 38
Channel: 64 len 34 [PSM 3 mode 0] {chan 0}
RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
Address: 0x09 cr 0 dlci 0x02
Control: 0xef poll/final 0
Length: 30
FCS: 0x40
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff 40
Change-Id: Ib97dbf85e236a5f75fda6037bb75bc6be00b9dc7
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This adds queueing support for requests that requires a response making
it simpler to use the API. The storage is keep in the parameters of the
request so it is up to the application to define how many can be queued
but in case the application don't want a request to block waiting for
a buffer it can use BLUETOOTH_ATT_REQ_COUNT to control the available
buffers which is recommended in case the requests will be sent from the
RX fiber.
Change-Id: I407c3982a7ecdc4a9eff7172d9d0addd46949783
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
PN (Parameter negotiation) is used to negotiate parameters like mtu.
Initial credit for flow control is also sent in PN. If the dlci to which
PN requested is not found in the dlc list then it will be treated as
incoming dlc request and accept callback will be called to profile.
Dlc mtu has to be set by profile (before it returns dlc) which will be
negotiated with remote. But the final mtu will be min of mtu provided
by profile, mtu sent by remote, and session mtu
> ACL Data RX: Handle 256 flags 0x02 dlen 18 [hci0] 210.108444
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 122 max_retrans 0 credits 7
< ACL Data TX: Handle 256 flags 0x00 dlen 18 [hci0] 210.111452
Channel: 64 len 14 [PSM 3 mode 0] {chan 0}
RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
Address: 0x01 cr 0 dlci 0x00
Control: 0xef poll/final 0
Length: 10
FCS: 0xaa
MCC Message type: DLC Parameter Negotiation RSP (0x20)
Length: 8
dlci 2 frame_type 0 credit_flow 14 pri 0
ack_timer 0 frame_size 30 max_retrans 0 credits 7
Change-Id: Ifd466db6b3b868d04e38db02ebad6e47ab2da030
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
Each public header file needs the #ifdef guards as well as a
declaration for C++ compatibility.
Change-Id: If270de1ee74e2e74eab02d218417d80fcbf422ac
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>