Jim Flynn
/
aws-iot-device-sdk-mbed-c
Changes to enabled on-line compiler
examples/jobs_sample/aws_iot_config.h@0:082731ede69f, 2018-05-30 (annotated)
- Committer:
- JMF
- Date:
- Wed May 30 20:59:51 2018 +0000
- Revision:
- 0:082731ede69f
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 0:082731ede69f | 1 | /* |
JMF | 0:082731ede69f | 2 | * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
JMF | 0:082731ede69f | 3 | * |
JMF | 0:082731ede69f | 4 | * Licensed under the Apache License, Version 2.0 (the "License"). |
JMF | 0:082731ede69f | 5 | * You may not use this file except in compliance with the License. |
JMF | 0:082731ede69f | 6 | * A copy of the License is located at |
JMF | 0:082731ede69f | 7 | * |
JMF | 0:082731ede69f | 8 | * http://aws.amazon.com/apache2.0 |
JMF | 0:082731ede69f | 9 | * |
JMF | 0:082731ede69f | 10 | * or in the "license" file accompanying this file. This file is distributed |
JMF | 0:082731ede69f | 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
JMF | 0:082731ede69f | 12 | * express or implied. See the License for the specific language governing |
JMF | 0:082731ede69f | 13 | * permissions and limitations under the License. |
JMF | 0:082731ede69f | 14 | */ |
JMF | 0:082731ede69f | 15 | |
JMF | 0:082731ede69f | 16 | /** |
JMF | 0:082731ede69f | 17 | * @file aws_iot_config.h |
JMF | 0:082731ede69f | 18 | * @brief AWS IoT specific configuration file |
JMF | 0:082731ede69f | 19 | */ |
JMF | 0:082731ede69f | 20 | |
JMF | 0:082731ede69f | 21 | #ifndef SRC_JOBS_IOT_JOB_CONFIG_H_ |
JMF | 0:082731ede69f | 22 | #define SRC_JOBS_IOT_JOB_CONFIG_H_ |
JMF | 0:082731ede69f | 23 | |
JMF | 0:082731ede69f | 24 | // Get from console |
JMF | 0:082731ede69f | 25 | // ================================================= |
JMF | 0:082731ede69f | 26 | #define AWS_IOT_MQTT_HOST "" ///< Customer specific MQTT HOST. The same will be used for Thing Shadow |
JMF | 0:082731ede69f | 27 | #define AWS_IOT_MQTT_PORT 443 ///< default port for MQTT/S |
JMF | 0:082731ede69f | 28 | #define AWS_IOT_MQTT_CLIENT_ID "c-sdk-client-id" ///< MQTT client ID should be unique for every device |
JMF | 0:082731ede69f | 29 | #define AWS_IOT_MY_THING_NAME "AWS-IoT-C-SDK" ///< Thing Name of the Shadow this device is associated with |
JMF | 0:082731ede69f | 30 | #define AWS_IOT_ROOT_CA_FILENAME "rootCA.crt" ///< Root CA file name |
JMF | 0:082731ede69f | 31 | #define AWS_IOT_CERTIFICATE_FILENAME "cert.pem" ///< device signed certificate file name |
JMF | 0:082731ede69f | 32 | #define AWS_IOT_PRIVATE_KEY_FILENAME "privkey.pem" ///< Device private key filename |
JMF | 0:082731ede69f | 33 | |
JMF | 0:082731ede69f | 34 | // MQTT PubSub |
JMF | 0:082731ede69f | 35 | #ifndef DISABLE_IOT_JOBS |
JMF | 0:082731ede69f | 36 | #define AWS_IOT_MQTT_RX_BUF_LEN 512 ///< Any message that comes into the device should be less than this buffer size. If a received message is bigger than this buffer size the message will be dropped. |
JMF | 0:082731ede69f | 37 | #else |
JMF | 0:082731ede69f | 38 | #define AWS_IOT_MQTT_RX_BUF_LEN 2048 |
JMF | 0:082731ede69f | 39 | #endif |
JMF | 0:082731ede69f | 40 | #define AWS_IOT_MQTT_TX_BUF_LEN 512 ///< Any time a message is sent out through the MQTT layer. The message is copied into this buffer anytime a publish is done. This will also be used in the case of Thing Shadow |
JMF | 0:082731ede69f | 41 | #define AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 ///< Maximum number of topic filters the MQTT client can handle at any given time. This should be increased appropriately when using Thing Shadow |
JMF | 0:082731ede69f | 42 | |
JMF | 0:082731ede69f | 43 | // Shadow and Job common configs |
JMF | 0:082731ede69f | 44 | #define MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 ///< Maximum size of the Unique Client Id. For More info on the Client Id refer \ref response "Acknowledgments" |
JMF | 0:082731ede69f | 45 | #define MAX_SIZE_CLIENT_ID_WITH_SEQUENCE MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES + 10 ///< This is size of the extra sequence number that will be appended to the Unique client Id |
JMF | 0:082731ede69f | 46 | #define MAX_SIZE_CLIENT_TOKEN_CLIENT_SEQUENCE MAX_SIZE_CLIENT_ID_WITH_SEQUENCE + 20 ///< This is size of the the total clientToken key and value pair in the JSON |
JMF | 0:082731ede69f | 47 | #define MAX_SIZE_OF_THING_NAME 30 ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger |
JMF | 0:082731ede69f | 48 | |
JMF | 0:082731ede69f | 49 | // Thing Shadow specific configs |
JMF | 0:082731ede69f | 50 | #define SHADOW_MAX_SIZE_OF_RX_BUFFER 512 ///< Maximum size of the SHADOW buffer to store the received Shadow message |
JMF | 0:082731ede69f | 51 | #define MAX_ACKS_TO_COMEIN_AT_ANY_GIVEN_TIME 10 ///< At Any given time we will wait for this many responses. This will correlate to the rate at which the shadow actions are requested |
JMF | 0:082731ede69f | 52 | #define MAX_THINGNAME_HANDLED_AT_ANY_GIVEN_TIME 10 ///< We could perform shadow action on any thing Name and this is maximum Thing Names we can act on at any given time |
JMF | 0:082731ede69f | 53 | #define MAX_JSON_TOKEN_EXPECTED 120 ///< These are the max tokens that is expected to be in the Shadow JSON document. Include the metadata that gets published |
JMF | 0:082731ede69f | 54 | #define MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 ///< All shadow actions have to be published or subscribed to a topic which is of the format $aws/things/{thingName}/shadow/update/accepted. This refers to the size of the topic without the Thing Name |
JMF | 0:082731ede69f | 55 | #define MAX_SHADOW_TOPIC_LENGTH_BYTES MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME + MAX_SIZE_OF_THING_NAME ///< This size includes the length of topic with Thing Name |
JMF | 0:082731ede69f | 56 | |
JMF | 0:082731ede69f | 57 | // Job specific configs |
JMF | 0:082731ede69f | 58 | #ifndef DISABLE_IOT_JOBS |
JMF | 0:082731ede69f | 59 | #define MAX_SIZE_OF_JOB_ID 64 |
JMF | 0:082731ede69f | 60 | #define MAX_JOB_JSON_TOKEN_EXPECTED 120 |
JMF | 0:082731ede69f | 61 | #define MAX_SIZE_OF_JOB_REQUEST AWS_IOT_MQTT_TX_BUF_LEN |
JMF | 0:082731ede69f | 62 | |
JMF | 0:082731ede69f | 63 | #define MAX_JOB_TOPIC_LENGTH_WITHOUT_JOB_ID_OR_THING_NAME 40 |
JMF | 0:082731ede69f | 64 | #define MAX_JOB_TOPIC_LENGTH_BYTES MAX_JOB_TOPIC_LENGTH_WITHOUT_JOB_ID_OR_THING_NAME + MAX_SIZE_OF_THING_NAME + MAX_SIZE_OF_JOB_ID + 2 |
JMF | 0:082731ede69f | 65 | #endif |
JMF | 0:082731ede69f | 66 | |
JMF | 0:082731ede69f | 67 | // Auto Reconnect specific config |
JMF | 0:082731ede69f | 68 | #define AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 ///< Minimum time before the First reconnect attempt is made as part of the exponential back-off algorithm |
JMF | 0:082731ede69f | 69 | #define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 ///< Maximum time interval after which exponential back-off will stop attempting to reconnect. |
JMF | 0:082731ede69f | 70 | |
JMF | 0:082731ede69f | 71 | #define DISABLE_METRICS false ///< Disable the collection of metrics by setting this to true |
JMF | 0:082731ede69f | 72 | |
JMF | 0:082731ede69f | 73 | #endif /* SRC_JOBS_IOT_JOB_CONFIG_H_ */ |