Skip to content

Release candidate for mbed-os-5.11.3 #9508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 107 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
6be2ef2
Add nanostack support for KW41Z
mmahadevan108 Feb 8, 2018
c0c002d
Update TEST_APPS to add KW41Z for nanostack tests
mmahadevan108 Dec 14, 2018
6e67930
Supply test config for KW41Z
mmahadevan108 Jan 10, 2019
9fb04a9
Remove unnecessary error prints in FileSystemStore
Jan 13, 2019
0277fc3
NUCLEO_H743ZI : enable TICKLESS
jeromecoutant Jan 11, 2019
e495866
fixes disconnect to check the state from modem
Jan 11, 2019
da99f9e
Add doxygen spellcheck jobs to Travis
kegilbert Nov 30, 2018
6e3006d
add qspif as default storage for LPCXpresso546XX
Jan 14, 2019
582c84a
Moved nextTimeout variable out of critical section in BLE::callDispat…
lrusinowicz Jan 14, 2019
f306233
Removing the dependency of TDBStore in SystemStorage.h and NVStore co…
Jan 13, 2019
8eb1c01
Moving KVStore to include sub folder For TFM support
Jan 13, 2019
f0d828c
Moving DirectAccessDevicekey.h and DirectAccessDevicekey.cpp to direc…
Jan 13, 2019
608c79a
Remove TARGET prefix from the TARGET_BYPASS_NVSTORE_CHECK and leave i…
Jan 14, 2019
273323d
Gemalto Crinterion UDP test adjustments
michalpasztamobica Jan 8, 2019
7cd0cca
Initial version for Quectel M26 GSM/GPRS Module.
tz-arm Jan 3, 2019
19a88e0
Set target C030-R412M in mbed
fahimalavi Jan 14, 2019
891986a
Sleep manager implements all the API's in platform/mbed_sleep_manager…
Jan 7, 2019
2f371bd
Update the header files
Jan 8, 2019
97bf0d5
uARM targets now build in correct ARM_MICRO directory
bridadan Jan 8, 2019
64bb010
Drop signalling SIGIO artificially if UDP send fails
Jan 10, 2019
1eed266
fixes a debug print
Jan 10, 2019
4b7f273
FLASHIAP test: skip test if test region overlaps code
jeromecoutant Jan 4, 2019
64eff0a
Minor Doxygen fixes for BufferedBlockDevice and iBeacon
Jan 10, 2019
b1106ff
Review updates
Jan 10, 2019
9198f93
Update iBeacon.h
GuyWi Jan 10, 2019
985e1d3
thread_mle_message_handler: fix build warning
Jan 10, 2019
c5edbe0
Fix race condition when generating OOB data
costanic Jan 8, 2019
09bd512
Fix parameters provided to oob generator function
costanic Jan 8, 2019
3b99566
Remove own_oob and peer_oob flags from Nordic PAL
costanic Jan 8, 2019
4469600
adds an error check for data overflow from modem side
Jan 14, 2019
c92dac8
TCP/UDP greentea tests refactoring and cleanup
michalpasztamobica Jan 14, 2019
04fb1ec
open hal lib source
Jan 15, 2019
b824172
Clarify addition to CONFIGURATION.md
Jan 16, 2019
70569fa
Fixes typos in SMSC9220 Ethernet driver
kapi90 Jan 15, 2019
57e1b46
DirectAccess DeviceKey added support for default storage type
Jan 17, 2019
7059d44
Extended mount to check all metadata-pairs
geky Jan 17, 2019
7ae8e94
general_block_device test fixed to always erase prior to first program
Jan 15, 2019
1133a65
tools: build_api: remove redundant initialization and fix spelling
Jan 17, 2019
a08c3af
STM32H743ZI: iar removal as not supported in v7.x
0xc0170 Jan 18, 2019
bb5e456
FLASH test: skip test if test region overlaps code
jeromecoutant Jan 4, 2019
7aa3f48
PB_1 is not connected to D4 in R412M above
fahimalavi Jan 18, 2019
4aca75a
fix truncation
paul-szczepanek-arm Jan 16, 2019
9a04abb
Netsocket DNS test: increase timeout value
jeromecoutant Jan 17, 2019
5077d6f
add missing null checks
paul-szczepanek-arm Jan 16, 2019
fa93058
error when there is no handler
paul-szczepanek-arm Jan 18, 2019
37ab6ec
Allow NSAPI_ERROR_UNSUPPORTED from Socket::setsockopt()
Jan 17, 2019
7643868
ROTS: SysTimer: Fix test timing issues
Jan 17, 2019
89ffe62
Added specific versions of Travis-only modules Use requirements.txt t…
Jan 16, 2019
74187e7
Shuffled around version checks to be more useful in case of failure
Jan 16, 2019
adc768b
Added warning suppression to python api_tests. Apparently local lapto…
Jan 16, 2019
6750550
Updated requirements.txt to be more module-version resilliant. Moved …
Jan 16, 2019
89bc39e
Added pyocd requirement. Dependency tree: icetea > mbed_flasher > pyocd
Jan 17, 2019
b68628a
Add Travis include mbed.h check
alekla01 Jan 8, 2019
6c5ab0c
Put LittleFS emulated BD module under .mbedignore
Jan 20, 2019
6688b55
stm32: Improve the CRC function to support fully accumulate
kevinong0108 Jan 11, 2019
536b7a6
stm32: remove empty line
kevinong0108 Jan 11, 2019
38e1152
stm32: fix F1/F2/F4/L1 compile fail after enable CRC
kevinong0108 Jan 11, 2019
56e488a
stm32: F1/F2/F4/L1 set to not supported HW CRC
kevinong0108 Jan 11, 2019
0e69cd9
stm32: fix some F0 target compile error
kevinong0108 Jan 17, 2019
f0006ad
stm32: fix typo
kevinong0108 Jan 17, 2019
50e2e05
stm32: fix indent style
kevinong0108 Jan 17, 2019
7864012
Examples: enabled some examples build for FVP_MPS2_M3 target
Jan 19, 2019
492e3eb
Fixing a bug in FileSystemStore to get the folder path from kv_config…
Jan 16, 2019
02df4cb
LPC546XX, LPC54114: Add README and LICENSE files for the power libraries
mmahadevan108 Jan 11, 2019
09c8b99
Fix links to documentation on https://os.mbed.com
vmedcy Jan 21, 2019
331c66d
Add SPIF_ULBPR command and replace wrong command to clear all write-p…
DBS06 Jan 17, 2019
afd7f41
Add SPIF_ULBPR command also to QSPIFBlockDevice and SPIFReducedBlockD…
DBS06 Jan 17, 2019
c17d4f0
Update Comments
DBS06 Jan 17, 2019
7dc93e0
Set DSP and floating point flags for ASM files
Jan 18, 2019
c5747c4
DSP_PRESENT flag is needed for Armv8m devices having DSP enabled
Jan 17, 2019
0332f84
Adding a test if device key buffer has changed after calling to entro…
Jan 9, 2019
75fbc58
Fixes for PSoC6 serial interface, asynchronous mode.
lrusinowicz Jan 14, 2019
b5720fd
Any RX event should end read operation.
lrusinowicz Jan 21, 2019
247866a
ESP8266: makes connect() connection status aware
Jan 16, 2019
8927bf7
ESP8266: turns connect fully to non-blocking mode
Jan 21, 2019
32f3b09
ESP8266: provides blocking/non-blocking connect
Jan 21, 2019
b1d8ee5
mbed-host-tests minimum requirement set
Jan 22, 2019
5f4fbdb
NRF5x: min read/write implementation
j3hill Jan 8, 2019
72209e8
NRF5x: QSPI SFDP read implementation
j3hill Jan 23, 2019
fe32af1
Remove printf completely and fix the optimization check
SenRamakri Jan 8, 2019
4eec1c6
Increase the timeout for the host side script and the test
SenRamakri Jan 11, 2019
4c39d86
Add debug prints to triage the test timeouts
SenRamakri Jan 22, 2019
75808f7
Print crash report reboot messages only for non-release builds
SenRamakri Jan 23, 2019
757a7c6
fix bug for RDA UNO_91H:calling us ticker functions without init. sol…
caixue1102 Jan 16, 2019
235d3b8
STM32: FDCAN support for H7 family
jeromecoutant Jan 15, 2019
473df45
NUCLEO_H743ZI: CAN support
jeromecoutant Jan 7, 2019
a1588b3
Rename the platform specific crypto_platform
Jan 22, 2019
b261a6d
Rename the platform context varaiable
Jan 22, 2019
9a8d748
Corrected the targets value in json file as CI uses real board names
Jan 22, 2019
80b261c
Start test by formatting SD Card, otherwise FATFS mount might fail Fi…
Jan 24, 2019
c670ef8
realtek: revert license change
0xc0170 Jan 24, 2019
672665a
travis: remove phonedat database
0xc0170 Jan 24, 2019
207aa6c
Add empty en_phonet.
Jan 24, 2019
6e31385
Update PSA binaries importer for FUTURE_SEQUANA_PSA
Jan 2, 2019
9ade3a6
Add license
Jan 2, 2019
37ca77c
Typo
Jan 14, 2019
e4b811d
Skip redundant binaries
Jan 24, 2019
3b3af7a
Fix for license check job. Somehow, having the '!' before a single co…
cmonr Jan 24, 2019
3af4a2f
Updated license_check to work a bit better across line boundries.
Jan 24, 2019
7d0fe7e
Replaced '|' with '>' (affects how newlines are parsed)
Jan 24, 2019
095ba57
Update Mbed version block
adbridge Jan 25, 2019
3099acc
Add FLASH support to TARGET_MAX32620C MCU and derivative platform tar…
Dec 12, 2018
2065890
STM32L496xG: increase IAR heap size
jeromecoutant Jan 16, 2019
3f5c4de
examples: fix incorrect target addition in 5.11.3rc
0xc0170 Jan 26, 2019
481b6fb
Merge pull request #9548 from davidsaada/david_flashiap_retries
Jan 30, 2019
18fc01f
Merge pull request #9547 from kjbracey-arm/die_wait_us
Jan 30, 2019
36bb984
Merge pull request #9544 from kjbracey-arm/reboot_limit_fix
Jan 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!--
Required
Add detailed description of what you are reporting.
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
Things to consider sharing:
- What target does this relate to?
- What toolchain (name + version) are you using?
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--
Required
Add here detailed changes summary, testing results, dependencies
Good example: https://os.mbed.com/docs/latest/reference/workflow.html (Pull request template)
Good example: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html (Pull request template)
-->


