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.

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

Files at this revision

API Documentation at this revision

Comitter:
davyu
Date:
Fri Oct 20 22:52:08 2017 +0000
Parent:
109:1042619d9a80
Commit message:
initial client example

Changed in this revision

mbed_app.json 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/mbed_app.json	Wed Oct 11 10:15:13 2017 +0100
+++ b/mbed_app.json	Fri Oct 20 22:52:08 2017 +0000
@@ -2,7 +2,7 @@
     "config": {
         "network-interface":{
             "help": "Options are ETHERNET, WIFI_ESP8266, WIFI_ODIN, MESH_LOWPAN_ND, MESH_THREAD, CELLULAR_ONBOARD",
-            "value": "ETHERNET"
+            "value": "WIFI_ESP8266"
         },
         "mesh_radio_type": {
             "help": "options are ATMEL, MCR20, SPIRIT1, EFR32",
@@ -10,11 +10,11 @@
         },
         "wifi-ssid": {
             "help": "WiFi SSID",
-            "value": "\"SSID\""
+            "value": "\"Famliy2\""
         },
         "wifi-password": {
             "help": "WiFi Password",
-            "value": "\"Password\""
+            "value": "\"0933262883\""
         },
         "wifi-tx": {
             "help": "TX pin for serial connection to external device",
--- a/security.h	Wed Oct 11 10:15:13 2017 +0100
+++ b/security.h	Fri Oct 20 22:52:08 2017 +0000
@@ -1,35 +1,111 @@
+
 /*
+
  * 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 "bc1bd3c6-546a-4bc9-b10c-8c8a45655f1d"
+
+#define MBED_ENDPOINT_NAME "10e55cd4-4df5-46dd-8bca-bd6802748d58"
+
  
-#include <inttypes.h>
+
+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\n"
+
+"AwIDSAAwRQIhAPAonEAkwixlJiyYRQQWpXtkMZax+VlEiS201BG0PpAzAiBh2RsD\r\n"
+
+"NxLKWwf4O7D6JasGBYf9+ZLwl0iaRjTjytO+Kw==\r\n"
+
+"-----END CERTIFICATE-----\r\n";
+
  
-#define MBED_DOMAIN "DOMAIN"
-#define MBED_ENDPOINT_NAME "ENDPOINT_NAME"
- 
-const uint8_t SERVER_CERT[] = "-----BEGIN CERTIFICATE-----\r\n"
-"-----END CERTIFICATE-----\r\n";
- 
+
 const uint8_t CERT[] = "-----BEGIN CERTIFICATE-----\r\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
-#error "You need to get security.h credentials from connector.mbed.com and replace the content of this security.h file"
+