blob: d06f36f9136f7e72dc2c30f2a94f6b0919666574 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025-present Eclipse ThreadX Contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
#ifndef SAMPLE_CONFIG_H
#define SAMPLE_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
/* This sample uses Symmetric key (SAS) to connect to IoT Hub by default,
simply defining USE_DEVICE_CERTIFICATE and setting your device certificate in sample_device_identity.c
to connect to IoT Hub with x509 certificate. Set up X.509 security in your Azure IoT Hub,
refer to https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-security-x509-get-started */
/* #define USE_DEVICE_CERTIFICATE 1 */
/*
TODO`s: Configure core settings of application for your IoTHub.
*/
/* Defined, DPS is enabled. */
/*
#define ENABLE_DPS_SAMPLE
*/
/* Defined, telemetry is disabled. */
/*
#define DISABLE_TELEMETRY_SAMPLE
*/
/* Defined, C2D is disabled. */
/*
#define DISABLE_C2D_SAMPLE
*/
/* Defined, Direct method is disabled. */
/*
#define DISABLE_DIRECT_METHOD_SAMPLE
*/
/* Defined, Device twin is disabled. */
/*
#define DISABLE_DEVICE_TWIN_SAMPLE
*/
/* Defined, ADU is disabled. */
/*
#define DISABLE_ADU_SAMPLE
*/
#ifndef ENABLE_DPS_SAMPLE
/* Required when DPS is not used. */
/* These values can be picked from device connection string which is of format : HostName=<host1>;DeviceId=<device1>;SharedAccessKey=<key1>
HOST_NAME can be set to <host1>,
DEVICE_ID can be set to <device1>,
DEVICE_SYMMETRIC_KEY can be set to <key1>. */
#ifndef HOST_NAME
#define HOST_NAME ""
#endif /* HOST_NAME */
#ifndef DEVICE_ID
#define DEVICE_ID ""
#endif /* DEVICE_ID */
#else /* !ENABLE_DPS_SAMPLE */
/* Required when DPS is used. */
#ifndef ENDPOINT
#define ENDPOINT "global.azure-devices-provisioning.net"
#endif /* ENDPOINT */
#ifndef ID_SCOPE
#define ID_SCOPE ""
#endif /* ID_SCOPE */
#ifndef REGISTRATION_ID
#define REGISTRATION_ID ""
#endif /* REGISTRATION_ID */
#endif /* ENABLE_DPS_SAMPLE */
/* Optional SYMMETRIC KEY. */
#ifndef DEVICE_SYMMETRIC_KEY
#define DEVICE_SYMMETRIC_KEY ""
#endif /* DEVICE_SYMMETRIC_KEY */
/* Optional module ID. */
#ifndef MODULE_ID
#define MODULE_ID ""
#endif /* MODULE_ID */
#if (USE_DEVICE_CERTIFICATE == 1)
/* Using X509 certificate authenticate to connect to IoT Hub,
set the device certificate as your device. */
/* Device Key type. */
#ifndef DEVICE_KEY_TYPE
#define DEVICE_KEY_TYPE NX_SECURE_X509_KEY_TYPE_RSA_PKCS1_DER
#endif /* DEVICE_KEY_TYPE */
#endif /* USE_DEVICE_CERTIFICATE */
/*
END TODO section
*/
/* Define the Azure RTOS IOT thread stack and priority. */
#ifndef NX_AZURE_IOT_STACK_SIZE
#define NX_AZURE_IOT_STACK_SIZE (2048)
#endif /* NX_AZURE_IOT_STACK_SIZE */
#ifndef NX_AZURE_IOT_THREAD_PRIORITY
#define NX_AZURE_IOT_THREAD_PRIORITY (4)
#endif /* NX_AZURE_IOT_THREAD_PRIORITY */
#ifndef SAMPLE_MAX_BUFFER
#define SAMPLE_MAX_BUFFER (256)
#endif /* SAMPLE_MAX_BUFFER */
/* Define the sample thread stack and priority. */
#ifndef SAMPLE_STACK_SIZE
#define SAMPLE_STACK_SIZE (2048)
#endif /* SAMPLE_STACK_SIZE */
#ifndef SAMPLE_THREAD_PRIORITY
#define SAMPLE_THREAD_PRIORITY (16)
#endif /* SAMPLE_THREAD_PRIORITY */
/* Define sample properties count. */
#define MAX_PROPERTY_COUNT 2
#ifdef __cplusplus
}
#endif
#endif /* SAMPLE_CONFIG_H */
|