Example program for simple-mbed-client, connecting a device to mbed Device Connector.

Dependencies:   simple-mbed-client

Fork of simple-mbed-client-example by Jan Jongboom

This is an example on how to connect to mbed Device Connector using simple-mbed-client. It can connect over Ethernet, WiFi (using an ESP8266 module or an ODIN board), Thread and 6LoWPAN.

After cloning this repository update `mbed_app.json` to reflect your connectivity method. For docs on configuring connectivity, see easy-connect.

End to end example

For an end-to-end example of using Simple mbed Client to connect devices to mbed Device Connector see Building an internet connected lighting system.

Entropy (or lack thereof)

On all platforms except the K64F and K22F the library is compiled without TLS entropy sources. This means that your code is inherently unsafe and should not be deployed to any production systems. To enable entropy, remove the MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES and MBEDTLS_TEST_NULL_ENTROPY macros from mbed_app.json.

Files at this revision

API Documentation at this revision

Comitter:
geky
Date:
Thu Feb 18 15:57:29 2016 +0000
Parent:
8:edf87b3b8ce2
Child:
10:1280c4c21987
Commit message:
Updated libraries to latest revision

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
security.h Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Thu Feb 11 23:56:18 2016 +0000
+++ b/EthernetInterface.lib	Thu Feb 18 15:57:29 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
+http://mbed.org/users/mbed_official/code/EthernetInterface/#4d7bff17a592
--- a/mbed-rtos.lib	Thu Feb 11 23:56:18 2016 +0000
+++ b/mbed-rtos.lib	Thu Feb 18 15:57:29 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#3d9d2b8b8f17
+http://mbed.org/users/mbed_official/code/mbed-rtos/#07314541bd12
--- a/security.h	Thu Feb 11 23:56:18 2016 +0000
+++ b/security.h	Thu Feb 18 15:57:29 2016 +0000
@@ -1,1 +1,111 @@
-#error "You need to get credentials from connector.mbed.com and paste them in this security.h file. Dont commit the modified file to the history"
\ No newline at end of file
+
+
+/*
+
+ * Copyright (c) 2015 ARM Limited. All rights reserved.
+
+ * SPDX-License-Identifier: Apache-2.0
+
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+
+ * not use this file except in compliance with the License.
+
+ * You may obtain a copy of the License at
+
+ *
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ *
+
+ * Unless required by applicable law or agreed to in writing, software
+
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+ * See the License for the specific language governing permissions and
+
+ * limitations under the License.
+
+ */
+
+#ifndef __SECURITY_H__
+
+#define __SECURITY_H__
+
+ 
+
+#include <inttypes.h>
+
+ 
+
+#define MBED_DOMAIN "d2f49a23-a3a6-4335-bcf4-01db9f945d3d"
+
+#define MBED_ENDPOINT_NAME "4887c197-73de-4314-aec1-43da301d6dca"
+
+ 
+
+const uint8_t SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
+
+"MIIBmDCCAT6gAwIBAgIEVUCA0jAKBggqhkjOPQQDAjBLMQswCQYDVQQGEwJGSTEN\r\n"
+
+"MAsGA1UEBwwET3VsdTEMMAoGA1UECgwDQVJNMQwwCgYDVQQLDANJb1QxETAPBgNV\r\n"
+
+"BAMMCEFSTSBtYmVkMB4XDTE1MDQyOTA2NTc0OFoXDTE4MDQyOTA2NTc0OFowSzEL\r\n"
+
+"MAkGA1UEBhMCRkkxDTALBgNVBAcMBE91bHUxDDAKBgNVBAoMA0FSTTEMMAoGA1UE\r\n"
+
+"CwwDSW9UMREwDwYDVQQDDAhBUk0gbWJlZDBZMBMGByqGSM49AgEGCCqGSM49AwEH\r\n"
+
+"A0IABLuAyLSk0mA3awgFR5mw2RHth47tRUO44q/RdzFZnLsAsd18Esxd5LCpcT9w\r\n"
+
+"0tvNfBv4xJxGw0wcYrPDDb8/rjujEDAOMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E\r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