![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
test
aws_iot_config.h@1:3f75eb8d46f4, 2017-04-12 (annotated)
- Committer:
- peyo
- Date:
- Wed Apr 12 14:09:46 2017 +0200
- Revision:
- 1:3f75eb8d46f4
- Parent:
- 0:cd5404401c2f
add main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
peyo |
0:cd5404401c2f | 1 | /* |
peyo |
0:cd5404401c2f | 2 | * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
peyo |
0:cd5404401c2f | 3 | * |
peyo |
0:cd5404401c2f | 4 | * Licensed under the Apache License, Version 2.0 (the "License"). |
peyo |
0:cd5404401c2f | 5 | * You may not use this file except in compliance with the License. |
peyo |
0:cd5404401c2f | 6 | * A copy of the License is located at |
peyo |
0:cd5404401c2f | 7 | * |
peyo |
0:cd5404401c2f | 8 | * http://aws.amazon.com/apache2.0 |
peyo |
0:cd5404401c2f | 9 | * |
peyo |
0:cd5404401c2f | 10 | * or in the "license" file accompanying this file. This file is distributed |
peyo |
0:cd5404401c2f | 11 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
peyo |
0:cd5404401c2f | 12 | * express or implied. See the License for the specific language governing |
peyo |
0:cd5404401c2f | 13 | * permissions and limitations under the License. |
peyo |
0:cd5404401c2f | 14 | */ |
peyo |
0:cd5404401c2f | 15 | |
peyo |
0:cd5404401c2f | 16 | /** |
peyo |
0:cd5404401c2f | 17 | * @file aws_iot_config.h |
peyo |
0:cd5404401c2f | 18 | * @brief AWS IoT specific configuration file |
peyo |
0:cd5404401c2f | 19 | */ |
peyo |
0:cd5404401c2f | 20 | |
peyo |
0:cd5404401c2f | 21 | #ifndef SRC_SHADOW_IOT_SHADOW_CONFIG_H_ |
peyo |
0:cd5404401c2f | 22 | #define SRC_SHADOW_IOT_SHADOW_CONFIG_H_ |
peyo |
0:cd5404401c2f | 23 | |
peyo |
0:cd5404401c2f | 24 | |
peyo |
0:cd5404401c2f | 25 | static char AWS_IOT_ROOT_CA [] = \ |
peyo |
0:cd5404401c2f | 26 | "-----BEGIN CERTIFICATE-----\n"\ |
peyo |
0:cd5404401c2f | 27 | "MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB\n"\ |
peyo |
0:cd5404401c2f | 28 | "yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL\n"\ |
peyo |
0:cd5404401c2f | 29 | "ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp\n"\ |
peyo |
0:cd5404401c2f | 30 | "U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW\n"\ |
peyo |
0:cd5404401c2f | 31 | "ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0\n"\ |
peyo |
0:cd5404401c2f | 32 | "aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL\n"\ |
peyo |
0:cd5404401c2f | 33 | "MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW\n"\ |
peyo |
0:cd5404401c2f | 34 | "ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln\n"\ |
peyo |
0:cd5404401c2f | 35 | "biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\n"\ |
peyo |
0:cd5404401c2f | 36 | "U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y\n"\ |
peyo |
0:cd5404401c2f | 37 | "aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1\n"\ |
peyo |
0:cd5404401c2f | 38 | "nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex\n"\ |
peyo |
0:cd5404401c2f | 39 | "t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz\n"\ |
peyo |
0:cd5404401c2f | 40 | "SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG\n"\ |
peyo |
0:cd5404401c2f | 41 | "BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+\n"\ |
peyo |
0:cd5404401c2f | 42 | "rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/\n"\ |
peyo |
0:cd5404401c2f | 43 | "NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E\n"\ |
peyo |
0:cd5404401c2f | 44 | "BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH\n"\ |
peyo |
0:cd5404401c2f | 45 | "BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\n"\ |
peyo |
0:cd5404401c2f | 46 | "aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv\n"\ |
peyo |
0:cd5404401c2f | 47 | "MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE\n"\ |
peyo |
0:cd5404401c2f | 48 | "p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y\n"\ |
peyo |
0:cd5404401c2f | 49 | "5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK\n"\ |
peyo |
0:cd5404401c2f | 50 | "WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ\n"\ |
peyo |
0:cd5404401c2f | 51 | "4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N\n"\ |
peyo |
0:cd5404401c2f | 52 | "hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n"\ |
peyo |
0:cd5404401c2f | 53 | "-----END CERTIFICATE-----\0"; |
peyo |
0:cd5404401c2f | 54 | |
peyo |
0:cd5404401c2f | 55 | static char AWS_IOT_CERTIFICATE [] = \ |
peyo |
0:cd5404401c2f | 56 | "-----BEGIN CERTIFICATE-----\n"\ |
peyo |
0:cd5404401c2f | 57 | "MIIDWTCCAkGgAwIBAgIUTOhiAJm6t9F8cHGiiTF8/bsRqa4wDQYJKoZIhvcNAQEL\n"\ |
peyo |
0:cd5404401c2f | 58 | "BQAwTTFLMEkGA1UECwxCQW1hem9uIFdlYiBTZXJ2aWNlcyBPPUFtYXpvbi5jb20g\n"\ |
peyo |
0:cd5404401c2f | 59 | "SW5jLiBMPVNlYXR0bGUgU1Q9V2FzaGluZ3RvbiBDPVVTMB4XDTE3MDQwNTE2NDA0\n"\ |
peyo |
0:cd5404401c2f | 60 | "MVoXDTQ5MTIzMTIzNTk1OVowHjEcMBoGA1UEAwwTQVdTIElvVCBDZXJ0aWZpY2F0\n"\ |
peyo |
0:cd5404401c2f | 61 | "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKCMT3ozETT/YqRDk2iQ\n"\ |
peyo |
0:cd5404401c2f | 62 | "aZUgbkBVNweaKPWTbHsvItxVrBdsqUAGrTsYGX34OXgBiGamwO8FO3CDwDtnIxhm\n"\ |
peyo |
0:cd5404401c2f | 63 | "VGA2gJc33O6xHscPeP4LNi1F6L2NjPeMy2d4RZTUhYJbliL2JZ3nxrTod8WzBGxZ\n"\ |
peyo |
0:cd5404401c2f | 64 | "a75tZkt4DUSH+ON0f1DUQYTp6p1h9L3s21n9Yf8tq4Wxs1AE15pToRB181HPK4Is\n"\ |
peyo |
0:cd5404401c2f | 65 | "UYIdJ3E+bdTKA3K7uwiX1sM6puMDOkQeT4qE4s+wNIdzhfANa7UmPN4EL1H/gobz\n"\ |
peyo |
0:cd5404401c2f | 66 | "FlgiujG6VjyydLhTVVBxLH1f6bEC2pOO8mcS1vlu+IKWozbM65lR4oBMXRCU2bZI\n"\ |
peyo |
0:cd5404401c2f | 67 | "WhkCAwEAAaNgMF4wHwYDVR0jBBgwFoAU8WlgRVSkcjjMbpU8Psg8CBIkXAEwHQYD\n"\ |
peyo |
0:cd5404401c2f | 68 | "VR0OBBYEFA/Hn7qjU+K7F5T3DpYyocz/hkZvMAwGA1UdEwEB/wQCMAAwDgYDVR0P\n"\ |
peyo |
0:cd5404401c2f | 69 | "AQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4IBAQAuAPD7l2PRwhQW8KsG/14C+P2t\n"\ |
peyo |
0:cd5404401c2f | 70 | "gadtDlDFkHKZFXkS/fjYd9avijJWktboVSLQXqmJj2e88gDT6mrK6UjXoJH/S0MP\n"\ |
peyo |
0:cd5404401c2f | 71 | "HzhQ1c1pMjFYlRlGDJR+FJbSPMRWKbE/l/f5+XdkH13o4o3MD2E4jIWW33G8fhB6\n"\ |
peyo |
0:cd5404401c2f | 72 | "53fGFXfuj+8O7w0JBH0vZvWz3G6KQzG69j597vkyKzthc58fYhLOvMCklO2D9h+C\n"\ |
peyo |
0:cd5404401c2f | 73 | "IWnHDivkqboXI6lACUueuDlH2UJcQBACZlVJ14F5cZwbosJo2D/nSk8VvPcMwoT1\n"\ |
peyo |
0:cd5404401c2f | 74 | "T3ut2VYu1LmRwFxPHhP7c0RhvgE16j03dfPyDkm0eMQEo99RJrbAnVJK1mrd\n"\ |
peyo |
0:cd5404401c2f | 75 | "-----END CERTIFICATE-----\0"; |
peyo |
0:cd5404401c2f | 76 | |
peyo |
0:cd5404401c2f | 77 | static char AWS_IOT_PRIVATE_KEY [] = \ |
peyo |
0:cd5404401c2f | 78 | "-----BEGIN RSA PRIVATE KEY-----\n"\ |
peyo |
0:cd5404401c2f | 79 | "MIIEowIBAAKCAQEAoIxPejMRNP9ipEOTaJBplSBuQFU3B5oo9ZNsey8i3FWsF2yp\n"\ |
peyo |
0:cd5404401c2f | 80 | "QAatOxgZffg5eAGIZqbA7wU7cIPAO2cjGGZUYDaAlzfc7rEexw94/gs2LUXovY2M\n"\ |
peyo |
0:cd5404401c2f | 81 | "94zLZ3hFlNSFgluWIvYlnefGtOh3xbMEbFlrvm1mS3gNRIf443R/UNRBhOnqnWH0\n"\ |
peyo |
0:cd5404401c2f | 82 | "vezbWf1h/y2rhbGzUATXmlOhEHXzUc8rgixRgh0ncT5t1MoDcru7CJfWwzqm4wM6\n"\ |
peyo |
0:cd5404401c2f | 83 | "RB5PioTiz7A0h3OF8A1rtSY83gQvUf+ChvMWWCK6MbpWPLJ0uFNVUHEsfV/psQLa\n"\ |
peyo |
0:cd5404401c2f | 84 | "k47yZxLW+W74gpajNszrmVHigExdEJTZtkhaGQIDAQABAoIBACO+eWdsfTU+cri9\n"\ |
peyo |
0:cd5404401c2f | 85 | "rtEF7evct48tKb5QjTP3qZxXZzyE+naQo7H0ipbwi6RnImxccwDfuW69zHkFbEQN\n"\ |
peyo |
0:cd5404401c2f | 86 | "d1vUVI7DM6f3MQIXfxG0mSx+VIaJ3QJuxGbM+vBDb8Jt+neGaovIH6HjW3Mlmpzy\n"\ |
peyo |
0:cd5404401c2f | 87 | "eVaiJgHUm4TL6rBKUZhadIoLZ7bufeikmEYTZyxHBSa/7VpPSroMbbXjWqJDovRe\n"\ |
peyo |
0:cd5404401c2f | 88 | "HodSXBi7B8xlBmrx6yZhNBc/fkDtVvriK3ii7jjzxX+GH1tGpIyjMBU16l8/zjTD\n"\ |
peyo |
0:cd5404401c2f | 89 | "+QGKzDGexCcamJyb5XlRlXSa+QNGrBu3Es/91V/MYjvGTWU9/dES0bgMvVY2iDQA\n"\ |
peyo |
0:cd5404401c2f | 90 | "ECJzZPECgYEA7sax18AEGnQUEPGKdPrwndIh7k2ovXH81JBgkWSdB8PWA6+1RtcU\n"\ |
peyo |
0:cd5404401c2f | 91 | "XaFwfx6tQpzNhY+eP9cPqSaRcl3wHmwTChawRP+0lWoplUhft7zNsBX1OX9zm0d0\n"\ |
peyo |
0:cd5404401c2f | 92 | "vuNpCRpKWeXilIhUBWwwuKSn00z0D8mWQUdqQUU/dFbCweezfGCubBUCgYEArCEI\n"\ |
peyo |
0:cd5404401c2f | 93 | "+v7KyDzPBs590p5ktWQ3GMVXYg4yAZP9MUskzLut0lbmY9r7Yz8RL8y6iBJco7L+\n"\ |
peyo |
0:cd5404401c2f | 94 | "ry265G6MWqXvnjbsMrvgD1Bv466Oe7Wvez+zklwFtum0nrlwRhDdndhrHV1MUpKv\n"\ |
peyo |
0:cd5404401c2f | 95 | "4Ea1suogcoDNEdI5eSDnajiWoCYi1l1sUbFnwvUCgYB6FCZrG2Y9rClyPDxA8OfC\n"\ |
peyo |
0:cd5404401c2f | 96 | "mOP2NchXC4drmmF1FI7goHS0L8qr7F0iPd8Jb0LAMvE1HyeWljsQjYKBiZuxwim9\n"\ |
peyo |
0:cd5404401c2f | 97 | "17nJnT7TwZJ/G6CsjSBQrflRq2MM+eyriBN0rvdinRFKRaVHnHgQf0a61rZVuAhV\n"\ |
peyo |
0:cd5404401c2f | 98 | "WdDujBwUPCOZBgCTT879vQKBgFxdMbN1y5ydPL47SbseMY5AY2xQYK6GTYEZR1EP\n"\ |
peyo |
0:cd5404401c2f | 99 | "MIUH5KMs7F4C4MiFzBQpOKLRr5JL92xLDrGLPJdb2XO9pwsmU3oEQLYdMeniOXLa\n"\ |
peyo |
0:cd5404401c2f | 100 | "YOKVrJ9VUw2lFkESxcjwm7HbIZxhiCzB5LhH9/dZdDEu7JY5+NO/39u5+xGqefhw\n"\ |
peyo |
0:cd5404401c2f | 101 | "SOyNAoGBAIPf+vNXSFaGZubKHx6O28fjCVJvSsu4xazuIoCSZiayJLDHRgMVOIqq\n"\ |
peyo |
0:cd5404401c2f | 102 | "6cWn6hAN4SIo6QAknU86MPsHZRRxuUaY5OtF5ucPMS+txnXwr9d7RIGZirSL01yp\n"\ |
peyo |
0:cd5404401c2f | 103 | "T4li1IMCa6uFoO+TFQHYF7ObzIGaTl5rsOSyFdIvmq+VZvvNqxit\n"\ |
peyo |
0:cd5404401c2f | 104 | "-----END RSA PRIVATE KEY-----\0"; |
peyo |
0:cd5404401c2f | 105 | |
peyo |
0:cd5404401c2f | 106 | static char PASSWORD [] = ""; |
peyo |
0:cd5404401c2f | 107 | |
peyo |
0:cd5404401c2f | 108 | // Get from console |
peyo |
0:cd5404401c2f | 109 | // ================================================= |
peyo |
0:cd5404401c2f | 110 | #define AWS_IOT_MQTT_HOST "aewcj8vppr8nv.iot.us-east-1.amazonaws.com" ///< Customer specific MQTT HOST. The same will be used for Thing Shadow |
peyo |
0:cd5404401c2f | 111 | #define AWS_IOT_MQTT_PORT 8883 ///< default port for MQTT/S |
peyo |
0:cd5404401c2f | 112 | #define AWS_IOT_MQTT_CLIENT_ID "K64F_CPI" ///< MQTT client ID should be unique for every device |
peyo |
0:cd5404401c2f | 113 | #define AWS_IOT_MY_THING_NAME "K64F_CPI" ///< Thing Name of the Shadow this device is associated with |
peyo |
0:cd5404401c2f | 114 | #define AWS_IOT_ROOT_CA_FILENAME "rootCA.crt" ///< Root CA file name |
peyo |
0:cd5404401c2f | 115 | #define AWS_IOT_CERTIFICATE_FILENAME "aeae2025ec-certificate.pem.crt" ///< device signed certificate file name |
peyo |
0:cd5404401c2f | 116 | #define AWS_IOT_PRIVATE_KEY_FILENAME "aeae2025ec-private.pem.key" ///< Device private key filename |
peyo |
0:cd5404401c2f | 117 | // ================================================= |
peyo |
0:cd5404401c2f | 118 | |
peyo |
0:cd5404401c2f | 119 | // MQTT PubSub |
peyo |
0:cd5404401c2f | 120 | #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 |
peyo |
0:cd5404401c2f | 121 | #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. |
peyo |
0:cd5404401c2f | 122 | #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 |
peyo |
0:cd5404401c2f | 123 | |
peyo |
0:cd5404401c2f | 124 | // Thing Shadow specific configs |
peyo |
0:cd5404401c2f | 125 | #define SHADOW_MAX_SIZE_OF_RX_BUFFER AWS_IOT_MQTT_RX_BUF_LEN+1 ///< Maximum size of the SHADOW buffer to store the received Shadow message |
peyo |
0:cd5404401c2f | 126 | #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" |
peyo |
0:cd5404401c2f | 127 | #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 |
peyo |
0:cd5404401c2f | 128 | #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 |
peyo |
0:cd5404401c2f | 129 | #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 |
peyo |
0:cd5404401c2f | 130 | #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 |
peyo |
0:cd5404401c2f | 131 | #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 |
peyo |
0:cd5404401c2f | 132 | #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 |
peyo |
0:cd5404401c2f | 133 | #define MAX_SIZE_OF_THING_NAME 20 ///< The Thing Name should not be bigger than this value. Modify this if the Thing Name needs to be bigger |
peyo |
0:cd5404401c2f | 134 | #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 |
peyo |
0:cd5404401c2f | 135 | |
peyo |
0:cd5404401c2f | 136 | // Auto Reconnect specific config |
peyo |
0:cd5404401c2f | 137 | #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 |
peyo |
0:cd5404401c2f | 138 | #define AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 ///< Maximum time interval after which exponential back-off will stop attempting to reconnect. |
peyo |
0:cd5404401c2f | 139 | |
peyo |
0:cd5404401c2f | 140 | #endif /* SRC_SHADOW_IOT_SHADOW_CONFIG_H_ */ |