This patch fixes race condition when g_ble_ll_data.ll_rfclk_state
is out of sync with nrf52_clock_hfxo_refcnt in nrf52_clock.c
It could happen when HCI Reset has been done while scanning/advertising
etc.
This patch also adds OS_ASSERT_CRITICAL() in places where ll_rfclk_state
is changed.
This patch combines all the changes made to this application in Zephyr.
It features a lot of improvements and updates.
With these changes some of the PTS Mesh Model testcases pass.
A conn_handle of 0 should be handled as a valid connection handle while BLE_HS_CONN_HANDLE_NONE should be the proper assignment for the cases where the connection is no longer valid. This fix includes some spotted areas where a check for a valid connection handle is not properly handled.
Set enc_stat in the LL_ENC_REQ handler and not when sending LL_ENC_RSP.
This is in order to make sure that next incoming PDU will be
alread verified
This fix small rate of failures of LL/SEC/SLA/BI-05
Before:
1. Nimble is a peripheral
2. A connection is established with a peer device
3. Peer device subscribes for notifications/indications on a CCCD
4. Bonding with a peer device
5. Peer device disconnects and reconnects
6. The indication setting is not restored
After:
1. Nimble is a peripheral
2. A connection is established with a peer device
3. Peer device subscribes for notifications/indications on a CCCD
4. Bonding with a peer device
5. CCCD values are persisted
6. Peer device disconnects and reconnects
7. The indication settings are restored
Fixes issue #319
Previously there was a bug when iterating over included services.
Moreover the handles for included services were not assigned, which
resulted in wrong handle for all attributes placed after the included
services in the database. This patch fixes it and improves information
displayed by this function.
Sending a model publication message could fail e.g. if there are no
buffers available, however this doesn't mean that we should stop doing
periodic publishing indefinitely. When an error occurs, make sure to
call the publish_sent() function so that the periodic publishing timer
gets resubmitted if necessary.
Sending a model publication message could fail e.g. if there are no
buffers available, however this doesn't mean that we should stop doing
periodic publishing indefinitely. When an error occurs, make sure to
call the publish_sent() function so that the periodic publishing timer
gets resubmitted if necessary.
Tracking of the BT_MESH_VALID flag and the PB-GATT state was rather
fragile. Add proper error returns to the various GATT service enable &
disable handlers, and toggle the BT_MESH_VALID flag in a single file
(main.c). Use the newly added error returns to ensure that we don't
re-enable PB-GATT if it wasn't already enabled from before.
There's already a flags member in the bt_mesh context, so take
advantage of that for any boolean members that have so far been
bit-fields. This should produce more efficient code, also for the
sequence number that's now its own u32_t.
Currently, when handling a Friend Request message with `prev_addr` set,
we look up existing friend entry using `prev_addr` as the address.
However, `prev_addr` is the address of the requesting node's previous
friend, NOT the address of the requesting node itself. Therefore, we
should always look up existing friend entry using `rx->ctx.addr` as the
address.
When we're acting as a Friend for an LPN, we need to consider all
elements of the LPN. The information of how many elements the LPN has
is provided in the Friend Request message, however until now the code
did not do anything with this information.
Fix the issue by tracking the number of elements for each LPN and
update the unicast address matching code to take this into account.
Experiments have shown that the probability of missing advertising
packets is significantly lower with 30ms scan window compared to 10ms
scan window. This is especially the case with advertisers using a 20ms
advertising interval, which in turn is perhaps the most common one
since it's the smallest allowed by the Bluetooth 5.0 specification.
The current method relies heavily on the linker/compiler to
do the correct operation. Which is to eliminate the code that will
never get called. This posses a problem if the build even changes
by a smallest fraction.
The current patch will enforce proper inclusion of the code at the
pre-processing stage. Thereby not relying on the compiler/linker to
do the right thing.
The ordering of items in flash is not guaranteed, so it's possible we
get an App Key before the corresponding Net Key. Remove the check for
a Net Key, since the storing code should never store an App Key if
there is no corresponding Net Key.
In some cases the application might only initialize its UUID after
calling bt_mesh_init(), e.g. in the case of deriving the UUID from the
identity address. To avoid confusing logs, only print the UUID when
actually enabling one of the provisioing bearers.
If slave requested symmetric PHY on PHY change we should either change
both directions to the same PHY or leave both unchanged.
This fixes LL/CON/MAS/BV-117C.