Commit Graph

295 Commits (5262cf1f87236920a7fc4fd795e740d843dbcba0)

Author SHA1 Message Date
Rajkumar Kanagaraj f672974c25 Incorporated the Reivew Comments 2019-06-03 15:24:04 +02:00
Rajkumar Kanagaraj 696638afeb Incorporated the Reivew Comments 2019-06-03 15:24:03 +02:00
Rajkumar Kanagaraj f94eb3cf13 Fix for the Ci build issue 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj 47030cd23f SW watchdog unittest cases
-Added the mock class function to mock mbed_assert_internal
  -Added the unit test case to test start,kick,stop
  -Modified the interface api name from is_alive to process
  -added the unit test cases for process
2019-06-03 15:23:59 +02:00
Rajkumar Kanagaraj eb98c38226 Hw Watchdog UnitTest cases
-Added the unit test case for testing Hw watchdog
    -Added the supported stubs files
2019-06-03 15:23:59 +02:00
Martin Kojtal 523ad23a30
Merge pull request #10656 from jarvte/fix_cellularctx_destr
Cellular: AT_CellularContext disconnect in non-blocking mode
2019-05-31 12:35:59 +01:00
Antti Kauppila 83d62fbb9c astyle fixes 2019-05-29 20:13:22 +03:00
Antti Kauppila 77e8374058 Cellular: Removed boiler plate code 2019-05-29 16:17:08 +03:00
Teppo Järvelin 8922eeb014 Cellular: add method to set authentication type to CellularContext
Authentication type must be able to set. It was hard coded to CHAP.
Added unit tests for CellularContext to be able to add test for new function.
2019-05-29 09:46:15 +03:00
Kevin Bracey 2fbbd9d2ca Introduce Semaphore::acquire methods
Deprecate wait() in favour of acquire(), try_acquire(),
try_acquire_for() and try_acquire_until().

Brings Semaphore more into line with CMSIS-RTOS 2 (which uses "acquire"),
itself (as it has "release"), and other classes having "try", "try for"
and "try until".

