Commit Graph

546 Commits (c2a09abee8af43370785550c1f7867e2e51bb4e8)

Author SHA1 Message Date
Antti Kauppila 1cb3479d7a Fixed unittests 2019-12-09 15:25:22 +02:00
Antti Kauppila e51230c5e4 Remove CellularBase and AT_CellularBase
Removed CellularBase and AT_CellularBase from cellular stack and updated both code and unittests accordingly.

Moved property handling into AT_CellularDevice
2019-12-09 15:25:22 +02:00
Antti Kauppila aac3437a22 Cleaned up athandlertest.cpp 2019-12-09 14:09:42 +02:00
Antti Kauppila d6706d1a5f Unittest configuration mechanism improved
Earlier all unittests ended up having all flags in common from all unittest targets.
This is now improved by using googletest provided mechanism to set build time compile options
All cmake files have been modified to reflect changes (when needed)

Could not figure out a syntax for {0x00, 0x00, ..., 0x00} intitializer list yet,
so those needs to be setup by updating C/CXX flags.
2019-12-09 13:11:56 +02:00
Martin Kojtal 412a9317de
Merge pull request #12017 from VeijoPesonen/remove_nvstore
NVStore: already deprecated implementation removed
2019-12-05 09:10:30 +01:00
Martin Kojtal 6f18801ccc
Merge pull request #11986 from ARMmbed/feature_storage_test_improvements
Storage related test improvements and small fixes
2019-12-04 10:16:28 +01:00
Martin Kojtal 4ae8984819
Merge pull request #11878 from michalpasztamobica/api_hardening
Improve API documentation and test coverage
2019-12-04 10:15:43 +01:00
Veijo Pesonen 060a1c6df7 NVStore: deprecated implementation removed 2019-12-03 15:36:31 +02:00
Seppo Takalo d74fa93549 Add unittests for BufferedBlockDevice 2019-12-03 14:38:40 +02:00
Seppo Takalo 92a60c3d80 Extend SlicingBlockDevice test coverage 2019-12-03 14:38:40 +02:00
Martin Kojtal ad3647c191
Merge pull request #11957 from kjbracey-arm/crc-redo
MbedCRC and CRC HAL revisions (6.0 redo)
2019-12-03 13:21:36 +01:00
Michal Paszta 75472d0554 Adjust mbed_assert_stub file extension to .cpp 2019-12-02 20:48:16 +02:00
Michal Paszta caf01479ea Improve doxygen and unittest coverage for API
Mainly focusing on hardening the tests for return values.
2019-12-02 20:48:10 +02:00
Michal Paszta 546fdd2596 Move OnboardNetworkStackMock to a separate file
The mock was only used by EthernetInterface tests, but we can reuse it for other tests as well.
2019-12-02 20:47:43 +02:00
Martin Kojtal 0edce8a33e
Merge pull request #11927 from SeppoTakalo/speed_up_unittests
Speed up unittests by not limitting Make to spawn more processes
2019-12-02 14:57:47 +01:00
Kevin Bracey a995c162ac Revise MbedCRC template
* Use compile-time detection of hardware CRC capability, so unneeded
  code and tables do not go into the image.
* Add global JSON config option to allow choice between no tables,
  16-entry tables or 256-entry tables for software CRC. Default set
  to 16-entry, reducing ROM size from previous 256-entry.
* Allow manual override in template parameter to force software or
  bitwise CRC for a particular instance.
* Micro-optimisations, particularly use of `RBIT` instruction and
  optimising bitwise computation using inline assembler.

Incompatible changes:

* Remove special-case "POLY_32BIT_REV_ANSI" - users can use standard
  POLY_32BIT_ANSI, which now uses the same 16-entry tables by default,
  or can use hardware acceleration, which was disabled for
  POLY_32BIT_REV_ANSI. MbedCRC<POLY_32BIT_ANSI, 32, CrcMode::TABLE> can
  be used to force software like POLY_32BIT_REV_ANSI.
