Add support for Connect and FW Update

Fork of example-Ethernet-mbed-Cloud-connect by ST

Committer:
MarceloSalazar
Date:
Mon Oct 15 01:13:24 2018 +0100
Revision:
14:13ea72e8475c
Parent:
6:2d0e0866f2e7
Add support for FW Update

Who changed what in which revision?

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