Skip to content

Commit eca67ca

Browse files
authored
Merge pull request #5767 from ARMmbed/release-candidate
Release candidate for mbed-os-5.7.2
2 parents 2b4ff78 + 431b2d1 commit eca67ca

File tree

154 files changed

+18345
-18623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+18345
-18623
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,5 @@ matrix:
188188
env: NAME=mbed2-ATMEL
189189
- <<: *mbed-2
190190
env: NAME=mbed2-NUVOTON
191+
- <<: *mbed-2
192+
env: NAME=mbed2-RENESAS

TESTS/mbedmicro-rtos-mbed/heap_and_stack/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#if defined(TARGET_CORTEX_A)
19-
  #error [NOT_SUPPORTED] This function not supported for this target
19+
#error [NOT_SUPPORTED] This function not supported for this target
2020
#endif
2121

2222
#include <stdio.h>

TESTS/mbedmicro-rtos-mbed/malloc/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ volatile bool thread_should_continue = true;
3232
#define THREAD_MALLOC_SIZE 100
3333

3434
#if defined(__CORTEX_A9)
35-
#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE
35+
#define THREAD_STACK_SIZE 512
3636
#else
3737
#define THREAD_STACK_SIZE 256
3838
#endif

TESTS/mbedmicro-rtos-mbed/threads/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
#endif
2727

2828
#define THREAD_STACK_SIZE 512
29+
#if defined(__CORTEX_A9)
30+
#define PARALLEL_THREAD_STACK_SIZE 512
31+
#else
2932
#define PARALLEL_THREAD_STACK_SIZE 384
33+
#endif
3034
#define CHILD_THREAD_STACK_SIZE 384
3135

3236
using namespace utest::v1;

TESTS/network/wifi/get_interface.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ WiFiInterface *get_interface()
5050
{
5151
static WiFiInterface *interface = NULL;
5252

53-
if (interface)
54-
delete interface;
53+
if (interface) {
54+
interface->disconnect();
55+
return interface;
56+
}
5557

5658
#if MBED_CONF_APP_WIFI_DRIVER == INTERNAL
5759
interface = new DRIVER();

TESTS/network/wifi/get_security.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2017, ARM Limited, All Rights Reserved
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
* not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include <cstring>
19+
#include "mbed.h"
20+
#include "nsapi_types.h"
21+
22+
nsapi_security get_security()
23+
{
24+
#if defined MBED_CONF_APP_WIFI_SECURE_PROTOCOL
25+
static const char *SEC_WEP = "WEP";
26+
static const char *SEC_WPA = "WPA";
27+
static const char *SEC_WPA2 = "WPA2";
28+
static const char *SEC_WPA_WPA2 = "WPA/WPA2";
29+
30+
if (strcmp(MBED_CONF_APP_WIFI_SECURE_PROTOCOL, SEC_WEP) == 0) {
31+
return NSAPI_SECURITY_WEP;
32+
}
33+
if (strcmp(MBED_CONF_APP_WIFI_SECURE_PROTOCOL, SEC_WPA) == 0) {
34+
return NSAPI_SECURITY_WPA;
35+
}
36+
if (strcmp(MBED_CONF_APP_WIFI_SECURE_PROTOCOL, SEC_WPA2) == 0) {
37+
return NSAPI_SECURITY_WPA2;
38+
}
39+
if (strcmp(MBED_CONF_APP_WIFI_SECURE_PROTOCOL, SEC_WPA_WPA2) == 0) {
40+
return NSAPI_SECURITY_WPA_WPA2;
41+
}
42+
#endif
43+
return NSAPI_SECURITY_NONE;
44+
}

TESTS/network/wifi/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
!defined(MBED_CONF_APP_WIFI_PASSWORD) || \
3131
!defined(MBED_CONF_APP_WIFI_RX) || \
3232
!defined(MBED_CONF_APP_WIFI_SECURE_SSID) || \
33-
!defined(MBED_CONF_APP_WIFI_TX)
33+
!defined(MBED_CONF_APP_WIFI_TX) || \
34+
!defined MBED_CONF_APP_WIFI_SECURE_PROTOCOL
3435
#error [NOT_SUPPORTED] Requires parameters from mbed_app.json (for secure connections)
3536
#endif
3637
#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID)
@@ -58,6 +59,7 @@ utest::v1::status_t test_setup(const size_t number_of_cases) {
5859
// Test cases
5960
Case cases[] = {
6061
Case("WIFI-CONSTRUCTOR", wifi_constructor),
62+
Case("WIFI-CONNECT-NOCREDENTIALS", wifi_connect_nocredentials),
6163
Case("WIFI-SET-CREDENTIAL", wifi_set_credential),
6264
Case("WIFI-SET-CHANNEL", wifi_set_channel),
6365
#if defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
@@ -72,7 +74,6 @@ Case cases[] = {
7274
Case("WIFI-CONNECT-PARAMS-CHANNEL", wifi_connect_params_channel),
7375
Case("WIFI-CONNECT-PARAMS-CHANNEL-FAIL", wifi_connect_params_channel_fail),
7476
#endif
75-
Case("WIFI-CONNECT-NOCREDENTIALS", wifi_connect_nocredentials),
7677
#if defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
7778
Case("WIFI-CONNECT", wifi_connect),
7879
#endif

TESTS/network/wifi/template_mbed_app.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"help": "WiFi Password",
1313
"value": "\"PASSWORD\""
1414
},
15+
"wifi-secure-protocol": {
16+
"help": "WiFi security protocol, valid values are WEP, WPA, WPA2, WPA/WPA2",
17+
"value": "\"WPA/WPA2\""
18+
},
1519
"wifi-ch-secure": {
1620
"help": "Channel number of secure SSID",
1721
"value": 1

TESTS/network/wifi/wifi_connect_nocredentials.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ void wifi_connect_nocredentials(void)
2828
WiFiInterface *wifi = get_interface();
2929
nsapi_error_t error;
3030
error = wifi->connect();
31-
wifi->disconnect();
32-
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
31+
TEST_ASSERT(error == NSAPI_ERROR_NO_SSID || error == NSAPI_ERROR_PARAMETER);
3332
}

TESTS/network/wifi/wifi_connect_params_channel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void wifi_connect_params_channel(void)
3434
return;
3535
}
3636

37-
nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2, MBED_CONF_APP_WIFI_CH_SECURE);
37+
nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security(), MBED_CONF_APP_WIFI_CH_SECURE);
3838
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, error);
3939
}
4040