Also steps away from vague "wait" term - the primary operation here is
to acquire the semaphore, and this will of course sleep.
2019-05-28 17:02:06 +03:00
Teppo Järvelin 779fb6defd Cellular: AT_CellularContext disconnect in non-blocking mode
Disconnect was supporting only blocking mode.
2019-05-27 12:23:29 +03:00
Teppo Järvelin d559338b3b Cellular: fix unit test valgrind warnings
Stub files did have some memory leaks and using
unintialized variables.
2019-05-21 14:23:21 +03:00
Martin Kojtal 26aa16ff39
Merge pull request #10557 from jarvte/fix_cellularcontext_init
Cellular: Initialize CellularContext member variables in correct class
2019-05-15 08:48:54 +01:00
Martin Kojtal 3ea1c56124
Merge pull request #10147 from kjbracey-arm/atomic_bitwise
Assembler atomics
2019-05-13 14:18:05 +01:00
Teppo Järvelin e4ee870b2e Cellular: Initialize CellularContext member variables in correct class
CellularContext member variables were initialized in inheriting class.
Now in base class where they should be initialized so that every inheriting
class don't have to init them.
2019-05-10 11:43:48 +03:00
Ari Parkkila 830b4234e9 Cellular: Fix setting of statemachine timeout 2019-05-09 04:42:30 -07:00
Martin Kojtal 6d1b7596e6
Merge pull request #10490 from mirelachirica/at_read_string_stop_tag_ut
Cellular: Added UT for case when read_string buff size hits middle of…
2019-04-29 13:31:35 +01:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
Mirela Chirica 4d58e58b6b Cellular: Added UT for case when read_string buff size hits middle of stop tag 2019-04-26 12:48:26 +03:00
Teppo Järvelin 9d67a8b61c Cellular: send disconnect to correct ctx
Disconnect was sent to all CellularContext classes even it concerned
one specific context. Some disconnect events are still sent to all
context classes. These event are coming from network and ment for all
context classes or event did not specify cid.
2019-04-17 13:53:40 +03:00
Martin Kojtal 5e73a83332
Merge pull request #10391 from lorjala/unittesting-example
Update the writing example in unit testing README
2019-04-16 09:09:09 +01:00
Amanda Butler 1d1e78cac5
Edit README.md
Edit file for consistent person.
2019-04-15 15:56:26 -05:00
Lari-Matias Orjala a4308426da add a code independent unit test writing example 2019-04-12 15:28:01 +03:00
Ari Parkkila e0f8b2116a Cellular: Fix CellularStateMachine timeout configurations 2019-04-09 22:02:38 -07:00
Cruz Monrreal d1672d0200
Merge pull request #10341 from mirelachirica/check_urc_resp_stop_1
Cellular: Check for URC during AT response stop
2019-04-09 11:05:56 -05:00
Teppo Järvelin 2470a3611c Cellular: new state machine state and better info from stm
Added new state (signal quality) and more information about progress
so application/driver can build recovery logic.
2019-04-09 13:44:45 +03:00
Mirela Chirica f100cd59c8 Cellular: Check for URC during AT response stop 2019-04-09 11:15:28 +03:00
Teppo Järvelin fe5f97895b Cellular: Fix deleting of state machine to correct class 2019-04-08 12:50:29 +03:00
Martin Kojtal 2369c12dea
Merge pull request #10269 from TeemuKultala/cellular_valgrind_fix
cellular: valgrind defect fix
2019-04-03 13:49:26 +02:00
Teemu Kultala 453d7b86af cellular: valgrind defect fix
at_cellulardevicetest.cpp: fix potential memory leak
at_cellularsmstest.cpp: fix potential memory leak, uninitialized memory conditional
athandlertest.cpp: fix potential memory leak, uninitialized memory conditional,
uninitialized memory read
ATHandler_stub.cpp, ATHandler_stub.h: fix potential memory leak, uninitialized memory conditional
2019-04-03 10:35:15 +03:00
Teppo Järvelin c6e5595cec Cellular: retry logic for CellularContext connect
State machine has retry logic until device is attached to network.
After this CellularContext does the context activation e.g. connect.
There was no retry logic for context activation. Added logic to
CellularContext level so it's available for at and (upcoming)ril layers.
2019-03-29 14:12:23 -05:00
Cruz Monrreal 4af3c38078
Merge pull request #10210 from jarvte/cellulardevice_from_context
Cellular: CellularContext must provide access to CellularDevice
2019-03-28 17:09:48 -05:00
Hasnain Virk cd3a032d2a Unit test fix for RX TOA change
The change had an impact on unittests and we needed to adjust the test
cases a little to accomodate the change.
2019-03-27 10:23:43 +02:00
Teppo Järvelin b0ee22c96b Cellular: CellularContext must provide access to CellularDevice
When using NetworkInterface::get_default_instance() application gets handle
to CellularInterface which is actually CellularContext derived from CellularInterface.
Application needs also handle to CellularDevice to open other interfaces.
2019-03-26 07:29:11 +02:00
Hasnain Virk 4c1b8a8816 Unit test fix LoRaPHY_stub
get_rx_window_params() API is changed. To reflect that changing the
stub.
2019-03-22 15:45:45 +02:00
Teppo Järvelin dba3d42362 Cellular: call AT+CGEREP after sim is ready
Current implementation did call AT+CGEREP before sim was ready
and it was failing in most modems.
2019-03-18 08:10:09 +02:00
Cruz Monrreal 6c4b4a5212
Merge pull request #10084 from mirelachirica/info_resp_issue_8829
Cellular: AT information response to return false on empty prefix
2019-03-16 22:59:24 -05:00
Cruz Monrreal dbb33ef423
Merge pull request #9801 from vmedcy/fix-eventqueue-h
Correctly include EventQueue.h
2019-03-16 22:52:40 -05:00
Martin Kojtal 759627ff12 Merge branch 'plmn_stm_fix2' of https://github.com/jarvte/mbed-os into rollup 2019-03-15 08:45:14 +00:00
Martin Kojtal d5eb98e66a Merge branch 'cellular_BC95_leak_fix' of https://github.com/TeemuKultala/mbed-os into rollup 2019-03-14 11:37:10 +00:00
Martin Kojtal cf76b74aad
Merge pull request #9837 from jarvte/drop_bg96_cgact_support
Cellular: CGACT not supported in coming firmware in BG96
2019-03-14 09:16:39 +01:00
Mirela Chirica d12de2a199 Cellular: AT information response to return false on empty prefix 2019-03-13 15:49:33 +02:00
Teemu Kultala 71a1ed9c8e cellular: BC95 memory leak fix 2019-03-07 11:58:20 +02:00
Teppo Järvelin a830dbf47d Cellular: removed manual registering state.
Simplified state machine by removing manual registering state.
This was done as some modems did not have all the needed at commands
for checking the registered network. Some modem run out of memory as when
checking correct network there might be so many networks available.
Manual registration still works but it does not do any checks to which network
it's registered. Moved manual registering at command earlier in state machine so it forces
registering to a correct network. Internal refactor/fix, does not affect applications.
2019-03-05 13:17:25 +02:00
kegilbert 194fa129fb Update recently added previous macro name uses in tests 2019-03-01 13:53:47 -06:00
Martin Kojtal 10f2c05318
Merge pull request #9898 from jarvte/connect_disconnect_fix
Cellular: fix connect-disconnect sequence called many times
2019-03-01 17:34:30 +01:00
Martin Kojtal 596b9f740e
Merge pull request #9797 from ARMmbed/fh_enable
API to temporarily enable/disable FileHandles
2019-03-01 14:26:18 +01:00
Teppo Järvelin 0905f01438 Cellular: Removed API get_connection_status() from CellularNetwork
This was left accidentally after refactoring.
It wasn't giving correct states after refactoring.
CellularContext::get_connection_status should be used instead.
2019-03-01 14:51:05 +02:00
Teppo Järvelin ec73c8a9c7 Cellular: fix connect-disconnect sequence called many times
Fix syncing back to at mode after ppp disconnect.
Fix AT_CellularContext flags and states to allow new connect after disconnect.
Fix that state machine is not reseted in disconnect is it's running (might be
running because of another context or new connect already started).
2019-03-01 14:47:41 +02:00
Kevin Bracey 7098f1b7f9 UARTSerial stub: add enable calls 2019-03-01 10:05:25 +02:00
Teppo Järvelin 4077898de1 Cellular: fix issue where CGACT not supported in coming firmware in BG96. 2019-02-28 08:36:31 +02:00
Martin Kojtal 6bdbe754cd
Merge pull request #9799 from VeijoPesonen/bugfix-esp8266-dns
Increase events.share-eventsize to 768B because of ESP8266 AT driver and asynchronous DNS
2019-02-27 11:30:38 +01:00
Veijo Pesonen 517799fd06 NetworkStack: halts if unable to add an event to the event queue 2019-02-26 09:44:15 +02:00
Volodymyr Medvid b0a33273ff Correctly include EventQueue.h
There are two EventQueue.h in mbed-os codebase:
events/EventQueue.h
features/FEATURE_BLE/ble/pal/EventQueue.h