* The precomputed table for POLY_16BIT_IBM had errors - this has been
  corrected, but software CRC results will be different from the previous
  software calculation.
* < 8-bit CRC results are no longer are shifted up in the output value,
  but placed in the lowest bits, like other sizes. This means that code
  performing the SD command CRC will now need to use `(crc << 1) | 1`,
  rather than `crc | 1`.
2019-12-02 14:45:37 +02:00
Kevin Bracey fe22bc023e Update HAL CRC API
* Change "is supported" check to be a macro, so it can be done at
  compile-time.
* Eliminate weird shift on 7-bit CRCs.
* Add support for 32-bit CRCs and reversals to TMPM3HQ.
2019-12-02 14:45:37 +02:00
Martin Kojtal aa168594a7
Merge pull request #11892 from mprse/feature-hal-spec-explicit-pinmap
Bring static pinmap extension to master
2019-11-28 15:46:38 +01:00
Martin Kojtal ffdd54315f
Merge pull request #11941 from michalpasztamobica/remove_internal_string_apis
Remove string-based API usage within mbed-os
2019-11-28 14:26:03 +01:00
Antti Kauppila 367bae654d
Fixed crashing nsapi_dns unittest
Added missing "return" for NetworkStackMock's get_stack() method
2019-11-28 11:23:35 +02:00
Przemyslaw Stekiel 3d03d3553e Add pwmout_init_direct() stub (fix for unittests) 2019-11-28 08:32:12 +01:00
Michal Paszta ea04c4f85e Remove internal usage of deprecated APIs in IPCore
Updated:
* netsocket classes,
* unittests, stubs and mocks,
* greentea tests
2019-11-27 20:02:20 +02:00
Martin Kojtal b0751bf507
Merge pull request #11946 from ARMmbed/revert-11559-crc
Revert "MbedCRC and CRC HAL revisions"
2019-11-27 11:07:13 +01:00
Martin Kojtal 58d6f5f39f
Merge pull request #11873 from AnttiKauppila/disable_sms
Make SMS configurable in Cellular stack
2019-11-27 09:03:55 +01:00
Martin Kojtal 5f7ecea00b
Revert "MbedCRC and CRC HAL revisions" 2019-11-26 13:45:37 +00:00
Martin Kojtal 7fbe0c6b41
Merge pull request #11928 from SeppoTakalo/assert_throw
Allow MBED_ASSERT to throw errors in unittests, so we can verify it.
2019-11-25 13:11:41 +01:00
Antti Kauppila 353782bf63 Disable SMS by default from Cellular stack
Put SMS behind configuration flag to save some memory (4,5kB) for Cellular users not needing SMS features.
UBlox N2XX target is also updated
2019-11-25 11:38:06 +02:00
Martin Kojtal 04ed9c5c8c
Merge pull request #11851 from amq/patch-2
Enable FAT ChaN lib configuration with mbed_lib.json
2019-11-22 13:38:56 +01:00
Seppo Takalo 7c579f2da2 Speed up unittests by not limitting Make to spawn more processes 2019-11-22 13:14:15 +02:00
Seppo Takalo c54d76eddf Allow MBED_ASSERT to throw errors in unittests, so we can verify it.
GoogleTest allows you to check whether certain function throws errors.
For example:
ASSERT_ANY_THROW(mbed::HeapBlockDevice one(3050, 100));
or
ASSERT_NO_THROW(bd.init());

