User can now use self-defined BLOB ID for transfer instead of using
random one each time. This allows to send multiple FW Update Start
messages with same BLOB ID, for example to resume previous one.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
If device rebooted while in `BT_MESH_DFU_PHASE_TRANSFER_ACTIVE` phase
we should not recover into it, but set `BT_MESH_DFU_PHASE_TRANSFER_ERR`
instead. It's because we no longer remember which block is currently
transfered so new FW Update Start must be received and transfer
restarted.
If device rebooted while in `BT_MESH_DFU_PHASE_VERIFY_OK` it means
we didn't manage to apply image before reboot. We should enter
`BT_MESH_DFU_PHASE_VERIFY_FAIL` phase, which will allow to verify it
again and possibly apply. This is with agreement to specification
regarding receiving FW Update Start when FW is already received.
This commit also alligns handle_start with specification: when
FW is already received, we should set phase to
`BT_MESH_DFU_PHASE_VERIFY`, send Status message, then proceed to Verify.
Previously, `verify` was called before sending status, so status
contained phase set to `BT_MESH_DFU_PHASE_VERIFY_OK` or
`BT_MESH_DFU_PHASE_VERIFY_FAIL`. This would prevent DFU Client
enter refresh procedure.
`blob_recover` also expects BT_MESH_DFU_PHASE_TRANSFER_ERR now.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
These targets already received FW so there is no point to transfering
it again. What's more, these targets will not accept transfer and will
be dropped by DFU Client. If FW is already received DFU Client should
skip transfer and proceed to refresh procedure.
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Move all audio related shell implementations to the
audio directory, to use the same structure as Mesh.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove ad-hoc `CHAR_SIZE_MAX` in favor of `BT_ATT_MAX_ATTRIBUTE_LEN`.
The maximum size of an attribute is the same as the maximum size of a
characteristic.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Implement a custom abort_cb callback to perform Tx and Rx
flush and adjust the SN/NESN values.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ull_prepare_dequeue to not skip events when preempt
does not match the event in the head of the prepare queue.
The head of the prepare queue does not match when
ull_prepare_dequeue has put the head of the queue to the
last of the queue when it is calling lll_resume interface.
This happens when there is already an active event which
needs a preempt timeout to be setup and there is another
non-resume event in the pipeline which now becomes the
head. The fix ensure to restore the order of the events
if a preempt timeout was to be setup.
Currently ull_prepare_dequeue loops through all events
before stopping at the original way the queue was. This is
not efficient and is a scope for improvement in future.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Connected ISO time reservation that was missing the
event start and end overhead values.
Fix missing event end overhead values in ACL connection
time reservation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Calculate CIS offset of secondary CIS(es) using CIG reference point.
This fixes issue with e.g. two CISes associated with separate ACL
connections.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This commit enables having multiple CIS/CIG setups/connects and
teardowns in sequence.
- For central, cig->lll.num_cis is initialized to cis_count and
untouched until ll_cig_remove. The value shall indicate number of
allocated instances, to ensure correct CIG traversal.
- Keep CIG/CIS instances for central until ll_cig_remove
- Initialize CIS instance state vars in ll_cis_create, similar to the
peripheral flow.
- In ll_cig_remove, always release streams and CIG instance. Do not
remove paths, as this is done from host at bt_iso_chan_disconnected.
- Remove unsued cis_count member in ll_conn_iso_group.
- Use correct function ull_iso_lll_ack_enqueue at LLL flush to have
data path respected.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Some recent PRs included conditional compilation for
KCONFIG_BT_LL_SW_LLCP_LEGACY, which must be removed.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The slot reservation code is only valid for the refactored LLCP;
a guard was in place to ensure that it was not compiled in for
legacy controller code. This commit removes this guard
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
This commit removes the code related to advanced scheduling from
ull_sched.c, since this code only works for the legacy controller.
Implementing advanced scheduling for the refactored LLCP is tracked
in its own issue
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The code that was added for delaying notifications to the host,
which was only implemented for legacy controller, is removed
in this commit
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
This commit removes the legacy LLCP code including the
Kconfig option
It also updates the babblesim tests, and removes the
tests for the legacy controller
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
The copying from the presets to the stream codec and qos
structs were not done in a way that worked. Fixed by doing
a more proper and deeper copy.
This also fixes a small issue with using the wrong
default preset.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
After commit 3486f133e9
GATT Proxy service registration is broken because it is registered from
settings_load() in mesh_commit(). Because mesh_commit() is called before
sc_commit() is called in gatt.c, bt_gatt_service_register() can't be
called yet.
Use k_work to postpone the service registration.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The BT_BAP_UNICAST_CLIENT_PAC_COUNT is there due to a merge conflict
gone wrong. Removed again.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove redundant use of local variable chan_idx in the
lll_chan_iso_subevent() function.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For ISO-subevents channel selection must use remap table always
-regardless of channel is a mapped or unmapped channel.
Signed-off-by: Henrik Møller <heml@demant.com>
Ensure that the stream released callback is only called after
the CIS has disconnected. Since the ACL disconnect event
may come before the CIS disconnect event, we use the
unicast_client_ep_idle_state in the unicast_client_reset
function to use the existing state verification, and only
after both the ACL and CIS has disconnected, we
finalize the reset of the stream and call the released
callback, assuming that the CIS can be disconnected.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BT_ISO_STATE_DISCONNECTING was never set when the
CIS was actually in the disconnecting state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Previously we assumed only a single stream, and deleted
the unicast group on the first stream released.
Now we wait for all the streams to be released before
deleting the group.
This still assumes that all streams are initiated by us
as the client, and will not work if using the
BAP unicast client and server role concurrently.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove a bad LOG_ERR that should never have been merged.
Added the valuet that was logged to the debug log statement.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The conditions of the assert were incorrect compared to the
text, and caused an assert to happen when it shouldn't.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The timeout used upon opening the link with the server relates to the
PB-Remote Link Open procedure, but not to the whole provisioning
procedure. For the provisioning procedure, the timeout should be at
least 60 seconds as explained in section 5.4.4.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit fixes an issue where the RPR Client gets stuck after sending
PDU to RPR Server (even with segmented flag), but doesn't hear anything
back from the server.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit fixes an issue, where the RPR Client gets stuck forever
until reboot if it doesn't receive Link Status or Link Report message
when openinig the remote provisioning link.
The RPR_CLI_LINK_OPEN flag was used to control the remote provision link
and protect against receiving an unexpected message, but it didn't cover
a case when neither of messages were received from the RPR Server.
cli->link.state only changes by Link Status or Link Report message and
is set to BT_MESH_RPR_LINK_IDLE when opening the link. Therefore, when
the RPR Client's timer timed out, the client didn't reset its internal
states.
This commit adds an additional state to cover this intermediate state
when the client initiated the link opening but didn't receive any
response.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
To enable Bluetooth controller coexistence feature, there is
implementation of ticker task, which aborts any ongoing radio events
during assertion of the grant pin. This solves the co-existence issue
in the role of the subordinate transceiver.
Signed-off-by: Tomáš Beneš <tomas@dronetag.cz>
Remove redundant EVENT_IFS_US used in Control PDU timing
calculation. The BIG radio event ends with Control Subevent
and hence there is no need to add EVENT_IFS_US at the end
of the BIG event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO Sync Receiver PDU reception to enqueue towards ULL
any PDUs that where received before the BIG event in
unreserved timespace is aborted due to overlap with other
radio events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In the case of a constrained system that uses dynamic channels (ie, not
much initial credits), the user's log would be flooded with those three
messages.
This is not really an error per se as the stack will handle it properly and
reschedule the sending of the buffers as soon as more credits arrive.
Thus downgrading the severity of
- the l2cap messages, as they are only compiled when dynamic channels are
enabled
- the conn message. Reporting the error belongs in the upper layers.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This moves bt_data_parse function outside of hci_core.c.
Having it in separate file makes unit testing easier as the
function do not use kernel objects, thus can be used in unit tests
without a need for adding any mocks.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Avoid the use of weak functions and call the respective functions only
if vendor-specific data path is supported. The weak dummy functions
will not implement the desired behavior anyway. This change makes it
explicit that these functions need to be implemented by the vendor.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
When releasing a stream as the unicast client, we may get
either the ASE state notification with state idle or
the control point notification first. If we get the
ASE state notification first, we pretend we get the
CP notification first, and call the release callback.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the unicast client operation callbacks to the shell, simply
printing the values sent by the server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add callbacks for control point notifications sent by the
unicast server. These will allow the upper layers to know
if and why a specific operation failed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The "Invalid Length" response code was called truncated,
which does not match the spec definition.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implemented:
-- Released framed padding PDUs when data received in SDUs for a given
event do not fully utilise BN.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
When building with an LLVM toolchain get the following warning:
bluetooth/mesh/pb_adv.c:774:4: error: expression which evaluates to zero
treated as a null pointer constant of type
'void *' [-Werror,-Wnon-literal-null-conversion]
PROV_BEARER_LINK_STATUS_SUCCESS);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by adding a cast to (void *).
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Adds persistent storage for SAR server RX and TX set cmd parameters.
Also ensures that SAR RX and TX parameters are set back to default values
upon reset of the mesh device.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Fix NULL dereference when dereferencing txing_stream, which was used
instead of default_stream.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Inherit BT_ISO_TX_BUF_COUNT value when BT_ISO is enabled
to set BT_CTLR_ISO_TX_BUFFERS count.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>