pelion-example-common-DISCO_F413ZH
Revision 27:8b5b0fc59d47, committed 2020-01-27
- Comitter:
- cvasilak
- Date:
- Mon Jan 27 15:29:50 2020 +0000
- Parent:
- 26:25ac72eedf55
- Child:
- 28:f3b254af78b2
- Commit message:
- further changes
Changed in this revision
--- a/main.cpp Mon Jan 27 15:17:34 2020 +0000
+++ b/main.cpp Mon Jan 27 15:29:50 2020 +0000
@@ -22,8 +22,6 @@
#include "FATFileSystem.h"
#include "LittleFileSystem.h"
-#include <string>
-
// Default network interface object. Don't forget to change the WiFi SSID/password in mbed_app.json if you're using WiFi.
NetworkInterface *net = NetworkInterface::get_default_instance();
@@ -57,7 +55,7 @@
// Declaring pointers for access to Pelion Device Management Client resources outside of main()
MbedCloudClientResource *res_button;
-MbedCloudClientResource *res_pattern_led;
+MbedCloudClientResource *res_led;
MbedCloudClientResource *res_post;
// Additional resources for sensor readings
@@ -73,38 +71,39 @@
// When the device is registered, this variable will be used to access various useful information, like device ID etc.
static const ConnectorClientEndpointInfo* endpointInfo;
-void pattern_updated(MbedCloudClientResource *resource, m2m::String newValue) {
- printf("PUT received, new value: %s\n", newValue.c_str());
-}
-
-void blink() {
- led = !led;
+/**
+ * PUT handler - sets the value of the built-in LED
+ * @param resource The resource that triggered the callback
+ * @param newValue Updated value for the resource
+ */
+void put_callback(MbedCloudClientResource *resource, m2m::String newValue) {
+ printf("PUT received. New value: %s\n", newValue.c_str());
+ led = atoi(newValue.c_str());
}
/**
- * POST handler
+ * POST handler - prints the content of the payload
* @param resource The resource that triggered the callback
* @param buffer If a body was passed to the POST function, this contains the data.
* Note that the buffer is deallocated after leaving this function, so copy it if you need it longer.
* @param size Size of the body
*/
-void blink_callback(MbedCloudClientResource *resource, const uint8_t *buffer, uint16_t size) {
- printf("POST received. Going to blink LED pattern: %s\n", res_pattern_led->get_value().c_str());
+void post_callback(MbedCloudClientResource *resource, const uint8_t *buffer, uint16_t size) {
+ printf("POST received (length %u). Payload: ", size);
+ for (size_t ix = 0; ix < size; ix++) {
+ printf("%02x ", buffer[ix]);
+ }
+ printf("\n");
+}
- // Parse the pattern string, and toggle the LED in that pattern
- string s = string(res_pattern_led->get_value().c_str());
- size_t i = 0;
- size_t pos = s.find(':');
- int total_len = 0;
- while (pos != string::npos) {
- int len = atoi(s.substr(i, pos - i).c_str());
-
- mbed_event_queue()->call_in(total_len + len, &blink);
-
- total_len += len;
- i = ++pos;
- pos = s.find(':', pos);
- }
+/**
+ * Button handler
+ * This function will be triggered either by a physical button press or by a ticker every 5 seconds (see below)
+ */
+void button_press() {
+ int v = res_button->get_value_int() + 1;
+ res_button->set_value(v);
+ printf("Button clicked %d times\n", v);
}
/**
@@ -117,13 +116,13 @@
}
/**
- * Button handler
- * This function will be triggered either by a physical button press or by a ticker every 5 seconds (see below)
+ * Registration callback handler
+ * @param endpoint Information about the registered endpoint such as the name (so you can find it back in portal)
+ * When the device is registered, this variable will be used to access various useful information, like device ID etc.
*/
-void button_press() {
- int v = res_button->get_value_int() + 1;
- res_button->set_value(v);
- printf("Button clicked %d times\n", v);
+void registered(const ConnectorClientEndpointInfo *endpoint) {
+ printf("Registered to Pelion Device Management. Endpoint Name: %s\n", endpoint->internal_endpoint_name.c_str());
+ endpointInfo = endpoint;
}
/**
@@ -140,15 +139,6 @@
}
}
-/**
- * Registration callback handler
- * @param endpoint Information about the registered endpoint such as the name (so you can find it back in portal)
- * When the device is registered, this variable will be used to access various useful information, like device ID etc.
- */
-void registered(const ConnectorClientEndpointInfo *endpoint) {
- printf("Registered to Pelion Device Management. Endpoint Name: %s\n", endpoint->internal_endpoint_name.c_str());
- endpointInfo = endpoint;
-}
int main(void) {
printf("\nStarting Simple Pelion Device Management Client example\n");
@@ -201,15 +191,14 @@
res_button->observable(true);
res_button->attach_notification_callback(button_callback);
- res_pattern_led = client.create_resource("3201/0/5853", "LED Pattern");
- //res_pattern_led->set_value("500:500:500:500:500:500:500:500");
- res_pattern_led->set_value("100:100:100:100:100:100:100:100");
- res_pattern_led->methods(M2MMethod::GET | M2MMethod::PUT);
- res_pattern_led->attach_put_callback(pattern_updated);
+ res_led = client.create_resource("3201/0/5853", "LED State");
+ res_led->set_value(led.read());
+ res_led->methods(M2MMethod::GET | M2MMethod::PUT);
+ res_led->attach_put_callback(put_callback);
- res_post = client.create_resource("3201/0/5850", "Blink Action");
+ res_post = client.create_resource("3300/0/5605", "Execute Function");
res_post->methods(M2MMethod::POST);
- res_post->attach_post_callback(eventQueue.event(&blink_callback));
+ res_post->attach_post_callback(post_callback);
// Sensor resources
res_temperature = client.create_resource("3303/0/5700", "Temperature (C)");
@@ -234,7 +223,6 @@
button.fall(eventQueue.event(&button_press));
printf("Press the user button to increment the LwM2M resource value...\n");
- // The timer fires on an interrupt context, but debounces it to the eventqueue, so it's safe to do network operations
Ticker timer;
timer.attach(eventQueue.event(&sensors_update), SENSORS_POLL_INTERVAL);
--- a/mbed_app.json Mon Jan 27 15:17:34 2020 +0000
+++ b/mbed_app.json Mon Jan 27 15:29:50 2020 +0000
@@ -6,8 +6,8 @@
"platform.stdio-convert-newlines" : true,
"mbed-trace.enable" : null,
"nsapi.default-wifi-security" : "WPA_WPA2",
- "nsapi.default-wifi-ssid" : "\"mbed_pe\"",
- "nsapi.default-wifi-password" : "\"ilovembed\""
+ "nsapi.default-wifi-ssid" : "\"SSID\"",
+ "nsapi.default-wifi-password" : "\"Password\""
},
"NUCLEO_F412ZG": {
"target.components_add" : ["SD"],
--- a/mbed_cloud_dev_credentials.c Mon Jan 27 15:17:34 2020 +0000
+++ b/mbed_cloud_dev_credentials.c Mon Jan 27 15:29:50 2020 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited. All rights reserved.
+ * Copyright (c) 2017 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.
@@ -15,202 +15,39 @@
*/
#ifndef __MBED_CLOUD_DEV_CREDENTIALS_H__
#define __MBED_CLOUD_DEV_CREDENTIALS_H__
-
+
+#if MBED_CONF_DEVICE_MANAGEMENT_DEVELOPER_MODE == 1
+#error "Replace mbed_cloud_dev_credentials.c with your own developer cert."
+#endif
+
#include <inttypes.h>
-
-const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[] = "016e88e387a18e469ba3291203c00000";
-const char MBED_CLOUD_DEV_ACCOUNT_ID[] = "0158778da56002420a014c1100000000";
-const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "coaps://bootstrap.us-east-1.mbedcloud.com:5684?aid=0158778da56002420a014c1100000000";
-
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE[] =
-{ 0x30, 0x82, 0x02, 0x84, 0x30, 0x82, 0x02, 0x29,
- 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x07,
- 0xa0, 0x5d, 0x09, 0x08, 0x57, 0x48, 0xe2, 0x82,
- 0x02, 0xb8, 0xaf, 0xc0, 0x5e, 0x27, 0x06, 0x30,
- 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
- 0x04, 0x03, 0x02, 0x30, 0x81, 0xa2, 0x31, 0x0b,
- 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
- 0x02, 0x47, 0x42, 0x31, 0x17, 0x30, 0x15, 0x06,
- 0x03, 0x55, 0x04, 0x08, 0x0c, 0x0e, 0x43, 0x61,
- 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73,
- 0x68, 0x69, 0x72, 0x65, 0x31, 0x12, 0x30, 0x10,
- 0x06, 0x03, 0x55, 0x04, 0x07, 0x0c, 0x09, 0x43,
- 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65,
- 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04,
- 0x0a, 0x0c, 0x07, 0x41, 0x52, 0x4d, 0x20, 0x4c,
- 0x74, 0x64, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
- 0x55, 0x04, 0x0b, 0x0c, 0x20, 0x30, 0x31, 0x35,
- 0x38, 0x37, 0x37, 0x38, 0x64, 0x61, 0x35, 0x36,
- 0x30, 0x30, 0x32, 0x34, 0x32, 0x30, 0x61, 0x30,
- 0x31, 0x34, 0x63, 0x31, 0x31, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x29, 0x30,
- 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x20,
- 0x30, 0x31, 0x36, 0x65, 0x38, 0x38, 0x65, 0x33,
- 0x38, 0x37, 0x61, 0x31, 0x38, 0x65, 0x34, 0x36,
- 0x39, 0x62, 0x61, 0x33, 0x32, 0x39, 0x31, 0x32,
- 0x30, 0x33, 0x63, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x31, 0x31,
- 0x32, 0x30, 0x31, 0x32, 0x35, 0x37, 0x32, 0x33,
- 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x31, 0x31, 0x32,
- 0x30, 0x31, 0x32, 0x35, 0x37, 0x32, 0x33, 0x5a,
- 0x30, 0x81, 0xa2, 0x31, 0x0b, 0x30, 0x09, 0x06,
- 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x47, 0x42,
- 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04,
- 0x08, 0x0c, 0x0e, 0x43, 0x61, 0x6d, 0x62, 0x72,
- 0x69, 0x64, 0x67, 0x65, 0x73, 0x68, 0x69, 0x72,
- 0x65, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
- 0x04, 0x07, 0x0c, 0x09, 0x43, 0x61, 0x6d, 0x62,
- 0x72, 0x69, 0x64, 0x67, 0x65, 0x31, 0x10, 0x30,
- 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x07,
- 0x41, 0x52, 0x4d, 0x20, 0x4c, 0x74, 0x64, 0x31,
- 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x0b,
- 0x0c, 0x20, 0x30, 0x31, 0x35, 0x38, 0x37, 0x37,
- 0x38, 0x64, 0x61, 0x35, 0x36, 0x30, 0x30, 0x32,
- 0x34, 0x32, 0x30, 0x61, 0x30, 0x31, 0x34, 0x63,
- 0x31, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03,
- 0x55, 0x04, 0x03, 0x0c, 0x20, 0x30, 0x31, 0x36,
- 0x65, 0x38, 0x38, 0x65, 0x33, 0x38, 0x37, 0x61,
- 0x31, 0x38, 0x65, 0x34, 0x36, 0x39, 0x62, 0x61,
- 0x33, 0x32, 0x39, 0x31, 0x32, 0x30, 0x33, 0x63,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x59, 0x30,
- 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d,
- 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
- 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04,
- 0x09, 0x65, 0x3b, 0xdd, 0xb9, 0x39, 0x9c, 0x61,
- 0x4c, 0x25, 0xb9, 0x01, 0x90, 0x15, 0x4d, 0x61,
- 0x62, 0xdf, 0x2d, 0x08, 0xe4, 0x0a, 0xf6, 0xfb,
- 0x6f, 0x80, 0x57, 0xbd, 0x9f, 0x88, 0x2d, 0xca,
- 0x1c, 0xe5, 0x8c, 0x44, 0x7b, 0x8f, 0x8b, 0x40,
- 0x5c, 0x4c, 0x18, 0x61, 0x33, 0x65, 0x0b, 0x83,
- 0xdf, 0x0d, 0xd4, 0x01, 0x8f, 0x4b, 0xef, 0x91,
- 0x33, 0xcc, 0x1f, 0xf2, 0xb1, 0x97, 0xd7, 0x46,
- 0xa3, 0x3f, 0x30, 0x3d, 0x30, 0x12, 0x06, 0x09,
- 0x2b, 0x06, 0x01, 0x04, 0x01, 0xa0, 0x20, 0x81,
- 0x49, 0x04, 0x05, 0x02, 0x03, 0x40, 0x00, 0x91,
- 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
- 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01,
- 0xff, 0x02, 0x01, 0x00, 0x30, 0x13, 0x06, 0x03,
- 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06,
- 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03,
- 0x02, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48,
- 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, 0x00,
- 0x30, 0x46, 0x02, 0x21, 0x00, 0xfc, 0x8c, 0x3b,
- 0x6d, 0x7a, 0xfd, 0xc2, 0xde, 0x6c, 0x0d, 0xd0,
- 0xcb, 0x5e, 0xb9, 0x6e, 0xb7, 0xd6, 0xd5, 0x65,
- 0xa7, 0xfd, 0x49, 0x4c, 0x13, 0xef, 0xe5, 0x45,
- 0x59, 0xce, 0xf2, 0x90, 0xff, 0x02, 0x21, 0x00,
- 0x8d, 0x46, 0xdf, 0x93, 0x40, 0x11, 0xa4, 0x3d,
- 0x2b, 0x19, 0x77, 0xcc, 0xea, 0x8d, 0x56, 0x71,
- 0x2d, 0xd4, 0x21, 0x78, 0x92, 0xeb, 0xd0, 0xf8,
- 0xa7, 0x47, 0xcc, 0xc6, 0xba, 0x94, 0x36, 0x26 };
-
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE[] =
-{ 0x30, 0x82, 0x02, 0x1f, 0x30, 0x82, 0x01, 0xc5,
- 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x3c,
- 0x63, 0x38, 0x70, 0x08, 0xd3, 0xc9, 0x8a, 0x4c,
- 0x72, 0x1f, 0x8f, 0x45, 0xeb, 0xd8, 0xf3, 0x30,
- 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
- 0x04, 0x03, 0x02, 0x30, 0x67, 0x31, 0x0b, 0x30,
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
- 0x47, 0x42, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03,
- 0x55, 0x04, 0x08, 0x13, 0x0e, 0x43, 0x61, 0x6d,
- 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x73, 0x68,
- 0x69, 0x72, 0x65, 0x31, 0x12, 0x30, 0x10, 0x06,
- 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x43, 0x61,
- 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x31,
- 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a,
- 0x13, 0x07, 0x41, 0x52, 0x4d, 0x20, 0x4c, 0x74,
- 0x64, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55,
- 0x04, 0x03, 0x13, 0x10, 0x41, 0x52, 0x4d, 0x20,
- 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61,
- 0x70, 0x20, 0x43, 0x41, 0x30, 0x20, 0x17, 0x0d,
- 0x31, 0x37, 0x30, 0x34, 0x30, 0x33, 0x31, 0x34,
- 0x30, 0x33, 0x33, 0x36, 0x5a, 0x18, 0x0f, 0x32,
- 0x30, 0x35, 0x32, 0x30, 0x34, 0x30, 0x33, 0x31,
- 0x34, 0x31, 0x33, 0x33, 0x36, 0x5a, 0x30, 0x67,
- 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
- 0x06, 0x13, 0x02, 0x47, 0x42, 0x31, 0x17, 0x30,
- 0x15, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0e,
- 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67,
- 0x65, 0x73, 0x68, 0x69, 0x72, 0x65, 0x31, 0x12,
- 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13,
- 0x09, 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64,
- 0x67, 0x65, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03,
- 0x55, 0x04, 0x0a, 0x13, 0x07, 0x41, 0x52, 0x4d,
- 0x20, 0x4c, 0x74, 0x64, 0x31, 0x19, 0x30, 0x17,
- 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x10, 0x41,
- 0x52, 0x4d, 0x20, 0x42, 0x6f, 0x6f, 0x74, 0x73,
- 0x74, 0x72, 0x61, 0x70, 0x20, 0x43, 0x41, 0x30,
- 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48,
- 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86,
- 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42,
- 0x00, 0x04, 0x3b, 0xd3, 0xfe, 0xb0, 0xd9, 0xa4,
- 0x72, 0xe1, 0x11, 0x11, 0x59, 0xba, 0x06, 0x2d,
- 0xf8, 0x26, 0xd5, 0x65, 0x98, 0xaa, 0xcf, 0x2a,
- 0x5f, 0xc6, 0x87, 0xa5, 0x6b, 0x0e, 0x30, 0x15,
- 0xe8, 0x12, 0x16, 0x49, 0x90, 0xe3, 0xf9, 0x3e,
- 0xf9, 0x3d, 0xde, 0xf5, 0x5a, 0x1f, 0x03, 0x44,
- 0xbb, 0x81, 0x7a, 0xc9, 0x71, 0x6d, 0x6c, 0xc2,
- 0x42, 0x3b, 0x55, 0xdb, 0x86, 0xad, 0x2c, 0xc0,
- 0xcf, 0xe4, 0xa3, 0x51, 0x30, 0x4f, 0x30, 0x0b,
- 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03,
- 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55,
- 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30,
- 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03,
- 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x84,
- 0xc0, 0xf5, 0x82, 0xe9, 0x5d, 0xa5, 0xe0, 0xaa,
- 0x74, 0x6f, 0xf7, 0x81, 0x8f, 0x4b, 0xe8, 0x9e,
- 0xde, 0x5d, 0x80, 0x30, 0x10, 0x06, 0x09, 0x2b,
- 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x01,
- 0x04, 0x03, 0x02, 0x01, 0x00, 0x30, 0x0a, 0x06,
- 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03,
- 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20,
- 0x19, 0x24, 0x0b, 0xc4, 0xac, 0x9d, 0x2b, 0x15,
- 0xf8, 0xc3, 0x0c, 0x0b, 0xf6, 0xac, 0xb3, 0xa1,
- 0xeb, 0x83, 0xfe, 0x1c, 0x4a, 0x96, 0x44, 0xc6,
- 0xa0, 0xbb, 0x56, 0x5c, 0x84, 0x13, 0xc9, 0x0f,
- 0x02, 0x21, 0x00, 0xbd, 0x89, 0x1c, 0x54, 0x98,
- 0xa5, 0xd0, 0x98, 0xc7, 0x0c, 0x08, 0x2f, 0xd9,
- 0x1b, 0xb8, 0x7e, 0xbf, 0x84, 0x3a, 0xfb, 0x8a,
- 0x43, 0x1a, 0x8e, 0xac, 0xdc, 0xa8, 0x66, 0x3d,
- 0xe3, 0xf9, 0xdc };
-
-const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY[] =
-{ 0x30, 0x81, 0x93, 0x02, 0x01, 0x00, 0x30, 0x13,
- 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
- 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
- 0x03, 0x01, 0x07, 0x04, 0x79, 0x30, 0x77, 0x02,
- 0x01, 0x01, 0x04, 0x20, 0xf5, 0x85, 0x76, 0x64,
- 0x9a, 0x9d, 0xb0, 0xa7, 0xbc, 0x98, 0x6e, 0x00,
- 0xdd, 0xcc, 0xc4, 0x9b, 0x5a, 0xe3, 0xd6, 0xfa,
- 0x94, 0xf7, 0xd0, 0xcc, 0x5f, 0x03, 0x5f, 0xa7,
- 0x61, 0xe0, 0x05, 0x21, 0xa0, 0x0a, 0x06, 0x08,
- 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07,
- 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x09, 0x65,
- 0x3b, 0xdd, 0xb9, 0x39, 0x9c, 0x61, 0x4c, 0x25,
- 0xb9, 0x01, 0x90, 0x15, 0x4d, 0x61, 0x62, 0xdf,
- 0x2d, 0x08, 0xe4, 0x0a, 0xf6, 0xfb, 0x6f, 0x80,
- 0x57, 0xbd, 0x9f, 0x88, 0x2d, 0xca, 0x1c, 0xe5,
- 0x8c, 0x44, 0x7b, 0x8f, 0x8b, 0x40, 0x5c, 0x4c,
- 0x18, 0x61, 0x33, 0x65, 0x0b, 0x83, 0xdf, 0x0d,
- 0xd4, 0x01, 0x8f, 0x4b, 0xef, 0x91, 0x33, 0xcc,
- 0x1f, 0xf2, 0xb1, 0x97, 0xd7, 0x46 };
-
+
+const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[] = "";
+const char MBED_CLOUD_DEV_ACCOUNT_ID[] = "";
+const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = "";
+
+const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE[] =
+{ 0x0 };
+
+const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE[] =
+{ 0x0 };
+
+const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY[] =
+{ 0x0 };
+
const char MBED_CLOUD_DEV_MANUFACTURER[] = "dev_manufacturer";
-
+
const char MBED_CLOUD_DEV_MODEL_NUMBER[] = "dev_model_num";
-
+
const char MBED_CLOUD_DEV_SERIAL_NUMBER[] = "0";
-
+
const char MBED_CLOUD_DEV_DEVICE_TYPE[] = "dev_device_type";
-
+
const char MBED_CLOUD_DEV_HARDWARE_VERSION[] = "dev_hardware_version";
-
+
const uint32_t MBED_CLOUD_DEV_MEMORY_TOTAL_KB = 0;
-
const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE);
const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE);
const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY);
-
-#endif //__MBED_CLOUD_DEV_CREDENTIALS_H__
+
+#endif //__MBED_CLOUD_DEV_CREDENTIALS_H__
\ No newline at end of file
--- a/update_certificate.pem Mon Jan 27 15:17:34 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBTDCB9KADAgECAhR/viWcf4HTx0iq3avvc77N3l7CDjAKBggqhkjOPQQDAjAU -MRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMjAwMTI3MTQxOTIxWhcNMjEwMTI3MDAw -MDAwWjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggqhkjOPQMB -BwNCAATy4XXwcvondLcUQgg2nbxcnjsCUIhKxjX3yQTJrn8FqVlfgYtrQAl12edA -QtsZ30moqg65ceMDE5J5aQVyZZt9oyQwIjALBgNVHQ8EBAMCB4AwEwYDVR0lBAww -CgYIKwYBBQUHAwMwCgYIKoZIzj0EAwIDRwAwRAIgHti+SxSwsnZ8yoHwueBYFKnd -WQ9q8H98CRSpdo8Kd+MCIBr3uVIMQimvvvm0exiKJrrMVwOw1khjX4oF0g858nVn ------END CERTIFICATE-----
--- a/update_default_resources.c Mon Jan 27 15:17:34 2020 +0000
+++ b/update_default_resources.c Mon Jan 27 15:29:50 2020 +0000
@@ -1,71 +1,41 @@
-
+// ----------------------------------------------------------------------------
+// Copyright 2016-2017 ARM Ltd.
+//
+// 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.
+// ----------------------------------------------------------------------------
+
#ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
#include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
#endif
-
+
#include <stdint.h>
-
+
#ifdef MBED_CLOUD_DEV_UPDATE_ID
-const uint8_t arm_uc_vendor_id[] = {
- 0x92, 0xcc, 0x10, 0xb6, 0xab, 0x40, 0x5e, 0x30, 0x88, 0x6f, 0xa5, 0xcc, 0xc3, 0x22, 0xec, 0x24
-};
+const uint8_t arm_uc_vendor_id[16] = { "dev_manufacturer" };
const uint16_t arm_uc_vendor_id_size = sizeof(arm_uc_vendor_id);
-
-const uint8_t arm_uc_class_id[] = {
- 0xfc, 0x51, 0x88, 0xd8, 0x32, 0xd6, 0x5c, 0x43, 0xbb, 0x79, 0x31, 0xd7, 0x1d, 0x8a, 0xd1, 0xcc
-};
+
+const uint8_t arm_uc_class_id[16] = { "dev_model_number" };
const uint16_t arm_uc_class_id_size = sizeof(arm_uc_class_id);
#endif
-
+
#ifdef MBED_CLOUD_DEV_UPDATE_CERT
-const uint8_t arm_uc_default_fingerprint[] = {
- 0x46, 0x22, 0xc9, 0x2e, 0xeb, 0x69, 0x3f, 0xd6, 0xfb, 0x5a, 0xa5, 0x13, 0xf3, 0x38, 0x76, 0x72,
- 0xe4, 0xa3, 0xa2, 0xfd, 0xf2, 0x5e, 0xc9, 0xd1, 0x7d, 0x59, 0x11, 0x76, 0x82, 0xc6, 0xe0, 0x51
-};
+const uint8_t arm_uc_default_fingerprint[32] = { 0 };
const uint16_t arm_uc_default_fingerprint_size =
sizeof(arm_uc_default_fingerprint);
-
-const uint8_t arm_uc_default_subject_key_identifier[] = {
-};
-const uint16_t arm_uc_default_subject_key_identifier_size =
- sizeof(arm_uc_default_subject_key_identifier);
-
-const uint8_t arm_uc_default_certificate[] = {
- 0x30, 0x82, 0x01, 0x4c, 0x30, 0x81, 0xf4, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x7f, 0xbe,
- 0x25, 0x9c, 0x7f, 0x81, 0xd3, 0xc7, 0x48, 0xaa, 0xdd, 0xab, 0xef, 0x73, 0xbe, 0xcd, 0xde, 0x5e,
- 0xc2, 0x0e, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x14,
- 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
- 0x68, 0x6f, 0x73, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x31, 0x32, 0x37, 0x31, 0x34,
- 0x31, 0x39, 0x32, 0x31, 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x31, 0x32, 0x37, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x5a, 0x30, 0x14, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c,
- 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
- 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01,
- 0x07, 0x03, 0x42, 0x00, 0x04, 0xf2, 0xe1, 0x75, 0xf0, 0x72, 0xfa, 0x27, 0x74, 0xb7, 0x14, 0x42,
- 0x08, 0x36, 0x9d, 0xbc, 0x5c, 0x9e, 0x3b, 0x02, 0x50, 0x88, 0x4a, 0xc6, 0x35, 0xf7, 0xc9, 0x04,
- 0xc9, 0xae, 0x7f, 0x05, 0xa9, 0x59, 0x5f, 0x81, 0x8b, 0x6b, 0x40, 0x09, 0x75, 0xd9, 0xe7, 0x40,
- 0x42, 0xdb, 0x19, 0xdf, 0x49, 0xa8, 0xaa, 0x0e, 0xb9, 0x71, 0xe3, 0x03, 0x13, 0x92, 0x79, 0x69,
- 0x05, 0x72, 0x65, 0x9b, 0x7d, 0xa3, 0x24, 0x30, 0x22, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f,
- 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30,
- 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, 0x30, 0x0a, 0x06, 0x08, 0x2a,
- 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x1e, 0xd8,
- 0xbe, 0x4b, 0x14, 0xb0, 0xb2, 0x76, 0x7c, 0xca, 0x81, 0xf0, 0xb9, 0xe0, 0x58, 0x14, 0xa9, 0xdd,
- 0x59, 0x0f, 0x6a, 0xf0, 0x7f, 0x7c, 0x09, 0x14, 0xa9, 0x76, 0x8f, 0x0a, 0x77, 0xe3, 0x02, 0x20,
- 0x1a, 0xf7, 0xb9, 0x52, 0x0c, 0x42, 0x29, 0xaf, 0xbe, 0xf9, 0xb4, 0x7b, 0x18, 0x8a, 0x26, 0xba,
- 0xcc, 0x57, 0x03, 0xb0, 0xd6, 0x48, 0x63, 0x5f, 0x8a, 0x05, 0xd2, 0x0f, 0x39, 0xf2, 0x75, 0x67
-};
-const uint16_t arm_uc_default_certificate_size = sizeof(arm_uc_default_certificate);
-#endif
-
-
-#ifdef MBED_CLOUD_DEV_UPDATE_PSK
-const uint8_t arm_uc_default_psk[] = {
-
-};
-const uint8_t arm_uc_default_psk_size = sizeof(arm_uc_default_psk);
-const uint16_t arm_uc_default_psk_bits = sizeof(arm_uc_default_psk)*8;
-
-const uint8_t arm_uc_default_psk_id[] = {
-
-};
-const uint8_t arm_uc_default_psk_id_size = sizeof(arm_uc_default_psk_id);
-#endif
+
+const uint8_t arm_uc_default_certificate[1] = { 0 };
+const uint16_t arm_uc_default_certificate_size =
+ sizeof(arm_uc_default_certificate);
+#endif
\ No newline at end of file