As MBED_ERROR is now only function that can throw errors, there is
no need to check the type of thrown object.
2019-11-22 13:10:46 +02:00
Martin Kojtal 38a8c0e28f
Merge pull request #11914 from michalpasztamobica/refactor_string_based_apis
Deprecate string-based APIs in IPCore
2019-11-22 12:00:56 +01:00
Michal Paszta fd5b4b9119 Deprecate string-based APIs in IPCore
MBED_DEPRECATE macros is added to string-based APIs.
New, non-string-based APIs are added in their place.
Wiced binaries rebuilt
Any existing stubs or mocks are adjusted to compile and run with the newly added non-string based functions.
2019-11-22 11:31:12 +02:00
Martin Kojtal 2bde6581a6
Merge pull request #11720 from mtomczykmobica/ONME-4405
ATCmdParser: merge scanf and recv functions
2019-11-21 15:29:29 +01:00
Marcin Tomczyk 1d3a1b7c6c ATCmdParser: unittests implementation 2019-11-20 22:37:01 -08:00
amq 3eaa3e0325
Add fat_chan defines in storage unit tests cmake 2019-11-17 12:10:57 +01:00
Kevin Bracey 3939c992d4 Revise MbedCRC template
* Use compile-time detection of hardware CRC capability, so unneeded
  code and tables do not go into the image.
* Add global JSON config option to allow choice between no tables,
  16-entry tables or 256-entry tables for software CRC. Default set
  to 16-entry, reducing ROM size from previous 256-entry.
* Allow manual override in template parameter to force software or
  bitwise CRC for a particular instance.
* Micro-optimisations, particularly use of `RBIT` instruction and
  optimising bitwise computation using inline assembler.

Incompatible changes:

* Remove special-case "POLY_32BIT_REV_ANSI" - users can use standard
  POLY_32BIT_ANSI, which now uses the same 16-entry tables by default,
  or can use hardware acceleration, which was disabled for
  POLY_32BIT_REV_ANSI. MbedCRC<POLY_32BIT_ANSI, 32, CrcMode::TABLE> can
  be used to force software like POLY_32BIT_REV_ANSI.
* The precomputed table for POLY_16BIT_IBM had errors - this has been
  corrected, but software CRC results will be different from the previous
  software calculation.
* < 8-bit CRC results are no longer are shifted up in the output value,
  but placed in the lowest bits, like other sizes. This means that code
  performing the SD command CRC will now need to use `(crc << 1) | 1`,
  rather than `crc | 1`.
2019-11-13 14:31:49 +02:00
Kevin Bracey 1f94428a56 Update HAL CRC API
* Change "is supported" check to be a macro, so it can be done at
  compile-time.
