no-OS
parameters.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __PARAMETERS_H__
35 #define __PARAMETERS_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #ifndef DISABLE_SECURE_SOCKET
41 #include "iot_sample_common.h"
42 #endif
43 
44 /******************************************************************************/
45 /********************** Macros and Constants Definitions **********************/
46 /******************************************************************************/
47 
48 #define UART_DEVICE_ID 1
49 #define INTC_DEVICE_ID 0
50 #define UART_IRQ_ID UART1_IRQn
51 #define UART_BAUDRATE 57600
52 
53 #ifdef RTC_SET_DEFAULT
54 /* RTC BCD Format (example 26.01.2023-13:15:00) */
55 #define RTC_SEC_DEFAULT 0
56 #define RTC_MIN_DEFAULT 15
57 #define RTC_HR_DEFAULT 13
58 #define RTC_DAY_DEFAULT 26
59 #define RTC_MON_DEFAULT 1
60 #define RTC_YEAR_DEFAULT 23
61 #endif
62 
63 /* 1 sec acuumulation */
64 #define ADE9430_SAMPLES_NR 7999
65 
66 /* Wifi Parameters */
67 #define WIFI_SSID "WifiSSID"
68 #define WIFI_PWD "WifiPassword"
69 
70 #ifndef DISABLE_SECURE_SOCKET
71 /* Server Port is common for both IoT and DPS */
72 #define SERVER_PORT 8883
73 /* Azure IoT Hub Server Address */
74 #define SERVER_ADDR "iot-hub-mopdcwnti4mly.azure-devices.net"
75 /* Azure Device Provisioning Service Server Address */
76 #define DPS_SERVER_ADDR "dps-mopdcwnti4mly.azure-devices-provisioning.net"
77 #define AZ_IOT_PROVISIONING_CUSTOM_PAYLOAD "{\"modelId\":\"dtmi:com:analog:ADX12345;1\"}"
78 #define AZ_IOT_PROVISIONING_ID_SCOPE "0ne009919BB"
79 #define AZ_IOT_PROVISIONING_REGISTRATION_ID "EnergyMonitoringDevice1"
80 #define SAMPLE_TYPE PAHO_IOT_PROVISIONING
81 #define REGISTER_TOPIC_BUFFER_LENGTH 128
82 #define PROVISIONING_ENDPOINT_BUFFER_LENGTH 256
83 #define MQTT_PAYLOAD_BUFFER_LENGTH 256
84 #define CLIENT_ID_BUFFER_LENGTH 128
85 #else
86 /* MQTT Broker Parameters, non-encrypted communication */
87 #define SERVER_PORT 1883
88 #define SERVER_ADDR "192.168.128.123"
89 #define MQTT_PUBLISH_TOPIC "ade9430"
90 #define MQTT_SUBSCRIBE_TOPIC "maxim_messages"
91 #define MQTT_CONFIG_CLIENT_NAME "maxim-client"
92 #define MQTT_CONFIG_CLI_USER NULL
93 #endif
94 
95 #define BUFF_LEN 200
96 #define TIMER_ID 1
97 #define MQTT_CONFIG_CMD_TIMEOUT 20000
98 
99 /* For Azure encrypted communication MQTT version 3.1.1. is required.*/
100 #ifndef DISABLE_SECURE_SOCKET
101 #define MQTT_CONFIG_VERSION MQTT_VERSION_3_1_1
102 #else
103 #define MQTT_CONFIG_VERSION MQTT_VERSION_3_1
104 #endif
105 
106 #define MQTT_CONFIG_CLI_PASS NULL
107 #define MQTT_CONFIG_KEEP_ALIVE 7200
108 #define SCAN_SENSOR_TIME 500
109 
110 #ifndef DISABLE_SECURE_SOCKET
111 /* Populate here your CA certificate content */
112 #define CA_CERT \
113  "-----BEGIN CERTIFICATE-----\r\n" \
114  "MIIDHzCCAgegAwIBAgIUCFbk7jeOFFqrrLVQjCoLQDCvNp0wDQYJKoZIhvcNAQEL\r\n" \
115  "BQAwHzEdMBsGA1UEAwwUQW5hbG9nIERldmljZXMsIEluYy4wHhcNMjMwMjI3MTAw\r\n" \
116  "NjQwWhcNMzIxMTI2MTAwNjQwWjAfMR0wGwYDVQQDDBRBbmFsb2cgRGV2aWNlcywg\r\n" \
117  "SW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPLUgsHWu4SCB11U\r\n" \
118  "GxlmqJ3pIzP4YWdH/cww2K+OjCS4KWy5Fb//KlZMxXjZeJ6iAd5pcOvcsE4w5CQM\r\n" \
119  "kRVxdqzLmLcVsh9hMW+dB+Aeeura8pav7TtlO3BOZxsQN/PWi8AX5g8rjO5xC9hs\r\n" \
120  "9kxR5MAXlUOlq9WJ2T8xdtxZSQHT5pnrHEVnjd72rZlC2rAS8vYTrMxQLWm2GK+2\r\n" \
121  "7jYhQ9jSKuvy/g5XSYI0OHlWFrzo1fDuR/Ma5aJZBzBRKOKAXl2uFweiEYVH1sZe\r\n" \
122  "iztZlhxtxHAfJHVhnEL/wf7GnaAClCoMd4amxBuiESxrP+DU/lwwNerBbB+wMxqr\r\n" \
123  "n+/Hb2MCAwEAAaNTMFEwHQYDVR0OBBYEFIfN1T+xxFvPuxcT8ROronOnTQDhMB8G\r\n" \
124  "A1UdIwQYMBaAFIfN1T+xxFvPuxcT8ROronOnTQDhMA8GA1UdEwEB/wQFMAMBAf8w\r\n" \
125  "DQYJKoZIhvcNAQELBQADggEBADpA6t61wwEqQ4yBXWk9sX5dW3NQpj/FigpWIUnf\r\n" \
126  "geQedXfrn/zZFOC7iA05uHdjRpP+Fp4ebJNxHOMbL7TCMPOG+SBYgbMv9ZgRDAYj\r\n" \
127  "Ca3Osm53EqeMi+26ka6xkBEHYZ+vVt1bwZOjwxzX56J6lNiKLvgQgn9EgeKpQker\r\n" \
128  "lV12T04/NgeIm38mfRqxueYG22YrLuo+dzijwzY2wwBGntwFviXWLGDYMGiBMPSp\r\n" \
129  "VtB5eptX+YUdO84E+86irjOIrsgqO1G7MYu8beuonIrjgmtApOtT7xPPDS39YO1J\r\n" \
130  "mQoyLhuU7nr8QZbiLTi+dSBlytJFvPkgjrgqR7WWkLPEj0w=\r\n" \
131  "-----END CERTIFICATE-----\r\n"
132 
133 /* Populate here your device certificate content */
134 #define DEVICE_CERT \
135  "-----BEGIN CERTIFICATE-----\n" \
136  "MIICyDCCAbACFFJnmg1mTQALnBB/w4LUQTQ+hckpMA0GCSqGSIb3DQEBCwUAMB8x\r\n" \
137  "HTAbBgNVBAMMFEFuYWxvZyBEZXZpY2VzLCBJbmMuMB4XDTIzMDIyNzEwMTM1NloX\r\n" \
138  "DTIzMDMyOTEwMTM1NlowIjEgMB4GA1UEAwwXRW5lcmd5TW9uaXRvcmluZ0Rldmlj\r\n" \
139  "ZTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHjhmvEevCFkVm8g7D\r\n" \
140  "+9DJQHwt/pmWOg11EwmsmuaCt3V+j6KfujJRoqCUqlc0/vvqiaUKxlqKRq9Rdjnq\r\n" \
141  "YKcYvWOHT+pXpRlNPxbL/u9gL1t2PTb67UWYKQRYUaP+lH9UFJamKcVd6rDpJDbD\r\n" \
142  "lruzQUr542G5zlzeIsT8Bw9p2Qtk54bdenMK8bcGKcJTUSlLP++30lj1E5dg57XD\r\n" \
143  "uMiwz/dP3TC01/807K59vR3IwSCQUIbes1h3n4xTbgJrl1jx/G1FzGi/Oo5OBIQB\r\n" \
144  "3JFIs8nMMAElGutOAdznyLTzK0IzzvJylJeOJtlbafv2KB1CehNFkXVgkqnugZSX\r\n" \
145  "Vf4ZAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAAkI4/Bfo9bUUWmbzsfPRAACa1yr\r\n" \
146  "ZYhPm7gjB3UO2TNI1+kZq1mbptm4AQlRKHZOc4RwOKw2+gEc++FwK9v8Ai1EcVgW\r\n" \
147  "bCgmL1fWzxwmPCAatjWAIXIwtao4g3xPFOSw8Afg54upUNLzpLHyxyuByLOIs+TQ\r\n" \
148  "qCpjNXMsBblrU+7XOjo0Z5qxyWGxzFkI+/MfW9F5+q0dt77f6GxBmEAj42HIou32\r\n" \
149  "B8CohaPoJ8qJAWd9X+zKGzzstXEmmnlSX0T1H3jaL+ENRNzWpMT6ASt3u+Mq+WpY\r\n" \
150  "che9sgKqK4yPsqewrBSacSORc0aY+Htp1MwVWjnhKI/X+7eEV6CQ3Y7FYoc=\r\n" \
151  "-----END CERTIFICATE-----\r\n";
152 
153 /* Populate here your device private key content */
154 #define DEVICE_PRIVATE_KEY \
155  "-----BEGIN PRIVATE KEY-----\n" \
156  "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcw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" \
171  "5i3Eo8l5vhtkWws+DyJpBPpX+TAIpnYQ4PSMPNxsft2YFygIR5eBEoIEBtbDfiUv\r\n" \
172  "svlEH6+f+71wabu0ePkMTdEf8pl36YEspFq+0Iz+o53EiqGHb+kLTDc81CAQVBl2\r\n" \
173  "xaKQgDorawKBgQDlYLCZ2QPGL8FKQbZXjmqLfyynLRWnZ8GdWG2OkdrcSTUoJK1A\r\n" \
174  "v2FHOqyra9XQE4iw5+eEmLFdiZEaDzCDPJ6e1Dk/L9ehBWESXiikIMGt3IpAOmjz\r\n" \
175  "w6fygnvkJ9Oi5+DGNvi7UMgUUAE48PnIyfGysRICGqxyYbIRwN/5BIuHdwKBgCcI\r\n" \
176  "3/BzzP00Z95lfuY8mFhOVXe//0KQbCPoAgy19dHLvqZUNIhSN6yuCpWVeggioQVW\r\n" \
177  "9hbkk+sPMmwawb3x7O5evVExVGjCALExkrqkHlY+xmkLV2b1QE725V2em+TBu7Se\r\n" \
178  "X+7L9mVqM0lQN6zF2+19ImvP50pldgYzUnIltcWvAoGAcolYRYjTo3gjxwD9xhAq\r\n" \
179  "TLmCEugNmiYkCHgdOWmkHk+5AOJkctkwCGGu9+Bz1yJ46Afvv6uRO540QJKdaHBS\r\n" \
180  "np2l72ukSASAVaM1S+HyPrz9s1bCTIpB82kHKHuxx4SSSrLuxUkRLz7rZkRvsEai\r\n" \
181  "mKmY/gyPLJZRq4Lr1lOwoCM=\r\n" \
182  "-----END PRIVATE KEY-----\r\n";
183 #endif
184 
185 #endif /* __PARAMETERS_H__ */
iot_sample_common.h