Expand Down
54 changes: 45 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ matrix:
- doxygen doxyfile_options 2>&1
# Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
# - ( ! doxygen doxyfile_options 2>&1 | grep . )

# Assert that all binary libraries are named correctly
# The strange command below asserts that there are exactly 0 libraries
# that do not start with lib
Expand All @@ -106,12 +105,20 @@ matrix:
install:
# Install dependencies
- sudo apt-get install gcc-arm-embedded
- pip install -r requirements.txt
- pip install pytest pylint hypothesis==3.88.3 mock coverage coveralls
# Print versions we use

- arm-none-eabi-gcc --version
# Add additional dependencies specific for testing
- python --version
- |-
tr -d ' ' >> requirements.txt <<< "
mock==2.0.0
pytest==3.3.0
pylint>=1.9,<2
hypothesis>=3,<4
coverage>=4.5,<5
coveralls>=1.5,<2
"
# ... and install.
- pip install -r requirements.txt
- pip list --verbose
script:
# Run local testing on tools
Expand All @@ -122,7 +129,27 @@ matrix:
after_success:
# Coverage for tools
- coveralls
# Report success since we have overridden default behaviour
# Report success since we have overridden default behavior
- bash -c "$STATUS" success "Local $NAME testing has passed"

- env:
- NAME=doxy-spellcheck

