Skip to content

Commit

Permalink
Merge pull request ARMmbed#8775 from ARMmbed/release-candidate
Browse files Browse the repository at this point in the history
Release candidate for mbed-os-5.10.4
  • Loading branch information
Cruz Monrreal authored Nov 17, 2018
2 parents bf6f2c3 + 40a538f commit 2fd0c5c
Show file tree
Hide file tree
Showing 153 changed files with 24,631 additions and 2,897 deletions.
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 ofguidelines for contributing toMbed OS. Please see: [contributing guidelines](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/latest/reference/contributing.html).
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@
Arm Mbed OS is an open source embedded operating system designed specifically for the "things" in the Internet of Things. It includes all the features you need to develop a connected product based on an Arm Cortex-M microcontroller, including security, connectivity, an RTOS and drivers for sensors and I/O devices.

Mbed OS provides a platform that includes:
* Security foundations.
* Cloud management services.
* Drivers for sensors, I/O devices and connectivity.

- Security foundations.
- Cloud management services.
- Drivers for sensors, I/O devices and connectivity.

## Release notes
The [release notes](https://os.mbed.com/releases) detail the current release. You can also find information about previous versions.

## License and contributions

The software is provided under [Apache-2.0 license](LICENSE). Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.

This project contains code from other projects. The original license text is included in those source files. They must comply with our [license guide](https://os.mbed.com/docs/latest/reference/license.html)

## Getting started for developers

We have a [developer website](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.
Expand All @@ -36,6 +43,7 @@ We also have a [contributing and publishing guide](https://os.mbed.com/contribut

## Documentation

For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes published Doxygen for our APIs, step-by-step tutorials, porting information and background reference materials about our architecture and tools.
For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes Doxygen for our APIs, step-by-step tutorials, porting information and background reference materials about our architecture and tools.

To contribute to this documentation, please see the [mbed-os-5-docs repository](https://github.com/ARMmbed/mbed-os-5-docs).

To contribute to this documentation, please see the [mbed-os-5-docs repo](https://github.com/ARMmbed/mbed-os-5-docs).
28 changes: 28 additions & 0 deletions TESTS/mbed_hal/rtc_time/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,41 @@ void test_local_time_invalid_param()
TEST_ASSERT_EQUAL(false, _rtc_localtime(1, NULL, RTC_4_YEAR_LEAP_YEAR_SUPPORT));
}

/* Test set_time() function called a few seconds apart.
*
* Given is set_time() function.
* When set_time() is used to set the system time two times.
* Then if the value returned from time() is always correct return true, otherwise return false.
*/
#define NEW_TIME 15
void test_set_time_twice()
{
time_t current_time;

/* Set the time to NEW_TIME and check it */
set_time(NEW_TIME);
current_time = time(NULL);
TEST_ASSERT_EQUAL (true, (current_time == NEW_TIME));

/* Wait 2 seconds */
wait_ms(2000);

/* set the time to NEW_TIME again and check it */
set_time(NEW_TIME);
current_time = time(NULL);
TEST_ASSERT_EQUAL (true, (current_time == NEW_TIME));
}

Case cases[] = {
Case("test is leap year - RTC leap years full support", test_is_leap_year<RTC_FULL_LEAP_YEAR_SUPPORT>),
Case("test is leap year - RTC leap years partial support", test_is_leap_year<RTC_4_YEAR_LEAP_YEAR_SUPPORT>),
Case("test make time boundary values - RTC leap years full support", test_mk_time_boundary<RTC_FULL_LEAP_YEAR_SUPPORT>),
Case("test make time boundary values - RTC leap years partial support", test_mk_time_boundary<RTC_4_YEAR_LEAP_YEAR_SUPPORT>),
Case("test make time - invalid param", test_mk_time_invalid_param),
Case("test local time - invalid param", test_local_time_invalid_param),
#if DEVICE_RTC || DEVICE_LPTICKER
Case("test set_time twice", test_set_time_twice),
#endif
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
Expand Down
18 changes: 13 additions & 5 deletions TESTS/netsocket/tcp/tcpsocket_recv_100k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,34 @@ static nsapi_error_t _tcpsocket_connect_to_chargen_srv(TCPSocket &sock)
* \param offset Start pattern from offset
* \param len Length of pattern to generate.
*/
static void generate_RFC_864_pattern(size_t offset, uint8_t *buf, size_t len)
static void generate_RFC_864_pattern(size_t offset, uint8_t *buf, size_t len, bool is_xinetd)
{
const int row_size = 74; // Number of chars in single row
const int row_count = 95; // Number of rows in pattern after which pattern start from beginning
const int chars_scope = is_xinetd ? 93 : 95; // Number of chars from ASCII table used in pattern
const char first_char = is_xinetd ? '!' : ' '; // First char from ASCII table used in pattern
while (len--) {
if (offset % 74 == 72) {
if (offset % row_size == (row_size - 2)) {
*buf++ = '\r';
} else if (offset % 74 == 73) {
} else if (offset % row_size == (row_size - 1)) {
*buf++ = '\n';
} else {
*buf++ = ' ' + (offset % 74 + offset / 74) % 95 ;
*buf++ = first_char + (offset % row_size + ((offset / row_size) % row_count)) % chars_scope;
}
offset++;
}
}

static void check_RFC_864_pattern(void *rx_buff, const size_t len, const size_t offset)
{
static bool is_xinetd = false;
void *ref_buff = malloc(len);
TEST_ASSERT_NOT_NULL(ref_buff);

generate_RFC_864_pattern(offset, (uint8_t *)ref_buff, len);
if (offset == 0) {
is_xinetd = ((uint8_t *)rx_buff)[0] == '!';
}
generate_RFC_864_pattern(offset, (uint8_t *)ref_buff, len, is_xinetd);
bool match = memcmp(ref_buff, rx_buff, len) == 0;

free(ref_buff);
Expand Down
2 changes: 1 addition & 1 deletion TESTS/network/emac/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using namespace utest::v1;
utest::v1::status_t test_setup(const size_t number_of_cases)
{
#if !MBED_CONF_APP_ECHO_SERVER
GREENTEA_SETUP(1200, "default_auto");
GREENTEA_SETUP(1400, "default_auto");
#endif
return verbose_test_setup_handler(number_of_cases);
}
Expand Down
8 changes: 5 additions & 3 deletions TESTS/network/wifi/wifi_connect_nocredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ using namespace utest::v1;
void wifi_connect_nocredentials(void)
{
WiFiInterface *wifi = get_interface();
nsapi_error_t error;
error = wifi->connect();
TEST_ASSERT(error == NSAPI_ERROR_NO_SSID || error == NSAPI_ERROR_PARAMETER);
nsapi_error_t error_connect, error_disconnect;
error_connect = wifi->connect();
error_disconnect = wifi->disconnect();
TEST_ASSERT(error_connect == NSAPI_ERROR_NO_SSID || error_connect == NSAPI_ERROR_PARAMETER);
TEST_ASSERT(error_disconnect == NSAPI_ERROR_NO_CONNECTION);
}
5 changes: 4 additions & 1 deletion TESTS/network/wifi/wifi_connect_params_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ void wifi_connect_params_channel(void)
}

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);
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, error);

wifi->set_channel(0);

wifi->disconnect();

TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, error);
}

#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID)
9 changes: 7 additions & 2 deletions TESTS/network/wifi/wifi_connect_params_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ using namespace utest::v1;

void wifi_connect_params_null(void)
{
nsapi_error_t error;
WiFiInterface *wifi = get_interface();
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_PARAMETER, wifi->connect(NULL, NULL));
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_PARAMETER, wifi->connect("", ""));
error = wifi->connect(NULL, NULL);
wifi->disconnect();
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
error = wifi->connect("", "");
wifi->disconnect();
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
}
1 change: 1 addition & 0 deletions TESTS/network/wifi/wifi_connect_params_valid_secure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void wifi_connect_params_valid_secure(void)
WiFiInterface *wifi = get_interface();

if (wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security()) == NSAPI_ERROR_OK) {
wifi->disconnect();
return;
}

