Commit Graph

1032 Commits (mbed-os-6.17.0-rc3)

Author SHA1 Message Date
tobi15 d720db5bc8 modify AT_CellularDevice_stub to pass test with the new feature 2022-04-21 17:29:10 +02:00
hifoolno 173c070d7d tcp_out: fix tcp_output_fill_options() arguments 2022-04-20 21:46:35 +08:00
merge 337b811ba1 add the possibility to customize the delimiter of the ATHandler in ATCellularDevice class 2022-04-20 14:21:31 +02:00
Chun-Chieh Li 56f4b4cd29 Mbed TLS: Fix compile error with ECP alternative
Fix un-paired parenthesis when MBEDTLS_ECP_RANDOMIZE_MXZ_ALT is enabled
2022-04-08 17:24:55 +08:00
Chun-Chieh Li 0d2de99778 ESP8266: Fix serial flow control inconsistency on reconnect
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
2022-03-07 18:30:36 +08:00
Martin Kojtal 2d59c759bd
Merge pull request #15227 from zul00/fix/lora_timing/join_req_retransmission/call_in
lorawan: Fix Join Request retransmission timing (Interop test)
2022-02-16 16:36:30 +01:00
zul 61f83741b0 Fixed Join Request retransmission timing (Interop test)
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)
2022-02-14 12:07:29 +01:00
Zulkarnaen 1e9254387e Fixed issue in unconfirmed_retransmission behavior
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
2022-02-11 15:04:23 +01:00
LukaB d503495189 Fix STM32 radio driver when bandwith is 0
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.
2022-02-03 08:24:21 +13:00
Martin Kojtal fe5e648147
Merge pull request #15192 from ATmobica/master
Add option to disable WHD component for Cypress targets
2021-12-15 11:59:33 +00:00
Martin Kojtal ff061e8cf2
Merge pull request #15187 from artokin/nanostack_release_v15_1_0
Nanostack release v15.1.0 to master
2021-12-13 09:46:45 +00:00
ATmobica 78a7859fa8 Add <"WHD" IN_LIST MBED_TARGET_LABELS> condition to Cypress boards and wifi driver cmake files 2021-12-10 13:14:29 +01:00
Martin Kojtal 1c5813b33c
Merge pull request #15181 from hallard/LoRa_sx1276_LowPower_fix
Fix LoRa sx1276 Low Power sleep, now 3uA
2021-12-08 14:55:52 +00:00
Arto Kinnunen 357dbec020 Merge commit '1d440bc3adfe6afbd60ff8c39dd267aa925716c3' into nanostack_v15_1_0
* commit '1d440bc3adfe6afbd60ff8c39dd267aa925716c3':
  Squashed 'connectivity/nanostack/sal-stack-nanostack-eventloop/' changes from fb20d3f32c..60c1fb61af
2021-12-08 13:54:43 +02:00
Arto Kinnunen d64e8f6878 Merge commit '89eb48fe1a3ba68057029c7e475f1ec78eb95abc' into nanostack_v15_1_0
* commit '89eb48fe1a3ba68057029c7e475f1ec78eb95abc':
  Squashed 'connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/' changes from 61de9be6dc..7a1bfec754
2021-12-08 13:48:16 +02:00
Arto Kinnunen 9daf4300e3 Merge commit '75c79ac616fce0b36ca047e676069e12e1bb30c1' into nanostack_v15_1_0
* commit '75c79ac616fce0b36ca047e676069e12e1bb30c1':
  Squashed 'connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/' changes from 7d12478914..089ca0eed7
2021-12-08 13:47:47 +02:00
Arto Kinnunen a947f4845c Merge commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53' into nanostack_v15_1_0
* commit '233ec783c1b902af25f1376d6fcdc9f4b0bccf53':
  Squashed 'connectivity/drivers/802.15.4_RF/atmel-rf-driver/' changes from 834c5357c6..ccba775217