install:
- sudo apt-get install aspell

script:
# Run local testing on header file doxy
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh drivers
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh platform
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh events
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh rtos
- ./tools/test/travis-ci/doxy-spellchecker/spell.sh features/netsocket

after_success:
# Coverage for tools
- coveralls
# Report success since we have overridden default behavior
- bash -c "$STATUS" success "Local $NAME testing has passed"

# - <<: *tools-pytest
Expand Down Expand Up @@ -275,9 +302,18 @@ matrix:
- env:
- NAME=licence_check
script:
- echo 'Checking that there is no GPL licence text in code'
- ! git grep -q --ignore-case "gnu general public";
- ! git grep -q --ignore-case "gnu library general public";
- >-
! grep --recursive --max-count=100 --ignore-case --exclude .travis.yml \
"gnu general\|gnu lesser\|lesser general\|public license"
- env:
- NAME=include_check
script:
- echo 'Checking that there are no '#include "mbed.h"' in code where it should not be'
- |
! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'
- env:
- NAME=psa-autogen
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Mbed OS is an open-source, device software platform for the Internet of Things. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.

To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/latest/reference/contributing.html).
To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for [contributing to Mbed OS](https://os.mbed.com/docs/mbed-os/latest/contributing/index.html).
2 changes: 1 addition & 1 deletion TESTS/host_tests/crash_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_steps(self):
wait_after_reset = wait_after_reset if wait_after_reset is not None else DEFAULT_CYCLE_PERIOD

#Wait 2 seconds for system to init
time.sleep(2.0)
time.sleep(7.0)
#self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)
self.send_kv(MSG_KEY_DEVICE_ERROR, MSG_VALUE_DUMMY)
time.sleep(5.0)
Expand Down
5 changes: 5 additions & 0 deletions TESTS/mbed_drivers/flashiap/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void flashiap_cross_sector_program_test()
agg_size += sector_size;
address -= sector_size;
}
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address, agg_size);
TEST_ASSERT_EQUAL_INT32(0, ret);
Expand Down Expand Up @@ -184,6 +185,7 @@ void flashiap_program_error_test()
TEST_ASSERT_TRUE(address != 0UL);

