This patch adds initial support for enhanced LE CoC.
For now we allow for MTU reconfiguration as it bilongs to the
application.
We do not allow for MPS reconfiguration, as it is assumed that MPS
is always used the biggest possible.
However that might change as we start PTS testing.
Some of the initial verification has been done with PTS
To enable feture BLE_L2CAP_ENHANCED_COC shall be enabled along with
BLE_VERSION >= 52 and non zero BLE_L2CAP_COC_MAX_NUM
A recent newt change removed final-atom support
(https://github.com/apache/mynewt-newt/pull/381); this has a side-effect
that results in the "unittest" target not being found if is not located
in the repo where tests are being run (it does not search for "unittest"
inside @apache-mynewt-core anymore). So add the same "unittest" target
that already exists in @apache-mynewt-core repo here.
Signed-off-by: Fabio Utzig <utzig@apache.org>
Updating these files requires some manual work so no one is actually
doing it when they add new features. This script may improve this
situation or at least serve as a documentation of this "feature".
When host updates suggested data length we should also update values for
coded and uncoded PHYs since these values will be used when connection
is initialized. Otherwise we will basically disregard host suggestion
when PHY support is enabled (which we can do, but we do not want to).
1st DTM packet does not take scheduler offset into account so actual
start time is before RFMGMT enable time and this apparantly makes things
go out of sync.
This also makes scheduling more intuitive as we keep track of TX start
time separately from scheduler item (as in advertising) so scheduler
start_time can be updated with scheduler offset in-place (as it is
already done) without risk that we use invalid value somewhere.
If advertising event is interleaved by current periodic event offset
was calculated from that event, and not future event. This resulted
in sending SyncInfo with offset=0 which was causing random failures
on LL/DDI/ADV/BV-56-C qualification test.
This fixes PHY switch in case slave tries to change from asymmetric to
symmetric PHY and the target PHY is one of currently used PHYs. The
issue is because we first calculate PHY change in both directions and
only then check if slave requested symmetric PHY. However, since either
m_to_s or s_to_m are already set to 0 (due to no change required), the
subseqent checks assume we should not change PHY in either direction.
The current behavior is technically correct, since master is always
allowed to leave PHY in both directions unchanged, but it's just dumb
since we should make a change assuming our PHY preference allows it.
To fix this we basically skip PHY calculation if we determined that
slave requested symmetric PHY and we can apply it in both directions.
If requested symmetric PHY cannot be applied in at least one direction,
we leave both directions unchanged. If there was no request for
symmetric PHY from slave, we calculated PHYs as usual.
It is possible that scheduler already fired and aux data is NULL so
we should unref it only if scheduler item was removed.
ble_ll_scan_aux_data_unref (aux_data=<optimized out>) at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll_scan.c:1079
1079 BLE_LL_ASSERT(aux_data);
(gdb) bt
#0 ble_ll_scan_aux_data_unref (aux_data=<optimized out>) at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll_scan.c:1079
#1 0x0001f732 in ble_ll_scan_rx_pkt_in_on_aux (pdu_type=<optimized out>, om=0x2000d6f8 <os_msys_1_data>, hdr=0x2000d710 <os_msys_1_data+24>, addrd=addrd@entry=0x20004ecc <g_ble_ll_stack+404>)
at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll_scan.c:3156
#2 0x0002010e in ble_ll_scan_rx_pkt_in (ptype=ptype@entry=7 '\a', om=om@entry=0x2000d6f8 <os_msys_1_data>, hdr=hdr@entry=0x2000d710 <os_msys_1_data+24>)
at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll_scan.c:3198
#3 0x0001299e in ble_ll_rx_pkt_in () at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll.c:837
#4 0x000129de in ble_ll_event_rx_pkt (ev=<optimized out>) at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll.c:1164
#5 0x00012830 in ble_npl_event_run (ev=<optimized out>) at repos/apache-mynewt-nimble/porting/npl/mynewt/include/nimble/nimble_npl_os.h:116
#6 ble_ll_task (arg=<optimized out>) at repos/apache-mynewt-nimble/nimble/controller/src/ble_ll.c:1214
#7 0x00038e9c in nrf52_clock_hfxo_release () at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h:37
#8 0x00000000 in ?? ()
e8f9ecca changed values for S2 and S8 phy modes. This did not affect LL
code since it was using symbols everywhere, however in nRF52 PHY timings
are indexed by raw values so LE Coded timings are now used incorrectly.
To avoid such issues in future, let's just index arrays with timings
using proper symbols.
Core Specification 5.2 clarified HCI behavior for periodic advertising
with regards to reconfiguring advertising instance and checking
data length against periodic advertising interval.
It makes more sense to use S=8 by default as we can assume that LE Coded
is used for Long Range so we should use best possible coding scheme at
the expense of data speed.
According to Mesh Profile Spec 1.0.1, Section 4.2.11:
"If the Proxy feature is disabled, a GATT client device can connect
over GATT to that node for configuration and control. Messages from
the GATT bearer are not relayed to the advertising bearer."
Moreover some notes have been removed from the spec compared to
version 1.0:
Mesh Profile Spec 1.0, Section 4.2.11:
"Upon transition from GATT Proxy state 0x01 to GATT Proxy state 0x00
the GATT Bearer Server shall disconnect all GATT Bearer Clients."
"The Configuration Client should turn off the Proxy state as the last
step in the configuration process."
Mesh Profile Spec 1.0, Section 4.2.11.1:
"When the GATT Proxy state is set to 0x00, the Node Identity state
for all subnets shall be set to 0x00 and shall not be changed."
This patch changes name of two features related to sync
transfer:
BLE_LL_FEAT_SYNC_SEND -> BLE_LL_FEAT_SYNC_TRANS_SEND
BLE_LL_FEAT_SYNC_RECV ->BLE_LL_FEAT_SYNC_TRANS_RECV
as there is new feature call
BLE_LL_FEAT_SYNC_RECV (Synchronizer receiver)
added in following patch
This is not recommended for extended advertising chains and forbidden
for periodic advertising chains.
This was affecting LL/DDI/ADV/BV-61-C qualification test case.