forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: google_iot_device: Remove "command line" and replace with co…
…nfig.c (zephyrproject-rtos#8) * samples: google_iot_device: Remove "command line" and replace with config.c There is no "command line" in Zephyr RTOS. "Command line" which was used previously is an artifact of a special-purpose, testing target "native_posix", not portable to any other Zephyr target. So, instead provide config.c file, where a user can define all needed application parameters (which previously were passed on "command line"). As such a file contain credentials, it should be never put under version control. This commit includes a template file, config.c.in, which can be copied by a user to config.c, and required values filled in. Signed-off-by: Paul Sokolovsky <[email protected]> * samples: google_iot_device: README: Update for moving from cmdline to config.c Signed-off-by: Paul Sokolovsky <[email protected]>
- Loading branch information
Showing
9 changed files
with
60 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* Copyright 2019 Google LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
/* CHANGE THIS */ | ||
const char* iotc_project_id = "<GCP IoT Core Project ID>"; | ||
/* CHANGE THIS */ | ||
const char* iotc_device_path = "projects/<GCP IoT Core Project ID>/locations/<Region>/registries/<GCP IoT Core Registry ID>/devices/<GCP IoT Core Device ID>"; | ||
/* CHANGE THIS */ | ||
const char* iotc_publish_topic = "/devices/<GCP IoT Core Device ID>/state"; | ||
/* CHANGE THIS*/ | ||
const char* iotc_private_key_pem = | ||
"-----BEGIN EC PRIVATE KEY-----\n" | ||
"use\n" | ||
"your\n" | ||
"key\n" | ||
"-----END EC PRIVATE KEY-----\n"; | ||
|
||
const char* iotc_publish_message = "Hello from Zephyr!"; | ||
|
||
iotc_mqtt_qos_t iotc_example_qos = IOTC_MQTT_QOS_AT_LEAST_ONCE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Copyright 2019 Google LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* | ||
* Declarations for application config options. | ||
*/ | ||
|
||
#include <iotc_mqtt.h> | ||
|
||
extern iotc_mqtt_qos_t iotc_example_qos; | ||
|
||
extern const char* iotc_project_id; | ||
extern const char* iotc_device_path; | ||
extern const char* iotc_private_key_pem; | ||
extern const char* iotc_publish_topic; | ||
extern const char* iotc_publish_message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.