2021-12-08 13:47:18 +02:00
Arto Kinnunen 0dfb79e28b Merge commit '00253cb11629fab6f753682d89faa2ce7b4a213a' into nanostack_v15_1_0
* commit '00253cb11629fab6f753682d89faa2ce7b4a213a':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 225a4af94f..154db5425e
2021-12-08 13:41:33 +02:00
Jerome Coutant fb07b7ac4c STM32WL : add LORA robustness
Improvment to support extensive tests
2021-12-06 17:48:35 +01:00
Martin Kojtal f609a5234e
Merge pull request #15177 from danluck/master
Fix overflow at extremely low RSSI
2021-11-29 16:54:11 +00:00
Charles ccc34b9134 Fix Low Power sleep, now 3uA 2021-11-29 17:16:09 +01:00
ATmobica 784f17b26c Add netbuf-recvinfo-enabled config to LWIP mbed_lib.json 2021-11-25 17:18:35 +01:00
Mikhail Isaev 352e6fbd23 Fix overflow at extremely low RSSI
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.
2021-11-24 21:56:42 +03:00
Martin Kojtal 0db0445a97
Merge pull request #15111 from world-direct/feature/dtlserror
DTLSSocket - destruction while handshaking lead to error
2021-11-17 15:25:29 +00:00
Martin Kojtal ae5c9ec70e
Merge pull request #15153 from bakatrouble/master
STM32F722ZE port
2021-11-17 15:22:30 +00:00
bakatrouble e33088583e Allow STM32F7 targets without Ethernet 2021-10-28 19:18:24 +03:00
Martin Kojtal 07e119b467
Merge pull request #15154 from rardiol/STM32WB55-BLE-HCI_size
STM32WB55 HCI driver: version dependent rom size
2021-10-28 10:09:49 +01:00
Martin Kojtal 555f6beceb
Merge pull request #15147 from boraozgen/bugfix/remove-socket-control-stubs
NetworkStack: Remove stub implementations of socket_x_control
2021-10-25 11:41:04 +02:00
Ricardo Ardissone ca28a86d1b STM32WB55 HCI driver: version dependent rom size
stm32wb5x_BLE_HCILayer_fw.bin install address increased from 0x080E0000
to 0x080E1000 in version 1.12.0. Assumes any future bump to major or
minor version will maintain the new install address.
See https://github.com/STMicroelectronics/STM32CubeWB/blob/master/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/Release_Notes.html
2021-10-22 18:20:33 -03:00
Bora Özgen 7523588035 NetworkStack: Remove stub implementations of socket_x_control
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.
2021-10-21 10:33:13 +02:00
Martin Kojtal 06f234e3af
Merge pull request #15137 from jeromecoutant/PR_WL_1_1_0
STM32WL update drivers version to CUBE V1.1.0
2021-10-15 10:07:02 +02:00
Martin Kojtal e4111eaa0d
Merge pull request #15068 from jeromecoutant/PR_INTERFACE
connectivity tests: avoid HardFault with null pointer
2021-10-14 15:43:07 +02:00
Jerome Coutant 5a1e864003 STM32WL CMakeLists update 2021-10-12 12:20:27 +02:00
Jerome Coutant f42b3e41bf STM32WL LORA radio: add a critical section in IRQ process 2021-10-12 11:01:22 +02:00
Jerome Coutant 4b956bbf3d STM32WL LORA driver: add debug print 2021-10-12 10:36:43 +02:00
Martin Kojtal 6a9ccb3aa3
Merge pull request #15123 from jeromecoutant/PR_MXCHIP
STM32: introduce new wifi driver for B-U585I-IOT02A
2021-10-04 09:43:40 +02:00
Martin Kojtal 7f2b6d0a19
Merge pull request #15103 from artokin/nanostack_release_v15_0_0_master
Nanostack release v15.0.0 to master
2021-09-30 14:07:41 +01:00
Jerome Coutant 998f01a722 STM32: new EMW3080B wifi driver 2021-09-30 14:18:58 +02:00
Jerome Coutant d56a14f329 cmake : enable wifi in netsocket 2021-09-30 14:18:57 +02:00
Jarkko Paso d125480ede Updated 6LoWPAN/CMakeLists.txt 2021-09-29 21:23:04 +03:00
Martin Kojtal 4851f6c0b9
Merge pull request #15107 from DDC-NDRS/ndrs-pst
LWIP: Provide inline replacements for htons() and htonl()
2021-09-29 10:37:11 +01:00
Martin Kojtal ff6d401a86
Merge pull request #15095 from LDong-Arm/ctest_nfc
CMake: greentea: Migrate the NFC EEPROM test to CTest
2021-09-28 13:26:41 +01:00
Lukas Karel 16afca3c03 DTLSSocket handshake timeout calls object functions even if object is destructed. Fixed by removing timeout event from event queue on close/destruction. 2021-09-28 11:07:30 +02:00
ndrs-pst a93aca8a47 LWIP: Provide inline replacements for htons() and htonl() 2021-09-25 15:13:22 +07:00
Arto Kinnunen c8aafa7145 Update Nanostack CMakeLists.txt
Add new files to the CMakeLists.txt
2021-09-23 14:24:02 +03:00
Arto Kinnunen bd96a20145 Merge commit 'a7c7eede53437b0f1f62c89c38ae5a75dfb1b42d'
* commit 'a7c7eede53437b0f1f62c89c38ae5a75dfb1b42d':
  Squashed 'connectivity/nanostack/coap-service/' changes from bbe01736bd..9a9085d4cd
