Allow more than one callback to be register to NetworkInterfaces.
This introduces new APIs:
void NetworkInterface::add_event_listener(...);
void NetworkInterface::remove_event_listener(...);
Which internally calls interfaces attach() functions.
All tests will run for each storage component available on device excapt for test_get_type_functionality that will run once on the default blockdevice.
Few boards may fail the write actions due to HW limitations (like critical
drivers that disable flash operations). Just retry a few times until success.
In addition, remove the redundant retries in NVStore (not needed now).
Socket network interface tests were failing due to DICONNECTED event
being advertised, where GLOBAL_UP was expected. It turned out that
nanostack receives two events: APPL_EVENT_CONNECT and
APPL_BACKHAUL_INTERFACE_PHY_UP. The second attempt to connect obviously
returns errors, but it also causes events to be sent out to the
application. The second attempt should not take place in case the
bootstrap is already started.
I also fixed two reports being sent with DISCONNECT status, while they
are actually something else.
Set tasklet parameters before connecting to prevent the parameters to be set to 0.
The tasklet parameters are reset to 0 when wisun_tasklet_connect gets called,
thus those need to be set in the wisun_tasklet_configure_and_connect_to_network
before they are used. This is also done this way in other tasklets.
Like all HAL APIs, the calls in trng_api.h are not expected to
be thread-safe.
All current accesses to the TRNG HAL are currently via
`mbedtls_hardware_poll`. Mbed TLS does not currently serialise these
calls itself, as `MBEDTLS_THREADING_C` is not enabled. But even if
Mbed TLS's own accesses were serialised, there are other direct
users of `mbedtls_hardware_poll` such as randLIB, that need to use
direct calls due to lack of API to extract entropy from Mbed TLS.
As such it makes sense to treat `mbedtls_hardware_poll` as a de facto
public Mbed OS API, akin to the C++ veneers on top of the HAL, and add a
PlatformMutex there so that it is safe for multithreaded use.
Instead of doing a "pull --rebase" to update to the latest development
branch, do a "fetch" followed by a "checkout" to update to the specified
release. This enables us to get any new tags created since the last
update to the development branch, and removes the noise of updating a
local "development" branch.
Don't allocate the sector map array in this function,
as it was buggy and redundant. Separate user config vs. automatic allocation
cases instead (which was essentially the case anyway).
In addition, fix tests to get over failures in low end boards
Rename the generic name `ctx` of `mbedtls_platform_context`
in `platform_alt.c` to a specific name `plat_ctx`, to avoid conflicts
when used as external in crypto modules.
To avoid collisions between the psa `crypto_platform.h` file and the
platform specific `crypto_platform.h` file, for the init \ terminate
functions, rename the latter to `crypto_device_platform`.
_sim_pin was changed to pointer from array and length was checked with
strlen. If _sim_pin was null it caused crash. Fix by checking _sim_pin against NULL.
Power class could have been called without checking if power is NULL. Fix by checking
that power class is not null.
Fix state machine to return correct states when queried.
Generic cellular module (GENERIC_AT3GPP) can by used as a default
module when porting new cellular module. It's a good starting point
and eases porting of new modules. GENERIC_AT3GPP uses only standard
3GPP AT commands when communicating with the modem.
Change usage of AT_CellularContext::stack_type_supported to
AT_CellularBase::get_property. This way we can rid of
targets overriding stack_type_supported and delete
unnecessary classes and simplify new targets.
After AT_CellularNetwork::has_registration was replaced with
CellularProperties and better
AT_CellularNetwork::set_access_technology_impl default
implementation we can delete most of the target specific classes
that inherit AT_CellularNetwork.
-added an API for checking network eps ciot optimization support
-renamed the API for getting the UE parameters
-the API for setting the UE parameters includes now a callback, which
will be called once network support for eps ciot optimization is known
Moved methods to classes CellularDevice and CellularInformation.
SIM interface was removed to simplify cellular usage and
methods better suite new classes.
Updated greentea and unit tests.
This is slight API change, as a new return code is introduced.
Intention is to properly support asyncronous drivers that might
not be able to get new operation into execution, therefore they
need to return BUSY.
The most common issue with using littlefs in mbed-os is when users
change from littlefs->FAT->littlefs (or with MBR or similar). When this
corrupts the superblock, littlefs tries to fall back to the backup
superblock. However, at this point in the time the old superblock may be
very out-of-date and pointing to an incorrect filesystem.
There's no complete solution to a malicious modification of the
filesystem (short of checking all metadata+data, a very expensive
operation), but we can at least expand our validation to all of the
metadata for the filesystem. This at least catches the common issues
with changing between different filesystems.
The relationnal operators were targeting the base class which defines an implicit constructor to an integral value. This is wrong as it allows SafeEnum instances to be compared against integers.
The fix is simple: define relationnal operators for the derived class. The derived class is known as it is passed as a template parameter of the base class.
For extra safety the SafeEnum constructor is now explicit and protected.
The helper method call_network_cb, actually does a lot more than calling
the callback. The method has a check that the network status supplied
for the callback is different compared to the internal one. It also sets
the class member if it is changed. This is a bit surprising, given the
name of the method. It also means that it doesn't work in this call, as
the member is already set.
Add override for the virtual method get_connection_status() inherited
from NetworkInterface. The method in the base class returns
NSAPI_STATUS_ERROR_UNSUPPORTED. The CellularContext has the member
_connection_status, which means that we could return this.
Previously, the CryptoToolbox was allocated once as part of the security manager.
This was inneficient memory wise as it is only use to prepare key at initialization
and when we need to compute shared keys.
This was also inneficient power consumption wise as the Crypto cell was kept enabled even
when it wasn't used.
This fix creates a CryptoToolbox whenever it is needed and release it once it has fulfilled its
purpose. Note that CryptoToolbox allocation happens on the heap as mbed tls data structure are huge
and there's an high risk of crushing the stack.
the own_oob and peer_oob flags were not being set to 1 even though
an OOB pairing request was in progress, which therefore prevented
OOB data from being passed down to the softdevice during a OOB
pairing operation, thus causing the OOB pairing process to fail.
The function in the Nordic SDK for generating OOB data,
sd_ble_gap_lesc_oob_data_get, requires local LE Secure Connection
P256 Public Keys in {X,Y} format, but was being supplied with
the local secret key. This caused the generated OOB data to
fail to correspond to the Public Keys, which caused a mismatch
during the OOB pairing phase of the OOB confirmation value by
a remote peer when attempting to verify the OOB data against
the Public Keys, ultimately causing the OOB pairing request to
fail with a Confirm Value Failed (0x04) error.
The GenericSecurityManager tracks the most recent OOB data generated
by the PAL and the PAL function to generate OOB data is expected to
be asynchronous such that the OOB data is returned via a callback.
There was a race condition on the security manager's oob data variable
because it was cleared (set to all zeros) after calling PAL generate.
The expectation was that the clear operation would occur before the
callback executed, but this is proving to not be the case. Instead,
the callback is being executed as if it were syncronous with PAL
generate, then PAL generate returns and the oob data is cleared,
thereby losing the generated oob data that was set in the callback.
To fix the issue, clear the oob data variables before calling into
the PAL.
This commit makes the repo used to import new Mbed TLS versions into Mbed OS
a parameter, to allow CI scripts (and any other script or users) to specify
specific repos to use for testing.
The arguments passed to `Callback<void()>`'s constructor were the wrong way round,
thus preventing the `attach` function from being instantiated.
This patch corrects that by switching the order of the arguments.
Adding group identidier so that LoRaWANInterface class goes to the class
hierarchy section rather than data-structures.
Adding missing documentation for a couple of public functions.
Adding \code and \endcode modifiers for the example code in the
documentation.
Adding compile time NO_DOXYGEN flag for the implementations of the
LoRaPHY Class.
Adding documentation for some of the private structures.
It was decided within the team to retire LoRaWANBase class which served
as a pure virtual interface class from which LoRaWAN network stack
implementations would get inherited. However, the current view is that
we may be the only user of it so we could retire LoRaWANBase.
Fix the following build warning found when building with
ARMC6 toolchain for NRF52_DK with mbed cli version 1.8.3
[Warning] thread_mle_message_handler.c@762,0: #188-D: enumerated type mixed with another type
[Warning] thread_mle_message_handler.c@834,0: #188-D: enumerated type mixed with another type