* Eliminate weird shift on 7-bit CRCs.
* Add support for 32-bit CRCs and reversals to TMPM3HQ.
2019-11-13 14:31:49 +02:00
Michal Paszta 4e5ea38d14 nsapi_dns: use delete[] for array alloc'd with new[] 2019-11-05 22:39:58 +02:00
Michal Paszta a26d2d9672 Unittests for nsapi_dns 2019-11-05 11:29:36 +02:00
Martin Kojtal 355336ce43
Merge pull request #11797 from ARMmbed/IOTSTOR-941
IOTSTOR-953: Fix address calculations from SlicingBlockDevice
2019-11-05 09:09:14 +01:00
Martin Kojtal fe940924cc
Merge pull request #11683 from AnttiKauppila/baremetal_support
Baremetal profile fixes
2019-11-04 15:53:57 +01:00
Martin Kojtal f27aec3377
Merge pull request #11279 from cy-jayasankar/pr/added-ipv6-link-local-address-api
Add API to get ipv6 link local address
2019-11-04 15:28:41 +01:00
Martin Kojtal c908404d94
Merge pull request #11783 from mirelachirica/set_baud_rate
Adding set baud rate routine
2019-11-04 15:27:02 +01:00
Seppo Takalo 333b281000 Add moduletest for SlicingBlockDevice
This uses HeapBlockDevice for providing the underlying storage block.
Check boundaries that slicingblockdevice do not overlow over to unassigned
blocks.
2019-11-04 16:13:32 +02:00
Seppo Takalo a6d8f74b09 Add unittest for HeapBlockDevice and change some MBED_ASSERTS to errors. 2019-11-04 16:12:36 +02:00
Seppo Takalo 31fbed9066 Add some functionality to atomic stubs 2019-11-04 16:12:36 +02:00
Seppo Takalo 168b51c415 Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root.
* Refactor some data types to compile on 64bit machines.
* Refactor some debug traces to use mbed_trace.
2019-11-04 16:12:36 +02:00
Seppo Takalo 7f089ac074 Add empty unittest to generate zero baseline for untested files. 2019-11-04 16:12:36 +02:00
Seppo Takalo 376bbfc853 Add enough stubs to allow drivers/* to compile. 2019-11-04 16:12:36 +02:00
Seppo Takalo 82045b040d Remove extra GCC arquements.
"--coverage" is synonym to "-fprofile-arcs -ftest-coverage"
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

This was causing extra compilation warnings on CLANG.
2019-11-04 16:09:43 +02:00
Martin Kojtal f560e7960a
Merge pull request #11641 from hugueskamba/hk-fix-deepsleep-pwmout
PmwOut: Add method to enable/disable PWM
2019-11-04 14:28:50 +01:00
Mirela Chirica c484fc88f9 Cellular: Added set routine for baud rate 2019-11-01 17:21:31 +02:00
Antti Kauppila ac0b0f1f2c Unittests fixed 2019-11-01 15:22:28 +02:00
Hugues Kamba b8bcc7face PwmOut: Add unit test 2019-11-01 09:35:41 +00:00
Jayasankar Nara cb51fa57e2 Add API to get ipv6 link local address.
Protocols like mdns requires IPv6 link local address to be advertised in its
records (AAAA record). LWIP::Interface::bringup() API is creating IPv6 link
local address;But as of now there is no API exposed by mbed-os to get the
IPv6 link local address.

This new API is required to deliver mDNS library support on mbed-os for Cypress
platforms. Unit tested it by invoking get_ipv6_link_local_address with a simple
application.
2019-11-01 03:43:36 +05:30
Martin Kojtal bf4d51e9e7
Merge pull request #11763 from ARMmbed/feature_unittest_output
Display full path of generated coverage output from unittests.
2019-10-31 15:15:01 +01:00
Martin Kojtal da6b336391
Merge pull request #10978 from vmedcy/lwip-rawsocket
LwIP: add ICMPv4 Socket support
2019-10-31 11:50:21 +01:00
Seppo Takalo 9685a1c294 Display full path of generated coverage output from unittests. 2019-10-29 11:10:25 +02:00
Balaji 2d410e3c05 Rebase the code Unittests aware of InternetDatagramSocket 2019-10-28 12:10:12 -07:00
Sebastian Stockhammer b3b7f98698 Fix stub constructor 2019-10-24 10:24:35 +02:00
Michal Paszta 66c4b131e2 Astyle fixes 2019-10-14 14:22:31 +03:00
Michal Paszta 1706843d7d [unittests] test for InternetSocket::close blocking
Close should not take place in case there is someone reading or writing to the socket.
2019-10-14 14:22:31 +03:00
Michal Paszta 8c3194ac4e [unittests] Improve coverage
For the following classes:
* DTLSSocket
* NetworkInterface
* TLSSocketWrapper
2019-10-14 14:22:31 +03:00
Dominika Maziec 22b6b0fddb unitests update for tcp and udp 2019-10-14 14:22:31 +03:00
Anna Bridge ad891d9658
Merge pull request #11548 from AriParkkila/cell-dns-ip
Cellular: Fix resolving of DNS server IPv4/6 address
2019-10-07 16:46:47 +01:00
Anna Bridge eeb033f814
Merge pull request #11357 from kivaisan/offloaded_tlssocket_bg96
Offloaded TLSSocket and BG96 support for it
2019-10-03 11:54:32 +01:00
Anna Bridge ec7a5ee42b
Merge pull request #11486 from ladislas/update-googletest
update googletest to v1.8.1
2019-10-03 11:17:29 +01:00
Martin Kojtal 828fd2378a
Merge pull request #11581 from AriParkkila/cell-pdp-cid
Cellular: Fix setting of PDP context ID (cid)
2019-10-01 13:32:47 +02:00
Martin Kojtal c385e141e2
Merge pull request #11535 from AnttiKauppila/DNS_cleanup
DNS manual cleanup mechanism added
2019-09-30 15:55:49 +02:00
Ladislas de Toldi fa217c5bec
Update README with Google Test version 1.8.1 2019-09-30 09:47:44 +02:00
Anna Bridge e39ba114e1
Merge pull request #11491 from Tharazi97/equeue_chain_problem
Equeue chain, add documentation of using equeue_destroy
2019-09-27 16:29:01 +01:00
Ari Parkkila e449e6dcdc Cellular: Fix setting of PDP context ID (cid) 2019-09-27 02:09:36 -07:00
Juhani Puurula b836256701 Speed up unit test build with parallel jobs 2019-09-26 12:14:56 +03:00
Ari Parkkila 8054b8eef8 Cellular: Fix resolving of DNS server IPv4/6 address 2019-09-25 03:16:45 -07:00
Kimmo Vaisanen 6ba0efc969 Cellular: Use more specific error codes for socket open and connect
- When calling socket APIs when socket is not open, NSAPI_ERROR_NO_SOCKET will be
  returned instead of generic NSAPI_ERROR_DEVICE_ERROR

- If socket_send() is called when connection is not open, NSAPI_ERROR_NO_CONNECTION
  will be returned instead of generic NSAPI_ERROR_DEVICE_ERROR
2019-09-25 09:25:33 +03:00
Martin Kojtal d91ed5fa42
Merge pull request #11495 from kivaisan/improve_cellular_ut
Improve cellular unittests
2019-09-24 16:37:02 +02:00
Antti Kauppila 6adc2440a3 DNS manual cleanup mechanism added 2019-09-20 10:20:48 +03:00
Martin Kojtal 1afece7f1b
Merge pull request #11488 from kivaisan/fix_cellular_get_interface_name
Cellular: Fix get_interface_name to not include leading zero
2019-09-19 12:43:45 +02:00
Kimmo Vaisanen da77cdc52e UT for CellularDevice get/set timeouts methods 2019-09-17 12:56:47 +03:00
Kimmo Vaisanen ce3d41433e Fix CellularDevice::shutdown UT
As shutdown was overridden in test class, original shutdown() method
was not called at all.
2019-09-17 12:56:47 +03:00
Kimmo Vaisanen b6ecce0bfb Add UT for AT_CellularNetwork::is_active_context 2019-09-17 12:56:47 +03:00
Kimmo Vaisanen 02de20acb6 Add UT for CEREG URC handler 2019-09-17 12:56:47 +03:00
Kimmo Vaisanen 5778bc7326 Add possibility to test URC handlers 2019-09-17 12:56:43 +03:00
Kimmo Vaisanen d83f52a2a1 Improve UT for cellular properties 2019-09-17 12:15:18 +03:00
Kimmo Vaisanen e824714cd8 Add UT for CellularUtil::hex_to_char and ::hex_str_to_char_str
Also added checks for pointer validity.
2019-09-17 12:15:03 +03:00
Kimmo Vaisanen 0b9e80f76e Unittests for CellularList 2019-09-17 10:45:01 +03:00
int_szyk dc5b9fba09 Tweak equeue chain tests
Changed the order of destroying queues because it is needed to destroy
queues in specified order when they are chained.
2019-09-16 13:35:28 +02:00
Ari Parkkila 823993e7b1 Cellular: Add flow control (IFC) in BG96 AT driver 2019-09-16 03:16:36 -07:00
Kimmo Vaisanen ab71b2dba8 Cellular: Fix get_interface_name to not include leading zero
Multihoming documentation about interface name:
"Two character name string is concatenated with 8 bit value containing index which is incremented on each netif addition"

Cellular uses context id as index and to follow LWIP (LWIP::Interface::get_interface_name), index does not include leading zeros.
2019-09-16 09:59:31 +03:00
Ladislas de Toldi 72be5848ce
update googletest to v1.8.1 2019-09-13 17:55:15 +02:00
Martin Kojtal 66c39e0bca
Merge pull request #11424 from mirelachirica/stack_type_ip_versions
Stack type ip versions
2019-09-13 11:46:06 +02:00
Mirela Chirica ea1b2b8045 Cellular: Stack type based on assigned IP addresses versions 2019-09-12 12:55:33 +03:00
Ari Parkkila 94dcab9d69 Cellular: Add API to clear CellularDevice
A new API `CellularDevice::clear()` to clean-up the modem to a default initial state.
Function is virtual so it can be overridden. The default implementation clears all PDP contexts,
but the the first one if that has APN defined as `nsapi.default-cellular-apn`.

CellularStateMachine calls `clear()` to clean-up the modem on initial `connect()`,
if the flag `cellular.clear-on-connect: true` is defined.
2019-09-09 06:14:20 -07:00
Ari Parkkila cb20277701 Cellular: Fix BG96 power on and connect 2019-09-04 03:24:11 -07:00
Martin Kojtal aba0760652
Merge pull request #10684 from jarvte/fix_athandler_destr
Cellular: fix ATHandler destructor possible crash on delete
2019-09-04 11:52:59 +02:00
Martin Kojtal e001216b55
Merge pull request #11315 from Patater/psa-crypto-api-1.0b3
Update Mbed OS for PSA Crypto API 1.0b3
2019-09-03 09:20:15 +02:00
Teppo Järvelin 753ba8ceb6 Cellular: fix ATHandler destructor possible crash on delete
In some multithread cases there is possibility that process_oob function
was called after ATHandler was deleted. Fix is to wait if oob processing
is ongoing.
2019-09-03 09:09:05 +03:00
Maciej Bocianski b45d6d6a76 queue test: add counter overflow protect
without this fix test_equeue_break_no_windup was failing on IAR
2019-08-30 14:04:43 +02:00
Maciej Bocianski e7e5cd2aa4 equeue tests: add user allocated events tests 2019-08-29 15:02:41 +02:00
Maciej Bocianski b336f73e77 equeue posix impl: make queue mutex reentrant 2019-08-29 15:02:40 +02:00
Jaeden Amero 6dfd515dd6 crypto: Add Mbed Crypto includes to unit tests
Mbed Crypto also supplies include files. Ensure that our unit tests can
find those headers.
2019-08-28 16:38:03 +01:00
Martin Kojtal 6add979210
Merge pull request #10750 from jarvte/eventqueue_cancel_return
Changed EventQueue::cancel to return boolean value
2019-08-27 20:50:03 +02:00
Martin Kojtal a1540c5f77
Merge pull request #11245 from dextero/8bit-sms
AT_CellularSMS: allow configuring SMS encoding (7-bit/8-bit) at initialization
2019-08-23 13:51:59 +02:00
Martin Kojtal 5c09ff12ac
Merge pull request #11220 from jarvte/fix_cellular_dns_test
Fix cellular dns test with IAR compiled binary
2019-08-22 10:57:22 +02:00
Teppo Järvelin 719117e12c Fix EventQueue::cancel to return value 2019-08-20 15:56:41 +03:00
Martin Kojtal 181f4f7e93
Merge pull request #11067 from Tharazi97/equeue_tests
Add Unittest equeue tests
2019-08-20 10:28:23 +02:00
Martin Kojtal 0b49952b9e
Merge pull request #11249 from dextero/get-sms-zero
Make AT_CellularSMS::list_messages support index 0 in SMS inbox
2019-08-20 10:27:57 +02:00
Martin Kojtal b849bc1e3d
Merge pull request #11201 from mirelachirica/bug_virtual_in_constructor
Cellular: Fixed improper AT handler setup through virtual calls in co…
2019-08-20 09:52:28 +02:00
Martin Kojtal 64fb49e4ec
Merge pull request #11169 from dmaziec1/TLSSocketWrapper_recvfrom_modified
TLSSocketWrapper::recvfrom sets SocketAddress output variable
2019-08-20 09:41:39 +02:00
Martin Kojtal a5a2036c65
Merge pull request #11224 from AnttiKauppila/Coverity_fixes
Coverity issues fixed
2019-08-20 09:40:20 +02:00
Marcin Radomski ce0bb7f568 Update test_AT_CellularSMS_get_sms
0 is now a valid value
2019-08-16 14:25:29 +02:00
Marcin Radomski cd7e6c9708 Adjust AT_CellularSMS_stub API 2019-08-16 12:33:48 +02:00
Mirela Chirica 75c823c1a3 Cellular: Fixed improper AT handler setup through virtual calls in constructor
Added AT handler setup method to be used for initialisation routines
that are virtual and therefore cannot be called from constructor.
2019-08-16 10:57:37 +03:00
Anna Bridge 2af2b1b18b
Merge pull request #11190 from jarvte/fix_wise1570_netsocket_tests
Cellular: failure when deleting created context is not considered error
2019-08-15 12:58:32 +01:00
Antti Kauppila 84063bf222 Coverity issues fixed 2019-08-14 16:22:05 +03:00
Teppo Järvelin 6a17d74b55 Cellular: notify global up after we have IP address
CellularContext now tries to get an IP address after connect and before
sending NSAPI_STATUS_GLOBAL_UP. Even if we don't the IP address from
the modem we will send NSAPI_STATUS_GLOBAL_UP and return success.
Modem has an ip address but for some reason some modems don't
give it to us.
2019-08-14 12:54:13 +03:00
Teppo Järvelin 3c1bf0a9e2 Cellular: moved string_to_pdp_type from AT_CellularContext to CellularUtil
string_to_pdp_type is a common method for AT and other layers.
Without moving there will be duplicate methods.
2019-08-12 10:27:57 +03:00
Szymon Kwiatkowski c06b11b386 Add Unittest equeue tests 2019-08-09 12:45:29 +02:00
Teppo Järvelin 10251ab3b2 Cellular: failure when deleting created context is not considered as an error
If delete fails there is nothing we or application can do. There is no point
returning an error for this. This affects to AT_CellularContext::disconnect
not returning an error if context delete fails.
2019-08-09 12:27:25 +03:00
Seppo Takalo 7d7416558a
Merge pull request #11073 from ARMmbed/feature-public-headers
Feature public headers
2019-08-07 16:04:45 +03:00
Dominika Maziec e9059c214c TLSSocketWrapper::recvfrom sets SocketAddress output variable
UNITTEST added. TLSSocketWrapper unittest does not use stoip4_stub anymore.
2019-08-06 15:07:39 +02:00
Ari Parkkila e1124668db Cellular: Add DNS servers from PDP contexts to nsapi_dns 2019-08-05 21:53:24 -07:00
George Psimenos 3b23edb78c Fix CI for branch feature-public-headers (#11093)
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
2019-08-02 12:32:40 +01:00
Hugues Kamba 20f81e19be Change Doxygen groups structure, splitting first by Public/Internal (#11105)
* Change Doxygen groups structure, splitting first by Public/Internal

This commit also does the following:
* groups the documentation of related API
* moves `events/internal/equeue.h` to `events/equeue.h`
* merges `events/source/README.md` to `events/README.md`
2019-08-02 12:23:47 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00
Kimmo Vaisanen 882c21bf0b Fix MBED_ASSERT for UTs
For UTs mbed_assert_internal should not be declared as MBED_NORETURN
as UT stub for mbed_assert_internal only prints out the assert trace
and returns back to original code.
2019-07-31 15:06:28 +03:00
Kevin Bracey 852a626399 Add mstd_xxx headers to unit tests
Stripped down headers that route through to `std` forms more - eg
no local implementation of `atomic` or `mutex`.
2019-07-18 20:02:07 +03:00
Kevin Bracey fc8e8f67c6 Deprecate wait/wait_ms APIs 2019-07-15 10:13:50 +03:00
Kevin Bracey 83b329cb71 RTOS API for bare metal
Provide partial RTOS API for bare metal builds - things that
can be done in a single threaded environment.

Allows more code to work in both RTOS and bare metal builds without
change, and in particular gives easy access to the ability to
efficiently wait for something occurring in interrupt.

Available in bare-metal:
* ThisThread
* osThreadFlagsSet to set flags on main thread (can be set from IRQ)
* EventFlags (can be set from IRQ)
* Semaphores (can be released from IRQ)
* Mutex (dummy implementation)

Not useful:
* ConditionVariable (could only be signalled from 2nd thread)
* RtosTimer (calls in a second thread context)
* Thread

Unimplemented:
* Mail, Queue, MemoryPool

Possible future work:
* ConditionVariableCS to act as IRQ signalled ConditionVariable
2019-07-15 10:13:50 +03:00
Kevin Bracey 607856ee9a Set unit tests to C++14
Adjust some non-C++11-compatible code that failed as a result.
2019-07-09 19:08:57 +03:00
Martin Kojtal 7059221817
Merge pull request #10925 from AnttiKauppila/buff_size_fix
Doubled ATHandler's BUFF_SIZE
2019-07-03 11:48:02 +01:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal 25fbd3956b Watchdog: remove VirtualWatchdog
We will provide documentation how to create your own VirtualWatchdog. It's simple,
create timeout and watchdog objects.

This class brought lot of discussion and questions. After our refactor we made this class
just a linked list of objects - something tickers can do as well (they already have linked list) and handling hw should be
done via Watchdog due to the limitations (timeout can be set only once per app!).
2019-07-02 12:46:23 +01:00
Filip Jagodzinski 968e270b0b Watchdog: Fix unittests
Compare get_timeout against the last timeout successfully set.
Merge most of the test cases into one. Do not rely on the tests
execution order.
Fix the watchdog_api_stub to keep timeout value set by init function.
2019-07-02 12:46:23 +01:00
Martin Kojtal fd445a57cb Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
2019-07-02 12:46:23 +01:00
Martin Kojtal 89c0ab793e VirtualWatchdog: process fail test expects 0 as reset - no ticker running 2019-07-02 12:46:23 +01:00
Filip Jagodzinski cc7a3dd677 Fix more unittest errors 2019-07-02 12:46:23 +01:00
Filip Jagodzinski 1c12f9b2b0 Fix unittest errors 2019-07-02 12:46:23 +01:00
Martin Kojtal 529f4a2a7e unittest: add virtualwatchdog stub 2019-07-02 12:46:23 +01:00
Martin Kojtal 33f8b35917 watchdog unittest: fix naming after refactor 2019-07-02 12:46:23 +01:00
Martin Kojtal 8231efc41c unittest: remove platform watchdog (moved to drivers) 2019-07-02 12:46:23 +01:00
Martin Kojtal 4549a22566 unittest: move watchdog files to drivers
Test VirtualWatchdog and Watchdog
2019-07-02 12:46:23 +01:00
Martin Kojtal 8bbba26842 unittest: rename watchdog to VirtualWatchdog 2019-07-02 12:46:23 +01:00
Martin Kojtal 2d77fccb09 Watchdog: update unittests 2019-07-02 12:46:23 +01:00
Antti Kauppila 369e2d53ff Fixed unittests 2019-07-02 10:17:06 +03:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Anna Bridge 15b5b5da23
Merge pull request #10694 from jarvte/set_authentication_type
Cellular: add method to set authentication type to CellularContext
2019-06-21 12:19:04 +01:00
Anna Bridge 6000724de6
Merge pull request #10703 from AnttiKauppila/optimisation
Cellular: Removed boilerplate code
2019-06-19 12:06:10 +01:00
Antti Kauppila 1ed338ef28 Valgrind & unittest fixes 2019-06-13 15:15:53 +03:00
Rajkumar Kanagaraj c41d80330e Fixed the unittest case failure 2019-06-03 16:32:14 +02:00
Rajkumar Kanagaraj dfe4b533c3 Update Watchdog
- Changed the process into static method
 - used the singletonptr for creating the low power ticker instance
 - Added the mbed stub into cmake build for cellularnonipsocket,loramacrypto
2019-06-03 15:31:20 +02:00
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