Mbed OS Device Management example for various Silicon Labs boards.
DEPRECATED
This example application is not maintained and not recommended. It uses an old version of Mbed OS, Pelion DM, and Arm toolchain. It doesn't work with Mbed Studio.
Please use: https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-pelion/
This example is known to work great on the following platforms:
- Thunderboard Sense 2 - on-chip 15.4 Thread and onboard SPI flash. Board specific example using onboard sensors is available here.
- EFM32 Giant Gecko 11 - onboard Ethernet and onboard QSPI flash.
Follow the Quick-Start instructions: https://cloud.mbed.com/quick-start
Example functionality
This example showcases the following device functionality:
- On user button click, increment Pelion LWM2M button resource.
- Allow the user to change the state of the board LED from Pelion LWM2M led_state resource and PUT request.
Use this example with Mbed CLI
1. Import the application into your desktop:
mbed import https://os.mbed.com/teams/SiliconLabs/code/pelion-example-common cd pelion-example-common
2. Install the CLOUD_SDK_API_KEY
mbed config -G CLOUD_SDK_API_KEY <PELION_DM_API_KEY>
For instructions on how to generate your API key, please see the documentation.
3. Initialize firmware credentials (done once per repository). You can use the following command:
mbed dm init -d "<your company name in Pelion DM>" --model-name "<product model identifier>" -q --force
If above command do not work for your Mbed CLI, please consider upgrading Mbed CLI to version 1.8.x or above.
4. Compile and program:
mbed compile -t <toolchain> -m <TARGET_BOARD>
(supported toolchains : GCC_ARM / ARM / IAR)
mbed_cloud_dev_credentials.c@5:1456ec2e8485, 2019-03-27 (annotated)
- Committer:
- screamer
- Date:
- Wed Mar 27 19:02:10 2019 +0000
- Revision:
- 5:1456ec2e8485
- Parent:
- 2:7f7e92f02807
Improve inline documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 2:7f7e92f02807 | 1 | /* |
screamer | 2:7f7e92f02807 | 2 | * Copyright (c) 2017 ARM Limited. All rights reserved. |
screamer | 2:7f7e92f02807 | 3 | * SPDX-License-Identifier: Apache-2.0 |
screamer | 2:7f7e92f02807 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
screamer | 2:7f7e92f02807 | 5 | * not use this file except in compliance with the License. |
screamer | 2:7f7e92f02807 | 6 | * You may obtain a copy of the License at |
screamer | 2:7f7e92f02807 | 7 | * |
screamer | 2:7f7e92f02807 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
screamer | 2:7f7e92f02807 | 9 | * |
screamer | 2:7f7e92f02807 | 10 | * Unless required by applicable law or agreed to in writing, software |
screamer | 2:7f7e92f02807 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
screamer | 2:7f7e92f02807 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
screamer | 2:7f7e92f02807 | 13 | * See the License for the specific language governing permissions and |
screamer | 2:7f7e92f02807 | 14 | * limitations under the License. |
screamer | 2:7f7e92f02807 | 15 | */ |
screamer | 2:7f7e92f02807 | 16 | #ifndef __MBED_CLOUD_DEV_CREDENTIALS_H__ |
screamer | 2:7f7e92f02807 | 17 | #define __MBED_CLOUD_DEV_CREDENTIALS_H__ |
screamer | 2:7f7e92f02807 | 18 | |
screamer | 2:7f7e92f02807 | 19 | #if MBED_CONF_DEVICE_MANAGEMENT_DEVELOPER_MODE == 1 |
screamer | 2:7f7e92f02807 | 20 | #error "Replace mbed_cloud_dev_credentials.c with your own developer cert." |
screamer | 2:7f7e92f02807 | 21 | #endif |
screamer | 2:7f7e92f02807 | 22 | |
screamer | 2:7f7e92f02807 | 23 | #include <inttypes.h> |
screamer | 2:7f7e92f02807 | 24 | |
screamer | 2:7f7e92f02807 | 25 | const char MBED_CLOUD_DEV_BOOTSTRAP_ENDPOINT_NAME[] = ""; |
screamer | 2:7f7e92f02807 | 26 | const char MBED_CLOUD_DEV_ACCOUNT_ID[] = ""; |
screamer | 2:7f7e92f02807 | 27 | const char MBED_CLOUD_DEV_BOOTSTRAP_SERVER_URI[] = ""; |
screamer | 2:7f7e92f02807 | 28 | |
screamer | 2:7f7e92f02807 | 29 | const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE[] = |
screamer | 2:7f7e92f02807 | 30 | { 0x0 }; |
screamer | 2:7f7e92f02807 | 31 | |
screamer | 2:7f7e92f02807 | 32 | const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE[] = |
screamer | 2:7f7e92f02807 | 33 | { 0x0 }; |
screamer | 2:7f7e92f02807 | 34 | |
screamer | 2:7f7e92f02807 | 35 | const uint8_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY[] = |
screamer | 2:7f7e92f02807 | 36 | { 0x0 }; |
screamer | 2:7f7e92f02807 | 37 | |
screamer | 2:7f7e92f02807 | 38 | const char MBED_CLOUD_DEV_MANUFACTURER[] = "dev_manufacturer"; |
screamer | 2:7f7e92f02807 | 39 | |
screamer | 2:7f7e92f02807 | 40 | const char MBED_CLOUD_DEV_MODEL_NUMBER[] = "dev_model_num"; |
screamer | 2:7f7e92f02807 | 41 | |
screamer | 2:7f7e92f02807 | 42 | const char MBED_CLOUD_DEV_SERIAL_NUMBER[] = "0"; |
screamer | 2:7f7e92f02807 | 43 | |
screamer | 2:7f7e92f02807 | 44 | const char MBED_CLOUD_DEV_DEVICE_TYPE[] = "dev_device_type"; |
screamer | 2:7f7e92f02807 | 45 | |
screamer | 2:7f7e92f02807 | 46 | const char MBED_CLOUD_DEV_HARDWARE_VERSION[] = "dev_hardware_version"; |
screamer | 2:7f7e92f02807 | 47 | |
screamer | 2:7f7e92f02807 | 48 | const uint32_t MBED_CLOUD_DEV_MEMORY_TOTAL_KB = 0; |
screamer | 2:7f7e92f02807 | 49 | const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_CERTIFICATE); |
screamer | 2:7f7e92f02807 | 50 | const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_SERVER_ROOT_CA_CERTIFICATE); |
screamer | 2:7f7e92f02807 | 51 | const uint32_t MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY_SIZE = sizeof(MBED_CLOUD_DEV_BOOTSTRAP_DEVICE_PRIVATE_KEY); |
screamer | 2:7f7e92f02807 | 52 | |
screamer | 2:7f7e92f02807 | 53 | #endif //__MBED_CLOUD_DEV_CREDENTIALS_H__ |