// unaligned address
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, address);
TEST_SKIP_UNLESS_MESSAGE(address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");
ret = flash_device.erase(address + 1, sector_size);
TEST_ASSERT_EQUAL_INT32(-1, ret);
Expand Down Expand Up @@ -220,6 +222,9 @@ void flashiap_timing_test()
utest_printf("\nFlash timing:\n");
uint32_t sector_size = flash_device.get_sector_size(end_address - 1UL);
uint32_t base_address = end_address - sector_size;
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, base_address);
TEST_SKIP_UNLESS_MESSAGE(base_address >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

timer.start();
for (num_write_sizes = 0; num_write_sizes < max_write_sizes; num_write_sizes++) {
if (write_size > sector_size) {
Expand Down
7 changes: 7 additions & 0 deletions TESTS/mbed_hal/flash/functional_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ void flash_erase_sector_test()
uint32_t last_sector_size = flash_get_sector_size(&test_flash, addr_after_last - 1);
uint32_t last_sector = addr_after_last - last_sector_size;
TEST_ASSERT_EQUAL_INT32(0, last_sector % last_sector_size);

utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, last_sector);
TEST_SKIP_UNLESS_MESSAGE(last_sector >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

ret = flash_erase_sector(&test_flash, last_sector);
TEST_ASSERT_EQUAL_INT32(0, ret);

Expand All @@ -201,6 +205,9 @@ void flash_program_page_test()

// sector size might not be same as page size
uint32_t erase_sector_boundary = ALIGN_DOWN(address, flash_get_sector_size(&test_flash, address));
utest_printf("ROM ends at 0x%lx, test starts at 0x%lx\n", FLASHIAP_APP_ROM_END_ADDR, erase_sector_boundary);
TEST_SKIP_UNLESS_MESSAGE(erase_sector_boundary >= FLASHIAP_APP_ROM_END_ADDR, "Test skipped. Test region overlaps code.");

ret = flash_erase_sector(&test_flash, erase_sector_boundary);
TEST_ASSERT_EQUAL_INT32(0, ret);

Expand Down
7 changes: 6 additions & 1 deletion TESTS/mbed_platform/crash_reporting/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ void test_crash_reporting()

// Report readiness
greentea_send_kv(MSG_KEY_DEVICE_READY, MSG_VALUE_DUMMY);
printf("\nMessage sent: %s\n", MSG_KEY_DEVICE_READY);

static char _key[MSG_KEY_LEN + 1] = { };
static char _value[MSG_VALUE_LEN + 1] = { };

printf("\nWaiting for crash inject error message: %s\n", MSG_KEY_DEVICE_ERROR);
greentea_parse_kv(_key, _value, MSG_KEY_LEN, MSG_VALUE_LEN);
printf("\nCrash inject error message received\n");

if (strcmp(_key, MSG_KEY_DEVICE_ERROR) == 0) {
printf("\nForcing error\n");
MBED_ERROR1(MBED_ERROR_OUT_OF_MEMORY, "Executing crash reporting test.", 0xDEADBAD);
TEST_ASSERT_MESSAGE(0, "crash_reporting() error call failed.");
}
Expand All @@ -67,7 +72,7 @@ void test_crash_reporting()

int main(void)
{
GREENTEA_SETUP(30, "crash_reporting");
GREENTEA_SETUP(40, "crash_reporting");
test_crash_reporting();
GREENTEA_TESTSUITE_RESULT(0);

Expand Down
5 changes: 4 additions & 1 deletion TESTS/mbedmicro-rtos-mbed/systimer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ void test_handler_called_once(void)
int32_t sem_slots = st.sem_wait(0);
TEST_ASSERT_EQUAL_INT32(0, sem_slots);

sem_slots = st.sem_wait(osWaitForever);
// Wait in a busy loop to prevent entering sleep or deepsleep modes.
while (sem_slots != 1) {
sem_slots = st.sem_wait(0);
}
us_timestamp_t t2 = st.get_time();
TEST_ASSERT_EQUAL_INT32(1, sem_slots);
TEST_ASSERT_EQUAL_UINT32(1, st.get_tick());
Expand Down
4 changes: 4 additions & 0 deletions TESTS/netsocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ content at minimum:
"help" : "Port of echo server",
"value" : "7"
}
"echo-server-discard-port" : {
"help" : "Discard port of echo server",
"value" : "9"
}
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion TESTS/netsocket/dns/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void net_bringup()
// Test setup
utest::v1::status_t test_setup(const size_t number_of_cases)
{
GREENTEA_SETUP(120, "default_auto");
GREENTEA_SETUP(200, "default_auto");
net_bringup();
return verbose_test_setup_handler(number_of_cases);
}
Expand Down
46 changes: 22 additions & 24 deletions TESTS/netsocket/tcp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
using namespace utest::v1;

namespace {
NetworkInterface *net;
Timer tc_bucket; // Timer to limit a test cases run time
}

Expand All @@ -45,11 +44,6 @@ mbed_stats_socket_t tcp_stats[MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT];
char tcp_global::rx_buffer[RX_BUFF_SIZE];
char tcp_global::tx_buffer[TX_BUFF_SIZE];

NetworkInterface *get_interface()
{
return net;
}

void drop_bad_packets(TCPSocket &sock, int orig_timeout)
{
nsapi_error_t err;
Expand All @@ -65,46 +59,50 @@ void drop_bad_packets(TCPSocket &sock, int orig_timeout)

static void _ifup()
{
net = NetworkInterface::get_default_instance();
NetworkInterface *net = NetworkInterface::get_default_instance();
nsapi_error_t err = net->connect();
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, err);
printf("MBED: TCPClient IP address is '%s'\n", net->get_ip_address());
}

static void _ifdown()
{
net->disconnect();
NetworkInterface::get_default_instance()->disconnect();
printf("MBED: ifdown\n");
}

nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock)
nsapi_error_t tcpsocket_connect_to_srv(TCPSocket &sock, uint16_t port)
{
SocketAddress tcp_addr;

get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(MBED_CONF_APP_ECHO_SERVER_PORT);
NetworkInterface::get_default_instance()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(port);

printf("MBED: Server '%s', port %d\n", tcp_addr.get_ip_address(), tcp_addr.get_port());

nsapi_error_t err = sock.open(get_interface());
nsapi_error_t err = sock.open(NetworkInterface::get_default_instance());
if (err != NSAPI_ERROR_OK) {
printf("Error from sock.open: %d\n", err);
return err;
}

return sock.connect(tcp_addr);
}

nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock)
{
SocketAddress tcp_addr;

get_interface()->gethostbyname(MBED_CONF_APP_ECHO_SERVER_ADDR, &tcp_addr);
tcp_addr.set_port(9);

nsapi_error_t err = sock.open(get_interface());
err = sock.connect(tcp_addr);
if (err != NSAPI_ERROR_OK) {
printf("Error from sock.connect: %d\n", err);
return err;
}

return sock.connect(tcp_addr);
return NSAPI_ERROR_OK;
}

nsapi_error_t tcpsocket_connect_to_echo_srv(TCPSocket &sock)
{
return tcpsocket_connect_to_srv(sock, MBED_CONF_APP_ECHO_SERVER_PORT);
}

nsapi_error_t tcpsocket_connect_to_discard_srv(TCPSocket &sock)
{
return tcpsocket_connect_to_srv(sock, MBED_CONF_APP_ECHO_SERVER_DISCARD_PORT);
}

void fill_tx_buffer_ascii(char *buff, size_t len)
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ void TCPSOCKET_BIND_ADDRESS()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
SocketAddress sockAddr = SocketAddress(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
SocketAddress sockAddr = SocketAddress(NetworkInterface::get_default_instance()->get_ip_address(), 80);
nsapi_error_t bind_result = sock->bind(sockAddr);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_invalid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_ADDRESS_INVALID()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind("190.2.3.4", 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_address_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_ADDRESS_NULL()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(NULL, 1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_address_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ void TCPSOCKET_BIND_ADDRESS_PORT()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
nsapi_error_t bind_result = sock->bind(get_interface()->get_ip_address(), 80);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(NetworkInterface::get_default_instance()->get_ip_address(), 80);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
} else {
Expand Down
3 changes: 2 additions & 1 deletion TESTS/netsocket/tcp/tcpsocket_bind_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_PORT()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand Down
5 changes: 3 additions & 2 deletions TESTS/netsocket/tcp/tcpsocket_bind_port_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void TCPSOCKET_BIND_PORT_FAIL()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock->open(NetworkInterface::get_default_instance()));
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
TEST_IGNORE_MESSAGE("bind() not supported");
Expand All @@ -51,7 +52,7 @@ void TCPSOCKET_BIND_PORT_FAIL()
if (!sock2) {
TEST_FAIL();
}
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock2->open(get_interface()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock2->open(NetworkInterface::get_default_instance()));
TEST_ASSERT_EQUAL(NSAPI_ERROR_PARAMETER, sock2->bind(1024));

delete sock;
Expand Down
1 change: 1 addition & 0 deletions TESTS/netsocket/tcp/tcpsocket_bind_unopened.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void TCPSOCKET_BIND_UNOPENED()
TCPSocket *sock = new TCPSocket;
if (!sock) {
TEST_FAIL();
return;
}
nsapi_error_t bind_result = sock->bind(1024);
if (bind_result == NSAPI_ERROR_UNSUPPORTED) {
Expand Down
Loading