Expand Down
2 changes: 2 additions & 0 deletions TESTS/network/wifi/wifi_connect_secure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void wifi_connect_secure(void)
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security()));

TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());

TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->disconnect());
}

#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID)
2 changes: 2 additions & 0 deletions TESTS/network/wifi/wifi_connect_secure_fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ void wifi_connect_secure_fail(void)
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(MBED_CONF_APP_WIFI_SECURE_SSID, "aaaaaaaa", get_security()));
nsapi_error_t error;
error = wifi->connect();
wifi->disconnect();
TEST_ASSERT(error == NSAPI_ERROR_AUTH_FAILURE ||
error == NSAPI_ERROR_CONNECTION_TIMEOUT ||
error == NSAPI_ERROR_NO_CONNECTION);

}

#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID)
2 changes: 2 additions & 0 deletions TESTS/network/wifi/wifi_get_rssi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void wifi_get_rssi(void)
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());

TEST_ASSERT_INT8_WITHIN(-10, -100, wifi->get_rssi());

TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->disconnect());
}

#endif // defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
29 changes: 20 additions & 9 deletions TEST_APPS/device/socket_app/cmd_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class SInfo {
{
assert(sock);
}
SInfo(Socket* sock, bool delete_on_exit=true):
SInfo(Socket *sock, bool delete_on_exit = true):
_id(id_count++),
_sock(sock),
_type(SInfo::OTHER),
Expand Down Expand Up @@ -408,31 +408,42 @@ static void print_data_as_hex(const uint8_t *buf, int len, int col_width);
* \param offset Start pattern from offset
* \param len Length of pattern to generate.
*/
static void generate_RFC_864_pattern(size_t offset, uint8_t *buf, size_t len)
static void generate_RFC_864_pattern(size_t offset, uint8_t *buf, size_t len, bool is_xinetd)
{
const int row_size = 74; // Number of chars in single row
const int row_count = 95; // Number of rows in pattern after which pattern start from beginning
const int chars_scope = is_xinetd ? 93 : 95; // Number of chars from ASCII table used in pattern
const char first_char = is_xinetd ? '!' : ' '; // First char from ASCII table used in pattern
while (len--) {
if (offset % 74 == 72) {
if (offset % row_size == (row_size - 2)) {
*buf++ = '\r';
} else if (offset % 74 == 73) {
} else if (offset % row_size == (row_size - 1)) {
*buf++ = '\n';
} else {
*buf++ = ' ' + (offset % 74 + offset / 74) % 95 ;
*buf++ = first_char + (offset % row_size + ((offset / row_size) % row_count)) % chars_scope;
}
offset++;
}
}

bool SInfo::check_pattern(void *buffer, size_t len)
{
static bool is_xinetd = false;
if (!_check_pattern) {
return true;
}
void *buf = malloc(len);
if (!buf) {
return false;
}

size_t offset = _receivedTotal;
generate_RFC_864_pattern(offset, (uint8_t *)buf, len);

if (offset == 0) {
is_xinetd = ((uint8_t *)buffer)[0] == '!';
}

generate_RFC_864_pattern(offset, (uint8_t *)buf, len, is_xinetd);
bool match = memcmp(buf, buffer, len) == 0;
if (!match) {
cmd_printf("Pattern check failed\r\nWAS:%.*s\r\nREF:%.*s\r\n", len, (char *)buffer, len, (char *)buf);
Expand Down Expand Up @@ -1162,11 +1173,11 @@ static int cmd_socket(int argc, char *argv[])
cmd_printf("Invalid socket id\r\n");
return CMDLINE_RETCODE_FAIL;
}
TCPSocket *new_sock = static_cast<TCPSocket*>(&new_info->socket());
nsapi_error_t ret = static_cast<TCPServer&>(info->socket()).accept(new_sock, &addr);
TCPSocket *new_sock = static_cast<TCPSocket *>(&new_info->socket());
nsapi_error_t ret = static_cast<TCPServer &>(info->socket()).accept(new_sock, &addr);
if (ret == NSAPI_ERROR_OK) {
cmd_printf("TCPServer::accept() new socket sid: %d connection from %s port %d\r\n",
new_info->id(), addr.get_ip_address(), addr.get_port());
new_info->id(), addr.get_ip_address(), addr.get_port());
}
return handle_nsapi_error("TCPServer::accept()", ret);
}
Expand Down
3 changes: 3 additions & 0 deletions UNITTESTS/features/lorawan/lorawantimer/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ set(unittest-test-sources
stubs/equeue_stub.c
)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG=1")

Loading

0 comments on commit 2fd0c5c

Please sign in to comment.