Simple Mbed Cloud Client application using features of K64 & K66

Connect to Mbed Cloud!

This example was customized a bit for FRDM-K66 and FRDM-K64F.

It depends on having an SD Card plugged in for storage of credentials. It could be changed later to use a SPI flash or other storage on a shield or wired in.

The app keeps track of how many times switch 2 (SW2) is pressed. The value can be retrieved via a GET request to Mbed Cloud.

Also, it will blink a pattern based on milisecond (ms) timing values that can be sent from Mbed Cloud. The pattern can be sent with a PUT request and the blinking sequence can be triggered by a POST request.

Committer:
maclobdell
Date:
Tue Oct 09 22:08:16 2018 -0500
Revision:
15:df35a45db1cc
Parent:
9:ae1f6fe932dc
remove sd driver.  its in mbed-os now.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 9:ae1f6fe932dc 1 // ----------------------------------------------------------------------------
maclobdell 9:ae1f6fe932dc 2 // Copyright 2016-2017 ARM Ltd.
maclobdell 9:ae1f6fe932dc 3 //
maclobdell 9:ae1f6fe932dc 4 // SPDX-License-Identifier: Apache-2.0
maclobdell 9:ae1f6fe932dc 5 //
maclobdell 9:ae1f6fe932dc 6 // Licensed under the Apache License, Version 2.0 (the "License");
maclobdell 9:ae1f6fe932dc 7 // you may not use this file except in compliance with the License.
maclobdell 9:ae1f6fe932dc 8 // You may obtain a copy of the License at
maclobdell 9:ae1f6fe932dc 9 //
maclobdell 9:ae1f6fe932dc 10 // http://www.apache.org/licenses/LICENSE-2.0
maclobdell 9:ae1f6fe932dc 11 //
maclobdell 9:ae1f6fe932dc 12 // Unless required by applicable law or agreed to in writing, software
maclobdell 9:ae1f6fe932dc 13 // distributed under the License is distributed on an "AS IS" BASIS,
maclobdell 9:ae1f6fe932dc 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
maclobdell 9:ae1f6fe932dc 15 // See the License for the specific language governing permissions and
maclobdell 9:ae1f6fe932dc 16 // limitations under the License.
maclobdell 9:ae1f6fe932dc 17 // ----------------------------------------------------------------------------
maclobdell 9:ae1f6fe932dc 18
maclobdell 9:ae1f6fe932dc 19 // This file is a template and it's intented to be copied to the application
maclobdell 9:ae1f6fe932dc 20 // Enable this configuration
maclobdell 9:ae1f6fe932dc 21
maclobdell 9:ae1f6fe932dc 22 #ifndef MBED_CLOUD_CLIENT_USER_CONFIG_H
maclobdell 9:ae1f6fe932dc 23 #define MBED_CLOUD_CLIENT_USER_CONFIG_H
maclobdell 9:ae1f6fe932dc 24
maclobdell 9:ae1f6fe932dc 25 #ifdef MBED_CONF_APP_ENDPOINT_TYPE
maclobdell 9:ae1f6fe932dc 26 #define MBED_CLOUD_CLIENT_ENDPOINT_TYPE MBED_CONF_APP_ENDPOINT_TYPE
maclobdell 9:ae1f6fe932dc 27 #else
maclobdell 9:ae1f6fe932dc 28 #define MBED_CLOUD_CLIENT_ENDPOINT_TYPE "default"
maclobdell 9:ae1f6fe932dc 29 #endif
maclobdell 9:ae1f6fe932dc 30
maclobdell 9:ae1f6fe932dc 31 // Enable either TCP or UDP, but no both
maclobdell 9:ae1f6fe932dc 32 #define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
maclobdell 9:ae1f6fe932dc 33 // MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP
maclobdell 9:ae1f6fe932dc 34
maclobdell 9:ae1f6fe932dc 35 #define MBED_CLOUD_CLIENT_LIFETIME 3600
maclobdell 9:ae1f6fe932dc 36
maclobdell 9:ae1f6fe932dc 37 #define MBED_CLOUD_CLIENT_SUPPORT_UPDATE
maclobdell 9:ae1f6fe932dc 38 #define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 1024
maclobdell 9:ae1f6fe932dc 39
maclobdell 9:ae1f6fe932dc 40 // set flag to enable update support in mbed Cloud client
maclobdell 9:ae1f6fe932dc 41 #define MBED_CLOUD_CLIENT_SUPPORT_UPDATE
maclobdell 9:ae1f6fe932dc 42
maclobdell 9:ae1f6fe932dc 43 // set download buffer size in bytes (min. 1024 bytes)
maclobdell 9:ae1f6fe932dc 44
maclobdell 9:ae1f6fe932dc 45 // Use larger buffers in Linux //
maclobdell 9:ae1f6fe932dc 46 #ifdef __linux__
maclobdell 9:ae1f6fe932dc 47 #define MBED_CLOUD_CLIENT_UPDATE_BUFFER (2 * 1024 * 1024)
maclobdell 9:ae1f6fe932dc 48 #else
maclobdell 9:ae1f6fe932dc 49 #define MBED_CLOUD_CLIENT_UPDATE_BUFFER 2048
maclobdell 9:ae1f6fe932dc 50 #endif
maclobdell 9:ae1f6fe932dc 51
maclobdell 9:ae1f6fe932dc 52 // Developer flags for Update feature
maclobdell 9:ae1f6fe932dc 53 #if MBED_CONF_APP_DEVELOPER_MODE == 1
maclobdell 9:ae1f6fe932dc 54 #define MBED_CLOUD_DEV_UPDATE_CERT
maclobdell 9:ae1f6fe932dc 55 #define MBED_CLOUD_DEV_UPDATE_ID
maclobdell 9:ae1f6fe932dc 56 #endif // MBED_CONF_APP_DEVELOPER_MODE
maclobdell 9:ae1f6fe932dc 57
maclobdell 9:ae1f6fe932dc 58 #endif // MBED_CLOUD_CLIENT_USER_CONFIG_H
maclobdell 9:ae1f6fe932dc 59