By accident, `mbed compile` generates includes.txt with the correct
order of include search paths. This is not the case for the CMake
exporter: targets with FEATURE_BLE enables fail to compile with errors:

mbed-os/features/cellular/framework/AT/ATHandler.h:99:60: error:
'events' has not been declared

Update all places to always include either "events/EventQueue.h"
or "ble/pal/EventQueue.h": to always find the correct header.
2019-02-21 17:59:05 +02:00
Martin Kojtal dbd92c746b
Merge pull request #9387 from tymoteuszblochmobica/Sockets
Multihoming initial release
2019-02-21 13:50:03 +01:00
Cruz Monrreal b088bd493a
Merge pull request #9759 from michalpasztamobica/memory_handling_fixes
Multiple memory handling fixes
2019-02-20 12:07:45 -06:00
Tymoteusz Bloch 641189c357 Multihoming change parameter orded in gethostbyname 2019-02-20 14:37:33 +02:00
Michal Paszta b241943c12 Multiple memory handling fixes
Correct memory clean-ups in multiple tests and a stub.
2019-02-20 10:50:55 +01:00
Cruz Monrreal feae56eea1
Merge pull request #9493 from RonEld/add_platform_initialization_in_trng_test
Initialize platform in trng test
2019-02-19 15:27:40 -06:00
Tymoteusz Bloch 49141376ee Multihoming initial release
Added Multihoming feature to LWIP (ability to use more than one network interfaces) for increasing networking reliability.
This involves:

    LWIP interface
    LWIP IP routing
    DNS storage
    Sockets (bind to interface name possibility)
    possibility to add non default network interface
    cellular middleware modifications if cellular connection is used
