This is a simple mbed client example demonstrating, registration of a device with mbed Device Connector and reading and writing values as well as deregistering on different Network Interfaces including Ethernet, WiFi, 6LoWPAN ND and Thread respectively.

Dependencies:   lwip

Fork of mbed-os-example-client by mbed-os-examples

Committer:
mbed_official
Date:
Tue Dec 13 08:45:11 2016 +0000
Revision:
44:2b472e66a942
Parent:
0:7d5ec759888b
Fix UBLOX ODIN Wifi Connectivity, add IPVx print

Turns out the UBLOX ODIN WiFi will not be able to connect, unless you
specify the security mode as well.

Stylize the connectivity prints a bit and add IPv4/IPv6 as the
to the starting print.

.
Commit copied from https://github.com/ARMmbed/mbed-os-example-client

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Yogesh Pande 0:7d5ec759888b 1 /*
Yogesh Pande 0:7d5ec759888b 2 * Copyright (c) 2016 ARM Limited. All rights reserved.
Yogesh Pande 0:7d5ec759888b 3 * SPDX-License-Identifier: Apache-2.0
Yogesh Pande 0:7d5ec759888b 4 * Licensed under the Apache License, Version 2.0 (the License); you may
Yogesh Pande 0:7d5ec759888b 5 * not use this file except in compliance with the License.
Yogesh Pande 0:7d5ec759888b 6 * You may obtain a copy of the License at
Yogesh Pande 0:7d5ec759888b 7 *
Yogesh Pande 0:7d5ec759888b 8 * http://www.apache.org/licenses/LICENSE-2.0
Yogesh Pande 0:7d5ec759888b 9 *
Yogesh Pande 0:7d5ec759888b 10 * Unless required by applicable law or agreed to in writing, software
Yogesh Pande 0:7d5ec759888b 11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
Yogesh Pande 0:7d5ec759888b 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Yogesh Pande 0:7d5ec759888b 13 * See the License for the specific language governing permissions and
Yogesh Pande 0:7d5ec759888b 14 * limitations under the License.
Yogesh Pande 0:7d5ec759888b 15 */
Yogesh Pande 0:7d5ec759888b 16 #ifndef MBED_CLIENT_CONFIG_H
Yogesh Pande 0:7d5ec759888b 17 #define MBED_CLIENT_CONFIG_H
Yogesh Pande 0:7d5ec759888b 18
Yogesh Pande 0:7d5ec759888b 19
Yogesh Pande 0:7d5ec759888b 20 // Defines the number of times client should try re-connection towards
Yogesh Pande 0:7d5ec759888b 21 // Server in case of connectivity loss , also defines the number of CoAP
Yogesh Pande 0:7d5ec759888b 22 // re-transmission attempts.Default value is 3
Yogesh Pande 0:7d5ec759888b 23 #define M2M_CLIENT_RECONNECTION_COUNT 3
Yogesh Pande 0:7d5ec759888b 24
Yogesh Pande 0:7d5ec759888b 25 // Defines the interval (in seconds) in which client should try re-connection towards
Yogesh Pande 0:7d5ec759888b 26 // Server in case of connectivity loss , also use the same interval for CoAP
Yogesh Pande 0:7d5ec759888b 27 // re-transmission attempts. Default value is 5 seconds
Yogesh Pande 0:7d5ec759888b 28 #define M2M_CLIENT_RECONNECTION_INTERVAL 5
Yogesh Pande 0:7d5ec759888b 29
Yogesh Pande 0:7d5ec759888b 30 // Defines the keep-alive interval (in seconds) in which client should send keep alive
Yogesh Pande 0:7d5ec759888b 31 // pings to server while connected through TCP mode. Default value is 300 seconds
Yogesh Pande 0:7d5ec759888b 32 #define M2M_CLIENT_TCP_KEEPALIVE_TIME 300
Yogesh Pande 0:7d5ec759888b 33
Yogesh Pande 0:7d5ec759888b 34 // Defines the maximum CoAP messages that client can hold, maximum value is 6
Yogesh Pande 0:7d5ec759888b 35 #define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 2
Yogesh Pande 0:7d5ec759888b 36
Yogesh Pande 0:7d5ec759888b 37 // Defines the size of blockwise CoAP messages that client can handle.
Yogesh Pande 0:7d5ec759888b 38 // The values that can be defined uust be 2^x and x is at least 4.
Yogesh Pande 0:7d5ec759888b 39 // Suitable values: 0, 16, 32, 64, 128, 256, 512 and 1024
Yogesh Pande 0:7d5ec759888b 40 #define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 1024
Yogesh Pande 0:7d5ec759888b 41
Yogesh Pande 0:7d5ec759888b 42 // Many pure LWM2M servers doen't accept 'obs' text in registration message.
Yogesh Pande 0:7d5ec759888b 43 // While using Client against such servers, this flag can be set to define to
Yogesh Pande 0:7d5ec759888b 44 // disable client sending 'obs' text for observable resources.
Yogesh Pande 0:7d5ec759888b 45 #undef COAP_DISABLE_OBS_FEATURE
Yogesh Pande 0:7d5ec759888b 46
Yogesh Pande 0:7d5ec759888b 47 // Disable Bootstrap functionality in client in order to reduce code size, if bootstrap
Yogesh Pande 0:7d5ec759888b 48 // functionality is not required.
Yogesh Pande 0:7d5ec759888b 49 #undef M2M_CLIENT_DISABLE_BOOTSTRAP_FEATURE
Yogesh Pande 0:7d5ec759888b 50
Yogesh Pande 0:7d5ec759888b 51 #endif // MBED_CLIENT_CONFIG_H
Yogesh Pande 0:7d5ec759888b 52