Skip to content

Commit

Permalink
Merge pull request #15 from ARMmbed/release-1.3.2
Browse files Browse the repository at this point in the history
mbed-cloud-client-example 1.3.2
  • Loading branch information
teetak01 authored May 22, 2018
2 parents c95df04 + ed9c6f8 commit b1fe3df
Show file tree
Hide file tree
Showing 31 changed files with 514 additions and 1,191 deletions.
35 changes: 25 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
# Changelog for Mbed Cloud Client Reference Example

## Release R1.3.1.1 (next release)
* No changes.
## Release 1.3.2 (22.05.2018)
* Update easy-connect to v1.2.9
* Update to Mbed OS 5.8.4
* Configuration partition_mode is added, which is enabled by default. This is supposed to be used with storage for data e.g. SD card.
* Linux: Update Mbedtls to 2.7.1 in pal-platform.
* Linux: Fix for CMake generation and generic cleanup in pal-platform.

#### Platform Adaptation Layer (PAL)
* Linux: Converted all timers to use signal-based timer (SIGEV_SIGNAL) instead of (SIGEV_THREAD).
* This fixes the Valgrind warnings for possible memory leaks caused by LIBC's internal timer helper thread.
<span class="notes">**Note**: If the client application is creating a pthread before instantiating MbedCloudClient,
it needs to block the PAL_TIMER_SIGNAL from it. Otherwise the thread may get an exception caused
by the default signal handler with a message such as "Process terminating with default action
of signal 34 (SIGRT2)". For a suggested way to handle this please see `mcc_platform_init()` in
https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/source/platform/Linux/common_setup.c.</span>

## Release R1.3.1 (19.04.2018)
## Release 1.3.1.1 (27.04.2018)
* No changes.

* Converted the LED blinking callback from a blocking loop to an event-based tasklet.
* Updated to Mbed OS 5.8.1.
* The platform-specific code has been rewritten to have common implementation which can be shared with other Cloud applications (source/platform/).
* Enabled multipartition support for an application.
* Enabled LittleFS support.
* Enabled autoformat/autopartition for the storage (controllable via compile-time flags).
## Release 1.3.1 (19.04.2018)
* Convert LED blinking callback from a blocking loop to event based tasklet.
* Update to Mbed OS 5.8.1.
* Rewrite platform-specific code to have common implementation which can be shared between other Cloud applications (source/platform/).
* enable multipartition support for application.
* enable LittleFS support.
* enable autoformat/autopartition for storage (controllable via compile-time flags).

## Release R1.3.0 (27.3.2018)
## Release 1.3.0 (27.3.2018)

Initial public release.

2 changes: 1 addition & 1 deletion easy-connect.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/easy-connect/#6b2cce9f7cefd02e0503d6307ab5433b6197716d
https://github.com/ARMmbed/easy-connect/#21a78a40e94ba9298e05ce54738c6b42657ae010
28 changes: 12 additions & 16 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#endif
#include "application_init.h"
#include "common_button_and_led.h"
#include "blinky.h"

// event based LED blinker, controlled via pattern_resource
static Blinky blinky;

static void main_application(void);

Expand All @@ -33,35 +37,27 @@ int main(void)
// Pointers to the resources that will be created in main_application().
static M2MResource* button_res;
static M2MResource* pattern_res;
static M2MResource* blink_res;

// Pointer to mbedClient, used for calling close function.
static SimpleM2MClient *client;

void pattern_updated(const char *)
{
{
printf("PUT received, new value: %s\n", pattern_res->get_value_string().c_str());
}

void blink_callback(void *) {
void blink_callback(void *)
{
String pattern_string = pattern_res->get_value_string();
const char *pattern = pattern_string.c_str();
printf("LED pattern = %s\n", pattern);

// The pattern is something like 500:200:500, so parse that.
// LED blinking is done while parsing.
mcc_platform_toggle_led();
while (*pattern != '\0') {
// Wait for requested time.
mcc_platform_do_wait(atoi(pattern));
mcc_platform_toggle_led();
// Search for next value.
pattern = strchr(pattern, ':');
if(!pattern) {
break; // while
}
pattern++;
const bool restart_pattern = false;
if (blinky.start((char*)pattern_res->value(), pattern_res->value_length(), restart_pattern) == false) {
printf("out of memory error\n");
}
mcc_platform_led_off();
}

void button_notification_status_callback(const M2MBase& object, const NoticationDeliveryStatus status)
Expand Down Expand Up @@ -148,7 +144,7 @@ void main_application(void)
M2MBase::GET_PUT_ALLOWED, "500:500:500:500", false, (void*)pattern_updated, NULL);

// Create resource for starting the led blinking. Path of this resource will be: 3201/0/5850.
blink_res = mbedClient.add_cloud_resource(3201, 0, 5850, "blink_resource", M2MResourceInstance::STRING,
mbedClient.add_cloud_resource(3201, 0, 5850, "blink_resource", M2MResourceInstance::STRING,
M2MBase::POST_ALLOWED, "", false, (void*)blink_callback, NULL);

// Create resource for unregistering the device. Path of this resource will be: 5000/0/1.
Expand Down
2 changes: 1 addition & 1 deletion mbed-cloud-client.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-cloud-client/#88d63622c4a3c521a22803a4847930c0ee217c84
https://github.com/ARMmbed/mbed-cloud-client/#d37a136be84216afb90f1bd3b00b1ac9d33d52a1
2 changes: 1 addition & 1 deletion mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#addec7ba10054be03849eff58a1d17f157391e7d
https://github.com/ARMmbed/mbed-os/#ae6c7c60f91c89cbf755a2f3c8ec9c66635849fd
1 change: 0 additions & 1 deletion mbed_cloud_client_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#ifdef __FREERTOS__
#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 512
#else
#define MBED_CLOUD_CLIENT_SUPPORT_UPDATE
#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 1024
#endif

Expand Down
6 changes: 5 additions & 1 deletion mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
"PLATFORM_ENABLE_LED=1"
],
"config": {
"partition_mode": {
"help": "Macro for single or dual partition mode. This is supposed to be used with storage storage for data e.g. SD card. This enabled by default.",
"macro_name": "MCC_PLATFORM_PARTITION_MODE"
},
"auto_partition": {
"help": "Optional macro automatic SD card partitioning if required. Partioning will be triggered only if initialization of available partitions fail",
"help": "Optional macro automatic SD card partitioning if required. Partioning will be triggered only if initialization of available partitions fail. This requires partition_mode to be enabled.",
"macro_name": "MCC_PLATFORM_AUTO_PARTITION"
},
"pal_number_of_partition": {
Expand Down
203 changes: 0 additions & 203 deletions pal-platform/SDK/K64F_FreeRTOS/K64F_FreeRTOS.cmake

This file was deleted.

52 changes: 0 additions & 52 deletions pal-platform/SDK/K64F_FreeRTOS/K64F_FreeRTOS.patch

This file was deleted.

Loading

0 comments on commit b1fe3df

Please sign in to comment.