2021-09-23 13:31:31 +03:00
Arto Kinnunen a7c7eede53 Squashed 'connectivity/nanostack/coap-service/' changes from bbe01736bd..9a9085d4cd
9a9085d4cd Updated coap service to be compatible with mbed TLS 3.0 (#135)

git-subtree-dir: connectivity/nanostack/coap-service
git-subtree-split: 9a9085d4cd74ad96320f448a890df43a0cdedbb0
2021-09-23 13:21:08 +03:00
Arto Kinnunen b1adec9028 Merge commit 'fa7202c2e699b26a024d38657a6e495e073fea07'
* commit 'fa7202c2e699b26a024d38657a6e495e073fea07':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
2021-09-23 13:13:36 +03:00
Arto Kinnunen fa7202c2e6 Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
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
2021-09-23 13:04:04 +03:00
Lingkai Dong 58f83597b4 CMake: greentea: Migrate the NFC EEPROM test to CTest 2021-09-20 17:14:06 +01:00
Lingkai Dong ce1f054bd3 CMake: connectivity: Add drivers subdirectory for tests
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.
2021-09-20 16:28:54 +01:00
Lingkai Dong db8852c5d8 CMake: connectivity: Guard unit test directories
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.
2021-09-20 16:28:54 +01:00
Lingkai Dong c01d417ed4 CMake: connectivity: Unify checks for unit and greentea tests
Subdirectories should always be included in the CMake "all" target when
building any tests, either unit tests or greentea tests.
2021-09-20 16:28:53 +01:00
Jerome Coutant 79ae89f740 connectivity tests: avoid crash with null pointer 2021-09-14 10:46:52 +02:00
Jerome Coutant fe1adbcc86 Lora drivers: explicit lib requirement 2021-09-10 09:07:15 +02:00
Jerome Coutant bce33b01ff connectivity-netsocket-tests-tests-network-wifi update2
- add minor print to make debug easier
- remove not useful part
2021-09-09 10:23:42 +02:00
Jerome Coutant 787605cec4 connectivity-netsocket-tests-tests-network-wifi update
Use default NSAPI configuration
2021-09-09 10:23:33 +02:00
Martin Kojtal f89655f2da
Merge pull request #15040 from mat-kalinowski/sendrecv_message
New feature: send/recv message implementation added to network stack
2021-09-09 08:35:19 +01:00
Martin Kojtal 3305dc1494
Merge pull request #15010 from world-direct/feature/reduceTLSspam
Reduce spam on trace because of calling read/write while handshaking
2021-09-09 08:34:27 +01:00
mateusz.kalinowski ad0eb0eaa6 Moving alignment information in the nsapi_msghdr_t
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.
2021-09-08 15:26:41 +01:00
mateusz.kalinowski f8db068f8c Removing FIXME comment and adding empty line in the test file 2021-09-07 14:55:50 +01:00
mateusz.kalinowski 575f489ab7 Fixing documentation errors
Minor errors in the documentation were fixed. These caused failure
of the doxygen checks in the PR.
2021-09-06 11:34:34 +01:00
mateusz.kalinowski c3d16f733f Adding documentation and minor code changes
Doxygen documentation for MsgHeaderIterator was added. Type used
for alignment of the nsapi_msghdr_t struct was changed.
2021-09-06 11:14:54 +01:00
mateusz.kalinowski ec3f4379d9 Code improvements for the unresolved comments
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.
2021-09-03 12:49:00 +01:00
Tymoteusz Bloch bdfd98e764 New feature: send/recv message implementation added to network stack 2021-09-01 09:13:57 +01:00
Martin Kojtal 539d1c784f
Merge pull request #15017 from hallard/STM32WL_HP_optimal
STM32WL fixed current consumption for mode RBI_CONF_RFO_HP
2021-08-30 14:17:01 +01:00
Martin Kojtal 43a060fe7c
Merge pull request #14926 from katherrafi/hal_callback_override
Eth: STM32: Overriding HAL callbacks in stm32xx
2021-08-26 09:51:48 +01:00
Kather Rafi Ibrahim a9f51e31fd Eth: STM32: Overriding HAL callbacks in stm32xx
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>
2021-08-25 14:30:47 +05:30
Charles 6d0747727e added optimal settings for RFO_HP only
fixed wrong help values name

added detailled comments

fix style-check

fix style-check
2021-08-25 10:23:06 +02:00
Lukas Karel 886b2e5000 prevent spam of console 2021-08-17 16:16:58 +02:00
Martin Kojtal 09eee5881e
Merge pull request #14988 from npal-cy/pr/swintegration-501
CYW43XXX Cordio HCI driver: update BT power up sequences to remove redundant delay (500ms) during HCIDrive initialization
2021-08-17 12:20:17 +01:00
Mika Leppänen 096ce41094 Disabled interrupts on smt32f7 and stm32h7 before calling disable data cache
Interrupts are disabled before calling disable data cache on Ethernet initialization.
2021-08-16 13:29:25 +03:00
nazar.palamar b245445ecb Addressed code review comments: 1. remove bt_power member from HCIDriver class; 2. set PullUp for bt_power in CyH4TransportDriver; 3. cleanup code: replace tabs to 4 spaces 2021-08-13 17:25:14 +03:00
nazar.palamar c2f7a9539b Update of BT power up sequences to remove redundant delay (500ms) in BT_POWER operation during HCIDrive initialization.
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)
2021-08-13 17:25:12 +03:00
Martin Kojtal df00ed4efe
Merge pull request #14982 from npal-cy/pr/swintegration-481
CYW43XXX Cordio HCI driver: fixed MCU deep-sleep locking flow
2021-08-13 13:08:36 +01:00
Robert Walton 7842320ab7 CMake: Add option to enable greentea tests
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.
2021-08-10 16:35:11 +01:00
nazar.palamar 1d6843e538 Fixed MCU deep-sleep locking flow in CYW43XXX Cordio HCI driver. The CYW43XXX Cordio HCI driver incorrect handles lock/unlock deep-sleep entry, as results it allows to put PSoC6 in to deep-sleep when CYW43xx does not expect this (the host_wake_up pin in ACTIVE_LOW state, which means hat host must be in ACTIVE mode ).
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.
2021-08-06 16:41:24 +03:00
Lingkai Dong dca2aa79a0 Unit tests: Remove redundant CMake target mbed-headers-base
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.
2021-08-02 17:42:43 +01:00
Lingkai Dong 71962481a4 Unit tests: Remove mbed.h stub from target_h
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.
2021-08-02 17:42:42 +01:00
Lingkai Dong 44cd64a3e4 Unit tests: Fix style in cellular myCellularContext.h stub 2021-08-02 13:47:57 +01:00
Lingkai Dong 57dd6812c3 Unit tests: Move cellular target_h stubs
We move test-specific files from the top-level UNITTESTS directory
into individual components' UNITTESTS/doubles subdirectories.
2021-08-02 13:47:57 +01:00
Martin Kojtal 3318720ada
Merge pull request #14941 from hazzlim/update-tests-to-use-chrono
Update references to time values to use chrono
2021-07-30 12:02:10 +01:00
harmut01 86c2d70a5b Greentea: Remove deprecated APIs and use chrono
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>
2021-07-29 14:06:27 +01:00
Martin Kojtal b94fe130a3
Merge pull request #14288 from boraozgen/bg96-socket-send-segmentation
BG96: Add segmentation to TCP socket send
2021-07-29 10:31:23 +01:00
Charles d13aaf408c
Allow LoRaWAN STM32WL driver debug led to be inverted (#14910) 2021-07-29 10:29:53 +01:00
Robert Walton 98e25f193e unittests: Test_LoRaWANStack.acquire_rx_metadata: Fix SEGFAULT
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.
2021-07-27 21:09:39 +01:00
Robert Walton 421adc9888 unittests: Fix Test_LoRaWANStack.acquire_tx_metadata
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.
2021-07-27 21:09:39 +01:00
Robert Walton 9f3069f1e1 unittests: Test_LoRaMac.post_process_mcps_req: Fix segfault
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.
2021-07-27 21:09:39 +01:00
Robert Walton 2e75d184b6 unittests: Remove ATHandler test interdependencies
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.
2021-07-27 21:09:39 +01:00
Robert Walton a09d08917b CMake: unittests: Show all tests in CTest report
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.
2021-07-27 21:09:39 +01:00
Robert Walton 1e48a61d89 CMake: unittests: Remove trailing whitespace 2021-07-27 21:09:38 +01:00
Jaeden Amero 0a944f0ac4 test: lorawanstack: Use valid message type
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.
2021-07-27 10:28:12 +01:00
Robert Walton 07aefbc6bc unittests: Test_LoRaWANTimer.start: Fix test failure
We weren't initialising the mocks correctly, so an MBED_ASSERT failed in
`LoRaWANTimer::start` because the "timer_id" was not set.
2021-07-27 10:28:12 +01:00
Jaeden Amero 4480abeaf9 cmake: Avoid linking to gcov
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.
2021-07-22 15:41:49 +01:00
Jaeden Amero b17ffaa68a cmake: Remove trailing whitespace
Remove trailing whitespace from lorawantimer's CMakeLists.txt.
2021-07-22 15:41:06 +01:00
Martin Kojtal e060c8c007
Merge pull request #14730 from Ekidna/fix/sx126x-select-pins
Add config macros for device-variant, freq-support and xtal config
2021-07-21 14:52:44 +02:00
Rajkumar Kanagaraj fb5b0ede45 CMake: Limit the mbed-fakes-ble to required dependency mock 2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj 9df7a50f39 CMake: Move ble fakes into FEATURE_BLE double dir
Previously ble fakes as part of UNITTESTS/fakes, this PR moves
ble fakes to FEATURE_BLE double directory to make ble stubs
to be self-contained.
2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj 86737bdb89 Remove mbed-headers-connectivity
Moved all the headers out of mbed-headers-connectivity, and these changes remove
that headers lib reference from lorawan and cellular unit tests
2021-07-21 01:56:29 -07:00
Rajkumar Kanagaraj a61392ae30 CMake: Create mbed-headers-ble library
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.
2021-07-21 01:51:48 -07:00