_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.
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
Change KVStore API tests to run only on K64F, these tests check the KVStore functionality without actually testing the board's storage,
Thus they should produce the same results for each device they run on.
K64F was selected for no special technical reason but only because of it being available and convenient to use.
Randomizing backoff by 200ms to 1000ms for Join Requests in a dense
network will add robustness and better chances of reception by the base
station especially in cases of catastrophic network outage and
reconnection.
remove of rbp_number_of_entries from the kvstore configuration. Adding default option for storage_type
allowing the system to choose TDB_INTERNAl, TDB_EXTERNAL or FILESYSTEM base on the blockdevice component
set in the target board. Adding remarks to kv_config.cpp and break simplify the _get_blockdevice_FLASHIAP function
Currently, LwIP segment retransmission time is 12, which is very long
time as each timeout doubles the retransmission timeout.
Make that to 6 as that is same what we use in Nanostack.
Kintis EMAC is consuming 16 rinbuffers for input, and 8 buffers for output.
This is over-use because input packets are immediately allocated from
heap when passed to LwIP. Therefore the number can be creatly reduced.
The DEVICE_FOO macros are always defined (either 0 or 1).
This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Added check to state machine that if modem is attached to a network
it is considered to be registered to a network and state machine
can continue to next states. This fixed issues seen in IoT network
that network does not allow registering if already attached.
- Consider data section in GCC_ARM toolchain
- Consider init_array section in IAR toolchain
- Rename macro to FLASHIAP_APP_ROM_END_ADDR for clarity sake
1. For SHA AC, use atomic flag to manage its ownership.
(1) Nuvoton SHA AC doesn't support SHA context save & restore, so S/W
SHA fallback has been supported before. To make non-blocking 'acquire'
semantics clearer, introduce 'try_acquire' to substitute for 'acquire'.
(2) No biting CPU due to mechanism above.
(3) No deadlock due to mechanism above.
2. For AES/DES/ECC AC, change to mutex to manage their ownership.
(1) Change crypto-misc.c to crypto-misc.cpp to utilize C++ SingletonPtr
which guarantees thread-safe mutex construct-on-first-use.
(2) With change to crypto-misc.cpp, add 'extern "C"' modifier to CRYPTO_IRQHandler()
to avoid name mangling in C++.
(3) No priority inversion because mutex has osMutexPrioInherit attribute
bit set.
(4) No deadlock because these AC are all locked for a short sequence
of operations rather than the whole lifetime of mbedtls context.
(5) For double mbedtls_internal_ecp_init() issue, it has been fixed in upper
mbedtls layer. So no need to change ecc init/free flow.