2019-02-19 17:39:46 +02:00
Ari Parkkila 605a42d38f Cellular: Fix Gemalto/Cinterion socket open defer 2019-02-18 06:24:42 -08:00
Ron Eldor c94b5861e4 Add mbedtls platform setup and teardown to modules
Add calls to `mbedtls_platform_setup()`
and `mbedtls_platform_teardown()` to all modules and tests using Mbed TLS.
2019-02-18 11:43:32 +02:00
Cruz Monrreal fdd2a9402a
Merge pull request #9728 from AriParkkila/at-handler-clear-sigio
Cellular: Fix sigio to be released in ATHandler destructor
2019-02-15 12:41:44 -06:00
Cruz Monrreal 7f248970ec
Merge pull request #9660 from blind-owl/clean_cellular_trace
Cellular: clean sensitive information from trace
2019-02-15 12:28:25 -06:00
Ari Parkkila 0c697f4421 Cellular: Fix sigio to be released in ATHandler destructor 2019-02-15 05:07:36 -08:00
Hasnain Virk a14acfad14 Updating unit tests
Updating unit test in response to the change in the link ADR related
APIs.
2019-02-14 17:15:47 +02:00
Hasnain Virk d257d7287f Including CTest explicitly
enable_test() seems to include CTest framework in the CMakeLists.txt but
that would result in inconsistencies and CTest framework will not be
able to find DartConfiguration file or MemCheck tool.

Including CTest framework explicitely in the CMakeLists.txt seems to
solve the issue.
2019-02-14 17:15:22 +02:00
Jari Poyhonen b6a0892e86 Cellular: clean sensitive information from trace
Information removed from the cellular subsystem trace log:
* SIM pin
* APN username and password

