The commit will address the test failure of connectivity-netsocket-tests-tests-network-interface.
In the test, serial channel will break with the sequence: ESP8266Interface::connect() > disconnect() > connect()
In the first connect, both board's and ESP8266's serial flow control default to disabled, and then enabled.
In the second connect, board's serial flow control keeps enabled but ESP8266's resets to disabled, causing inconsistency between two ends.
The approach: Explicitly disable board's serial flow control on re-power or reset in (re-)connect
On interop test 1.2.2.4, Join Request retransmission is expected to be 6
s + worst case air transmission. This delay is to accommodate for
JoinAccept through RX2.
The `call_in` in process_reception_timeout of RX2-window adds 500 ms
delay between RX2 symbol-interrupt-timeout and the next join request
retransmission. This is an isolated change and only affect the
retransmission of Join Request.
Adding this delay improves the chance of succeeding test
1.2.2.4 (subset of 1.2.2)
Fixed issue on LoRaWANStack based on lorawan v1.0.2 specification page
24 line 25-27. The specification mentioned that that end-device shall
stop retransmission when receiving ANY downlink on RX1 or RX2 window.
- Removed conflicting behavior in
LoRaWANStack::post_process_tx_with_reception()
- Updated comment section of nb_trials at lorawan_data_structures.h
A bug was detected when the uint8_t SUBGRF_GetFskBandwidthRegValue( uint32_t bandwidth )
is called and the bandwith argument has a value of 0.
Comparing the code to the STMCubeWL 1.1 we can see that an if statement is missing to
address the condition where bandwith is equal to 0.
Added the if statement to the radio driver to account for this edge case.
Some LoRaWAN modem like SX1272 can receive downlink packets with RSSI level less than -127. So "int8_t" is not enough for store all possible RSSI values. For example, SX1272 has sensitivity at -137 dBm.
Problem was manifested in the file "SX1272_LoRaRadio.cpp" at SX1272_LoRaRadio::handle_dio0_irq() method.
When value of _rf_settings.lora_packet_handler.rssi_value calculated incorrect RSSI will be stored. Example case:
Value readen from register REG_LR_PKTSNRVALUE _rf_settings.lora_packet_handler.snr_value equals -47.
Value readen from register REG_LR_PKTRSSIVALUE equals 17.
RSSI_OFFSET equals "-139", snr equals "-11".
For case MODEM_LORA value calculated by formula:
_rf_settings.lora_packet_handler.rssi_value = RSSI_OFFSET + rssi + (rssi >> 4) + snr;
and result value will be "124" because of int8_t overflow so it's not correct value (too high).
Correct value must be:
-139 + 17 + (1) + (-11) = -132.
Another motivation: at all other places int16_t type used to store RSSI value.
As a default implementation is already provided by
NetworkStack, stub implementations in the child classes
are not required. Furthermore, they return unsupported for
all cases instead of redirecting to the non-control API,
which is plainly wrong.
9a9085d4cd Updated coap service to be compatible with mbed TLS 3.0 (#135)
git-subtree-dir: connectivity/nanostack/coap-service
git-subtree-split: 9a9085d4cd74ad96320f448a890df43a0cdedbb0
225a4af94f Remove files from tests folder
58d2c8fa82 Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3273 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e81b1 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7ab39 Adjust trace levels (#2692)
681d9eae8d Added reset for pan id and version to BR network start
30d4fb2ed9 Renaming and cleaning ws bootstrap (#2688)
e0da19dbf0 Add Wi-SUN host configuration (#2690)
50ecc3d0f0 Refactoring Wi-SUN stack (#2686)
9d2386d484 Renamed operation mode to operating mode.
2f755bcfdb RF config resolver and some refactoring (#2683)
86c6d19e06 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2a62 Config: Remove additional HAVE_WS_ROUTER (#2684)
cdd7f2d868 Added API for configure supported Phy capability.
a00a3c0a02 Wi-SUN FAN 1.1 PCAP IE update
2d063d3b4a Moved State machine and timer functions to own files
edb8bec609 Corrected system time check function return values
85358a635b Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde485 MAC to support mode switch on single channel (#2678)
1006d29e4d Added storing of PAN ID to NVM in BBR
7bf0028c66 Corrected system time jump detection on BR startup
e60974d815 Split Wi-SUN bootstrap to device types
a3f341266e MAC data req: API to support mode switch (#2674)
cad5122a90 Removed automatic network size configuration (#2673)
35d313224a MAC: Callback set to resolve PHY mode ID (#2672)
0c5faca469 Added support for large system time changes (e.g. due to NTP) (#2670)
c94b306431 LFN version and LGTK Hash IE advertisment and learn
8e075119f6 Use FAN version constant instead of pure number
a5566b22b2 Channel Plan 2 validation and FAN 1.0 reject
42dba4151e Wi-Sun IE FAN 1.1 update
1d56070c24 EU channel plan ids (FAN 1.1) supported (#2668)
fc4f41fb30 Add test API empty function
37efc7ec25 Add version 1.1 basic support
e1558fbb1a Implemented mode switch PHR build and parse (#2665)
cbd8a15d31 Corrected frame counter storing threshold check
37f7ae95eb Time configuration distribution using DHCPv6 vendor data
7415bc724b Added checks for Border Router frame counter space exhaustion (#2660)
f1a65ecbe8 Mode switch PHY API (#2663)
e54231b5d4 Do not check buffer age when virtual RF driver used (#2662)
cc8c7bd38f arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91bce Fix dubious semicolon in #define
2ff51abeca Remove extra '\n' in traces
19376c8837 Simplify array indexes
c808661836 Fix ASAN warnings about overflows in bit shifts
f998008f60 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541d70 Wi-SUN header and Paylod IE element lenght future proof update.
935898badf Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfeb24 Updated nanostack to be compatible with mbed TLS 3.0 (#2657)
29744e0e46 If Router Solicitation creation fails no longer tries to retry the RS right away (#2655)
2b889e92b0 Added automatic test procedure triggering during bootstrap
ed9eb0503f GTKs are removed only when fresh GTK hash is received
81ecdc24f8 Added empty function for test procedure trigger
14439b4aa9 Added support for triggering test procedures
b8a67a9e36 Update CHANGELOG.md for Nanostack 14.0.0 (#2649)
git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af94f3faf5ca3726e86bc96cdda4c99a469
Greentea tests run on microcontrollers, so any required drivers need
to be available and built.
Note: Even though unit tests do not require drivers, for ease of
maintenance there's no need to exclude those drivers when building unit
tests because a driver only gets enabled when the Mbed target matches.
When unit tests or unit test stubs get added as CMake targets, they
becomes part of the "all" target and get compiled when building the
whole project. When building greentea tests we need to disable unit
tests and stubs to avoid unnecessary compilation and errors.
Macro MBED_ALIGN expands in C to _Alignas which can't be used in the
type declaration. This patch moves it to the first type definition
which makes this code compile properly in CPP and C.
This patch contains improvements mentioned in the unresolved PR
comments:
- function names were changed from socket_sendmsg/socket_recvmsg to
socket_sendto_control/socket_recvfrom_control.
- default implementation of this functions was provided in the
NetworkStack class.
- MsgHeaderIterator accesses elements on the aligned addresses.
This commit enables the Overriding of HAL callbacks and IRQHandler
in stm32xx_emac.cpp. Hence the user can have their own
implementations of callbacks and IRQHandler functions.
Signed-off-by: Kather Rafi Ibrahim <katherrafi.i@hcl.com>
Current BT_POWER sequence:
1. BT_POWER=0 ( from CyH4TransportDriver::initialize)
2. delay 1ms ( from CyH4TransportDriver::initialize)
3. BT_POWER=1 ( from CyH4TransportDriver::initialize)
4. delay 500ms (from HCIDriver::do_initialize)
5. BT_POWER=1 (from HCIDriver::do_initialize)
6. delay 500ms (from HCIDriver::do_initialize)
updates:
1. remove 4) and 5)
2. keep all BT_POWER operations in one place. The best logic place is CyH4TransportDriver::initialize.
So finally the BT_POWER sequences should looks like:
1. BT_POWER=0 ( from CyH4TransportDriver::initialize)
2. delay 1ms ( from CyH4TransportDriver::initialize)
3. BT_POWER=1 ( from CyH4TransportDriver::initialize)
4. delay 500ms ( from CyH4TransportDriver::initialize)
Add an option to enable the greentea tests independently from the unit
tests.
We can't just use the typical BUILD_TESTING option to enable greentea
tests. BUILD_TESTING enables unit tests and fetches googletest, which
are compiled for the host. Greentea tests are cross compiled and require
a toolchain file. For this reason we add a new option just to enable
greentea tests, preventing build failures triggered by the unit tests
and googletest.
Now, CYW43XXX Cordio HCI driver has the following MCU deep-sleep locking scenarios/flows:
a) A BT device or MCU does not support Low Power mode (MBED configuration does not include MBED_TICKLESS, DEVICE_SLEEP, DEVICE_LPTICKER or CYCFG_BT_LP_ENABLED features). In this case, CyH4TransportDriver locks deep-sleep in the initialize() function and unlocks the terminate() function.
b) A BT device and MCU support Low Power mode. In this case, the control of the unlock/lock of the deep-sleep functionality will be done in bt_host_wake_rise_irq_handler and bt_host_wake_fall_irq_handler handlers. Finally, CyH4TransportDriver unlocks the deep-sleep in terminate() function (if it was locked before) by checking the bt_host_wake_active flag.
Fixes#13076, #13700, #13295.
Individual libraries' `target_h` stub headers have now all been moved
from `mbed-headers-base` to `mbed-headers-<library>`.
Note: Even though headers previously in `target_h` are technically
stubs/fakes too, they are used by not only unit tests but also regular
libraries when compiled for unit tests, because no target-specific HAL
implementation exists in this case. In order for regular library
sources to pick up `target_h` headers, those headers must
* have the same names as regular headers
* appear first in include paths
This is why those headers are part of `mbed-headers-<library>` and not
`mbed-stubs-<library>`. Before this refactoring, `mbed-headers-base`
was the first in unit tests' include paths.
The header `mbed.h` is a convenient wrapper that pre-includes some
platform headers, for use by user applications. Libraries and tests
internal to Mbed OS should not use it, and they should explicitly
include headers they need. So a stub is not needed.
References to time should do so using std::chrono. We reworked tests in
connectivity and drivers to use std::chrono and new APIs in order to
remove deprecation warnings resulting from deprecated API calls.
This required addition of a macro for test assertions using std::chrono
values.
As host test "timing_drift_auto" expects time values represented as an
integral number of microseconds, we explicitly provide this in place
using "microseconds{TICKER_TIME}.count()" in the relevant ticker tests.
We recognise this is ugly, but thought it best to descriptively convert
from std::chrono to the host test's required representation.
Co-authored-by: Hari Limaye <hari.limaye@arm.com>
We failed to set `LoRaMac_stub::mlme_ind_ptr` to a valid pointer. When
we tried to dereference it in `LoRaWANStack::process_reception` we hit a
SEGFAULT.
This test was relying on the state of `LoRaMac_stub::bool_true_counter`
to be set to 1 from a previous test. When the test was ran in isolation
the `LoRaWANStack::rx_timeout_interrupt_handler` callback would fail
because we weren't returning true from the stub implementation of
`LoRaMac::nwk_joined`. Due to this
`LoRaWANStack::post_process_tx_no_reception` was never called. This
caused the LoRaWANStack object to think the "tx_metadata" was "stale"
(i.e the data hadn't changed since any previous read). So, when we
attempted to call `LoRaWANStack::acquire_tx_metadata` it returned
`LORAWAN_STATUS_METADATA_NOT_AVAILABLE` as it thought we had no new
metadata to report, causing the test assertion to fail.
We had commented out a line where we reset LoRaPHY_stub::uint16_value to
0. This was causing an invalid array access in
LoRaMac::handle_data_frame, when trying to extract the
_mps_indication.channel from list of channel_params_t returned by
lora_phy->get_phy_channels.
Some tests in athandlertest.cpp relied on the state of stubs set in
previous tests. This caused test failures if the tests cases were ran in
isolation. Remove the interdependencies between tests by setting stub
values in the tests that rely on them.
Previously a test executable was recognised as a single test by CTest.
However, test executables usually contain multiple test cases, the
results of the test cases should be individually reported. With our
previous setup we could miss test case failures that didn't cause the
executable to return an error code.
This commit uses gtest_discover_test to discover all test cases in a
test executable. This enables CTest to match test passes and failures
from the googletest binary output.
We previously made up an invalid message type, which was roughly
`MCPS_MULTICAST | 0x40`. This causes an MBED_ASSERT failure in the
handle_rx function, as it uses an assert to validate the message type
passed to it (in convert_to_msg_flag()). Use the valid message type
MCPS_MULTICAST instead in the handle_rx unit test.
Use the `--coverage` option instead of manually linking to gcov, as some
host platforms (like macOS, FreeBSD) don't have gcov by default and use
an llvm equivalent instead.
Previously ble headers are part of mbed-headers-connectivity, this PR
moves ble headers into new mbed-headers-ble to make ble stubs to be
more self-contained and improves the composition of the library.