TESTS/network/wifi/wifi_connect_params_channel_fail.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void wifi_connect_params_channel_fail(void)
3434
return;
3535
}
3636

37-
nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2, MBED_CONF_APP_WIFI_CH_SECURE);
37+
nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security(), MBED_CONF_APP_WIFI_CH_SECURE);
3838
TEST_ASSERT(error==NSAPI_ERROR_CONNECTION_TIMEOUT || error==NSAPI_ERROR_NO_CONNECTION);
3939
}
4040

TESTS/network/wifi/wifi_connect_params_valid_secure.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,7 @@ void wifi_connect_params_valid_secure(void)
2929
{
3030
WiFiInterface *wifi = get_interface();
3131

32-
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2) == NSAPI_ERROR_OK) {
33-
return;
34-
}
35-
36-
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2) == NSAPI_ERROR_OK) {
37-
return;
38-
}
39-
40-
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA) == NSAPI_ERROR_OK) {
41-
return;
42-
}
43-
44-
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WEP) == NSAPI_ERROR_OK) {
32+
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security()) == NSAPI_ERROR_OK) {
4533
return;
4634
}
4735

TESTS/network/wifi/wifi_connect_secure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void wifi_connect_secure(void)
2929
{
3030
WiFiInterface *wifi = get_interface();
3131

32-
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2));
32+
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security()));
3333

3434
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());
3535
}

TESTS/network/wifi/wifi_connect_secure_fail.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void wifi_connect_secure_fail(void)
2929
{
3030
WiFiInterface *wifi = get_interface();
3131

32-
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, "aaaaaaaa", NSAPI_SECURITY_WPA2));
32+
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, "aaaaaaaa", get_security()));
3333

3434
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_AUTH_FAILURE, wifi->connect());
3535
}

TESTS/network/wifi/wifi_scan.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,23 @@ void wifi_scan(void)
4646

4747
for (int i=0; i<size; i++) {
4848
const char *ssid = ap[i].get_ssid();
49-
const uint8_t *bssid = ap[i].get_bssid();
5049
nsapi_security_t security = ap[i].get_security();
5150
int8_t rssi = ap[i].get_rssi();
5251
uint8_t ch = ap[i].get_channel();
5352
TEST_ASSERT_INT8_WITHIN(-10, -100, rssi);
5453
if (strcmp(MBED_CONF_APP_WIFI_SECURE_SSID, ssid) == 0) {
5554
secure_found = true;
56-
TEST_ASSERT_EQUAL_INT(NSAPI_SECURITY_WPA2, security);
57-
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_SECURE, ch);
55+
TEST_ASSERT_EQUAL_INT(get_security(), security);
56+
if (MBED_CONF_APP_WIFI_CH_SECURE) {
57+
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_SECURE, ch);
58+
}
5859
}
5960
if (strcmp(MBED_CONF_APP_WIFI_UNSECURE_SSID, ssid) == 0) {
6061
unsecure_found = true;
6162
TEST_ASSERT_EQUAL_INT(NSAPI_SECURITY_NONE, security);
62-
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_UNSECURE, ch);
63+
if (MBED_CONF_APP_WIFI_CH_UNSECURE) {
64+
TEST_ASSERT_EQUAL_INT(MBED_CONF_APP_WIFI_CH_UNSECURE, ch);
65+
}
6366
}
6467
}
6568
TEST_ASSERT_TRUE(secure_found);

TESTS/network/wifi/wifi_set_credential.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ void wifi_set_credential(void)
4747
TEST_ASSERT((error == NSAPI_ERROR_OK) || (error == NSAPI_ERROR_UNSUPPORTED));
4848

4949
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WPA);
50-
TEST_ASSERT(error == NSAPI_ERROR_OK);
50+
TEST_ASSERT((error == NSAPI_ERROR_OK) || (error == NSAPI_ERROR_UNSUPPORTED));
5151

5252
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WPA2);
53-
TEST_ASSERT(error == NSAPI_ERROR_OK);
53+
TEST_ASSERT((error == NSAPI_ERROR_OK) || (error == NSAPI_ERROR_UNSUPPORTED));
5454

5555
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WPA_WPA2);
5656
TEST_ASSERT(error == NSAPI_ERROR_OK);
5757

58-
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni", NSAPI_SECURITY_WPA2);
58+
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni", get_security());
5959
TEST_ASSERT(error == NSAPI_ERROR_OK);
6060

61-
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni8", NSAPI_SECURITY_WPA2);
61+
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni8", get_security());
6262
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
6363
}

TESTS/network/wifi/wifi_tests.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* app_json. */
88
WiFiInterface *get_interface(void);
99

10+
/**
11+
* Get security protocol to be used
12+
*/
13+
nsapi_security get_security(void);
14+
1015
/*
1116
* Test cases
1217
*/

0 commit comments

Comments
 (0)