Added get_debug() to ATHandler.h to get the current trace state in order
to support suspend/resume of trace output.
2019-02-14 09:22:54 +02:00
Cruz Monrreal 709e6ff795
Merge pull request #9600 from kjbracey-arm/atomic_exchange_64
Atomic extensions: 64-bit, bool, exchange
2019-02-12 20:28:00 -06:00
Martin Kojtal 10bb66a053
Merge pull request #9424 from SeppoTakalo/ONME-4125
Allows multiple network status listeners
2019-02-11 10:41:35 +01:00
Nir Sonnenschein 8c2ad14ace
Merge pull request #9568 from ARMmbed/feature-cellular-refactor
Merge feature cellular refactor
2019-02-07 18:17:32 +02:00
Martin Kojtal a0ec77d9a8
Merge pull request #9378 from oscarh/master
Add get_connection_status() override in CellularContext
2019-02-05 10:39:00 +01:00
Kevin Bracey 694adaae8b Add atomic exchange 2019-02-05 10:53:30 +02:00
Kevin Bracey f8e3f5dc2c Add 64-bit atomics 2019-02-05 10:45:40 +02:00
Oscar Hellström 0ff91c1d5c Add unit test stub for get_connection_status() 2019-01-31 20:56:21 +01:00
Seppo Takalo 86019af7eb Add unittest to verify removal of last event listener 2019-01-31 15:11:48 +02:00
Seppo Takalo 9c98d1572b Allow multiple network status listeners
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.
2019-01-31 15:04:24 +02:00
Ari Parkkila 47a8f24b1e Cellular: Fix astyle 2019-01-31 04:15:01 -08:00
Martin Kojtal 2cd83b45a4
Merge pull request #9392 from michalpasztamobica/tlssocket_documentation_update
Documentation of TLSSocket behavior on AUTH_FAILURE
2019-01-23 14:20:43 +01:00
Jari Poyhonen 626935f331 Fix valgrind error in cellular athandler unit test 2019-01-23 09:43:03 +02:00
Jari Poyhonen b16d8dbf3b cellular unit test updates due valgrind run 2019-01-23 09:43:02 +02:00
Michal Paszta 2cda5d28b8 Documentation of TLSSocket behavior on AUTH_FAILURE 2019-01-22 12:40:42 +01:00
Ari Parkkila 007caa0235 Cellular: Update modem drivers with get_default and other new APIs 2019-01-22 02:24:45 -08:00
Ari Parkkila c4de2f2f0e Cellular: Power API updated to match onboard_modem_api 2019-01-22 02:24:45 -08:00
Ari Parkkila 75caa75a96 Cellular: Add get_target_default_instance in CellularDevice 2019-01-22 02:24:45 -08:00
Ari Parkkila 139d506a24 Cellular: Move power on/off to device and remove CellularPower 2019-01-22 02:24:45 -08:00
Mirela Chirica 55b54f7c97 Cellular: Added API for setting default parameters to a network interface 2019-01-22 02:24:45 -08:00
Mirela Chirica ba3727b4e8 Cellular: Unit tests for Non-IP socket 2019-01-22 02:24:45 -08:00
Mirela Chirica d301e13610 Cellular: Non-IP socket and PDP context for EPS control plane data delivery 2019-01-22 02:24:44 -08:00
Teppo Järvelin 84e5013a2d Cellular: added setting of data carrier support for UART. 2019-01-22 02:23:04 -08:00
Teppo Järvelin 725e14d15f Cellular: Add State machine unit tests. 2019-01-22 02:23:04 -08:00
Teppo Järvelin 0c9130efeb Cellular: change stack_type_supported to get_property
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.
2019-01-22 02:23:04 -08:00
Teppo Järvelin 7c9f9d47ec Cellular: Remove target files inheriting from AT_CellularNetwork
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.
2019-01-22 02:23:04 -08:00
Teppo Järvelin 9a72c221d8 Cellular: Change AT_CellularNetwork to use CellularProperties.
This change enables removing function has_registration from
class AT_CellularNetwork and all targets inheriting
AT_CellularNetwork.
2019-01-22 02:23:04 -08:00
Teppo Järvelin b0d37ebec4 Cellular: Removed unnecessary checks after new
After this change we were able to change methods
ATHandler::set_urc_handler and CellularDevice::set_ready_cb to void
and simplify error handling.
2019-01-22 02:23:04 -08:00
Teppo Järvelin 8fcd2e0401 Cellular: changed support features to CellularProperty array. 2019-01-22 02:23:04 -08:00
Ari Parkkila c7486b2a0d Cellular: Added shutdown() 2019-01-22 02:23:04 -08:00
Ari Parkkila bdddb445a6 Cellular: Moved reset from power to device 2019-01-22 02:23:03 -08:00
Ari Parkkila 1bc84404b2 Cellular: Removed set_power_level() 2019-01-22 02:23:03 -08:00
Ari Parkkila 0813b969f7 Cellular: Unify set_at_mode and init_module into init() 2019-01-22 02:23:03 -08:00