Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / include / platform / CHIPDeviceConfig.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2019-2020 Google LLC.
5  *    Copyright (c) 2018 Nest Labs, Inc.
6  *
7  *    Licensed under the Apache License, Version 2.0 (the "License");
8  *    you may not use this file except in compliance with the License.
9  *    You may obtain a copy of the License at
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *    Unless required by applicable law or agreed to in writing, software
14  *    distributed under the License is distributed on an "AS IS" BASIS,
15  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *    See the License for the specific language governing permissions and
17  *    limitations under the License.
18  */
19
20 /**
21  *    @file
22  *          Defines compile-time configuration values for the chip Device Layer.
23  */
24
25 #pragma once
26
27 #if CHIP_HAVE_CONFIG_H
28 #include <platform/CHIPDeviceBuildConfig.h>
29 #endif
30
31 #include <core/CHIPConfig.h>
32
33 /* Include a project-specific configuration file, if defined.
34  *
35  * An application or module that incorporates the chip Device Layer can define a project
36  * configuration file to override standard chip configuration with application-specific
37  * values.  The project config file is typically located outside the Openchip source
38  * tree, alongside the source code for the application.
39  */
40 #ifdef CHIP_DEVICE_PROJECT_CONFIG_INCLUDE
41 #include CHIP_DEVICE_PROJECT_CONFIG_INCLUDE
42 #endif
43
44 /* Include a platform-specific configuration file, if defined.
45  *
46  * A platform configuration file contains overrides to standard chip Device Layer
47  * configuration that are specific to the platform or OS on which chip is running.
48  * It is typically provided as apart of an adaptation layer that adapts Openchip
49  * to the target environment.  This adaptation layer may be included in the Openchip
50  * source tree itself or implemented externally.
51  */
52 #ifdef CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE
53 #include CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE
54 #endif
55
56 // -------------------- General Configuration --------------------
57
58 /**
59  * CHIP_DEVICE_CONFIG_CHIP_TASK_NAME
60  *
61  * The name of the chip task.
62  */
63 #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_NAME
64 #define CHIP_DEVICE_CONFIG_CHIP_TASK_NAME "CHIP"
65 #endif
66
67 /**
68  * CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
69  *
70  * The size (in bytes) of the chip task stack.
71  */
72 #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
73 #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 4096
74 #endif
75
76 /**
77  * CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
78  *
79  * The priority of the chip task.
80  */
81 #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
82 #define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 1
83 #endif
84
85 /**
86  * CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE
87  *
88  * The maximum number of events that can be held in the chip Platform event queue.
89  */
90 #ifndef CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE
91 #define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 100
92 #endif
93
94 /**
95  * CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING
96  *
97  * Enable the device factory provisioning feature.
98  *
99  * The factory provisioning feature allows factory or developer-supplied provisioning information
100  * to be injected into a device at boot time and automatically stored in persistent storage.
101  */
102 #ifndef CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING
103 // We don't have platform/internal/FactoryProvisioning.ipp for now, so set it to 0 by default.
104 #define CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING 0
105 #endif
106
107 /**
108  * CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH
109  *
110  * Compute and log a hash of the device's provisioning data on boot.
111  *
112  * The generated hash value confirms to the form described in the CHIP: Factory
113  * Provisioning Specification.
114  */
115 #ifndef CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH
116 #define CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH 1
117 #endif
118
119 // -------------------- Device Identification Configuration --------------------
120
121 /**
122  * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
123  *
124  * The CHIP-assigned vendor id for the organization responsible for producing the device.
125  */
126 #ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
127 #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 9050
128 #endif
129
130 /**
131  * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
132  *
133  * Enables the use of a hard-coded default serial number if none
134  * is found in Chip NV storage.
135  */
136 #ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
137 #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
138 #endif
139
140 /**
141  * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
142  *
143  * The unique id assigned by the device vendor to identify the product or device type.  This
144  * number is scoped to the device vendor id.
145  */
146 #ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
147 #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 65279
148 #endif
149
150 /**
151  * CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION
152  *
153  * The default product revision number assigned to the device or product by the device vendor.
154  *
155  * Product revisions are specific to a particular device vendor and product id, and typically
156  * correspond to a revision of the physical device, a change to its packaging, and/or a change
157  * to its marketing presentation. This value is generally *not* incremented for device software
158  * revisions.
159  *
160  * This is a default value which is used when a product revision has not been stored in device
161  * persistent storage (e.g. by a factory provisioning process).
162  */
163 #ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION
164 #define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION 1
165 #endif
166
167 /**
168  * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION
169  *
170  * A string identifying the firmware revision running on the device.
171  */
172 #ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION
173 #define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION "prerelease"
174 #endif
175
176 /**
177  * CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
178  *
179  * The default amount of time (in whole seconds) that the device will remain in "user selected"
180  * mode.  User selected mode is typically initiated by a button press, or other direct interaction
181  * by a user.  While in user selected mode, the device will respond to Device Identify Requests
182  * that have the UserSelectedMode flag set.
183  */
184 #ifndef CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
185 #define CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC 30
186 #endif // CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
187
188 // -------------------- WiFi Station Configuration --------------------
189
190 /**
191  * CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
192  *
193  * Enable support for a WiFi station interface.
194  */
195 #ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
196 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1
197 #endif
198
199 /**
200  * CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL
201  *
202  * The interval at which the chip platform will attempt to reconnect to the configured WiFi
203  * network (in milliseconds).
204  */
205 #ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL
206 #define CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL 5000
207 #endif
208
209 /**
210  * CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS
211  *
212  * The maximum number of networks to return as a result of a NetworkProvisioning:ScanNetworks request.
213  */
214 #ifndef CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS
215 #define CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS 10
216 #endif
217
218 /**
219  * CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT
220  *
221  * The amount of time (in milliseconds) after which the chip platform will timeout a WiFi scan
222  * operation that hasn't completed.  A value of 0 will disable the timeout logic.
223  */
224 #ifndef CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT
225 #define CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT 10000
226 #endif
227
228 /**
229  * CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT
230  *
231  * The amount of time (in milliseconds) to wait for Internet connectivity to be established on
232  * the device's WiFi station interface during a Network Provisioning TestConnectivity operation.
233  */
234 #ifndef CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT
235 #define CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT 30000
236 #endif
237
238 /**
239  * CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME
240  *
241  * Name of the WiFi station interface on LwIP-based platforms.
242  */
243 #ifndef CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME
244 #define CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME "wl"
245 #endif
246
247 /**
248  * CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME
249  *
250  * Name of the WiFi station interface
251  */
252 #ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME
253 #define CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME "wlan0"
254 #endif
255
256 // -------------------- WiFi AP Configuration --------------------
257
258 /**
259  * CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
260  *
261  * Enable support for a WiFi AP interface.
262  */
263 #ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
264 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 1
265 #endif
266
267 /**
268  * CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX
269  *
270  * A prefix string used in forming the WiFi soft-AP SSID.  The remainder of the SSID
271  * consists of the final two bytes of the device's primary WiFi MAC address in hex.
272  */
273 #ifndef CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX
274 #define CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX "CHIP-"
275 #endif
276
277 /**
278  * CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL
279  *
280  * The WiFi channel number to be used by the soft-AP.
281  */
282 #ifndef CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL
283 #define CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL 1
284 #endif
285
286 /**
287  * CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS
288  *
289  * The maximum number of stations allowed to connect to the soft-AP.
290  */
291 #ifndef CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS
292 #define CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS 4
293 #endif
294
295 /**
296  * CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL
297  *
298  * The beacon interval (in milliseconds) for the WiFi soft-AP.
299  */
300 #ifndef CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL
301 #define CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL 100
302 #endif
303
304 /**
305  * CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT
306  *
307  * The amount of time (in milliseconds) after which the chip platform will deactivate the soft-AP
308  * if it has been idle.
309  */
310 #ifndef CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT
311 #define CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT 120000
312 #endif
313
314 /**
315  * CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME
316  *
317  * Name of the WiFi AP interface on LwIP-based platforms.
318  */
319 #ifndef CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME
320 #define CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME "ap"
321 #endif
322
323 // -------------------- BLE/CHIPoBLE Configuration --------------------
324
325 /**
326  * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
327  *
328  * Enable support for chip-over-BLE (CHIPoBLE).
329  */
330 #ifndef CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
331 #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0
332 #endif
333
334 /**
335  * CHIP_DEVICE_CONFIG_SINGLE_CHIPOBLE_CONNECTION
336  *
337  * Limit support for chip-over-BLE (CHIPoBLE) to a single connection.
338  * When set, CHIPoBLE advertisements will stop while a CHIPoBLE connection is active.
339  */
340 #ifndef CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION
341 #define CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION 1
342 #endif
343
344 /**
345  * CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
346  *
347  * Automatically disable CHIPoBLE advertising when the device transitions to a fully
348  * provisioned state.
349  */
350 #ifndef CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED
351 #define CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED 0
352 #endif
353
354 /**
355  * CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART
356  *
357  * Enable CHIPoBLE advertising start automatically after device power-up.
358  *
359  * CHIP's device may start advertising automatically only if its all primary device
360  * functions are within a CHIP network. Device providing unrelated to CHIP functionalities
361  * should not start advertising automatically after power-up.
362  *
363  * TODO: Default value should be changed to 0, after all platforms will implement enabling
364  *       advertisement in their own way.
365  */
366 #ifndef CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART
367 #define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART 1
368 #endif
369
370 /**
371  * CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART
372  *
373  * Enable opening pairing window automatically after device power-up.
374  *
375  */
376 #ifndef CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART
377 #define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 1
378 #endif
379
380 /**
381  * CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX
382  *
383  * A prefix string used in forming the BLE device name.  The remainder of the name
384  * consists of the final two bytes of the device's chip node id in hex.
385  *
386  * NOTE: The device layer limits the total length of a device name to 16 characters.
387  * However, due to other data sent in CHIPoBLE advertise packets, the device name
388  * may need to be shorter.
389  */
390 #ifndef CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX
391 #define CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX "CHIP-"
392 #endif
393
394 /**
395  * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN
396  *
397  * The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
398  * in fast advertising mode. The minimum interval should be less and not equal to the
399  * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX.
400  *
401  * Defaults to 32 (20 ms).
402  */
403 #ifndef CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN
404 #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN 32
405 #endif
406
407 /**
408  * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX
409  *
410  * The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
411  * in fast advertising mode. The maximum interval should be greater and not equal to the
412  * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN.
413  *
414  * Defaults to 96 (60 ms).
415  */
416 #ifndef CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX
417 #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX 96
418 #endif
419
420 /**
421  * CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN
422  *
423  * The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
424  * in slow advertising mode. The minimum interval should be greater and not equal to the
425  * CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX.
426  *
427  * Defaults to 240 (150 ms).
428  */
429 #ifndef CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN
430 #define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN 240
431 #endif
432
433 /**
434  * CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX
435  *
436  * The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
437  * in slow advertising mode. The maximum interval should be greater and not equal to the
438  * CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN.
439  *
440  * Defaults to 1920 (1200 ms).
441  */
442 #ifndef CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX
443 #define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX 1920
444 #endif
445
446 /**
447  * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME
448  *
449  * The amount of time in miliseconds after which BLE advertisement should be switched from the fast
450  * advertising to the slow advertising, counting from the moment of advertisement commencement.
451  *
452  * Defaults to 30000 (30 seconds).
453  */
454 #ifndef CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME
455 #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME 30000
456 #endif
457
458 /**
459  * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT
460  *
461  * The amount of time in miliseconds after which BLE advertisement should be disabled, counting
462  * from the moment of advertisement commencement.
463  *
464  * Defaults to 9000000 (15 minutes).
465  */
466 #ifndef CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT
467 #define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_TIMEOUT (15 * 60 * 1000)
468 #endif
469
470 // -------------------- Time Sync Configuration --------------------
471
472 /**
473  * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC
474  *
475  * Enables synchronizing the device's real time clock with a remote chip Time service
476  * using the chip Time Sync protocol.
477  */
478 #ifndef CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC
479 #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0
480 #endif
481
482 /**
483  * CHIP_DEVICE_CONFIG_CHIP_TIME_SERVICE_ENDPOINT_ID
484  *
485  * Specifies the service endpoint id of the chip Time Sync service to be used to synchronize time.
486  *
487  * This value is only meaningful if CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC has
488  * been enabled.
489  */
490 #ifndef CHIP_DEVICE_CONFIG_CHIP_TIME_SERVICE_ENDPOINT_ID
491 #define CHIP_DEVICE_CONFIG_CHIP_TIME_SERVICE_ENDPOINT_ID 0x18B4300200000005ULL
492 #endif
493
494 /**
495  * CHIP_DEVICE_CONFIG_DEFAULT_TIME_SYNC_INTERVAL
496  *
497  * Specifies the minimum interval (in seconds) at which the device should synchronize its real time
498  * clock with the configured chip Time Sync server.
499  *
500  * This value is only meaningful if CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC has
501  * been enabled.
502  */
503 #ifndef CHIP_DEVICE_CONFIG_DEFAULT_TIME_SYNC_INTERVAL
504 #define CHIP_DEVICE_CONFIG_DEFAULT_TIME_SYNC_INTERVAL 180
505 #endif
506
507 /**
508  * CHIP_DEVICE_CONFIG_TIME_SYNC_TIMEOUT
509  *
510  * Specifies the maximum amount of time (in milliseconds) to wait for a response from a
511  * chip Time Sync server.
512  *
513  * This value is only meaningful if CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC has
514  * been enabled.
515  */
516 #ifndef CHIP_DEVICE_CONFIG_TIME_SYNC_TIMEOUT
517 #define CHIP_DEVICE_CONFIG_TIME_SYNC_TIMEOUT 10000
518 #endif
519
520 // -------------------- Service Provisioning Configuration --------------------
521
522 /**
523  * CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID
524  *
525  * Specifies the service endpoint id of the chip Service Provisioning service.  When a device
526  * undergoes service provisioning, this is the endpoint to which it will send its Pair Device
527  * to Account request.
528  */
529 #ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID
530 #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID 0x18B4300200000010ULL
531 #endif
532
533 /**
534  * CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT
535  *
536  * The maximum amount of time (in milliseconds) to wait for service connectivity during the device
537  * service provisioning step.  More specifically, this is the maximum amount of time the device will
538  * wait for connectivity to be established with the service at the point where the device waiting
539  * to send a Pair Device to Account request to the Service Provisioning service.
540  */
541 #ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT
542 #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT 10000
543 #endif
544
545 /**
546  * CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT
547  *
548  * Specifies the maximum amount of time (in milliseconds) to wait for a response from the Service
549  * Provisioning service.
550  */
551 #ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT
552 #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT 10000
553 #endif
554
555 // -------------------- Just-In-Time Provisioning Configuration --------------------
556
557 /**
558  * CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING
559  *
560  * Enable just-in-time provisioning functionality in the chip Device Layer.
561  *
562  * When enabled, device creates and uses its ephemeral operational credentials:
563  *   - operational device id
564  *   - operational device self-signed certificate
565  *   - operational device private key
566  * When enabled, device also implements certificate provisioning protocol and uses it to obtain
567  * service assigned certificate from the Certification Authority Service.
568  *
569  * Then, device uses these credentials to authenticate and communicate to other chip nodes.
570  */
571 #ifndef CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING
572 #define CHIP_DEVICE_CONFIG_ENABLE_JUST_IN_TIME_PROVISIONING 0
573 #endif
574
575 // -------------------- Service Discovery Configuration -----------------------
576
577 /**
578  * CHIP_DEVICE_CONFIG_ENABLE_MDNS
579  *
580  * Enable support to use MDNS for service advertising and discovery in CHIP.
581  */
582 #ifndef CHIP_DEVICE_CONFIG_ENABLE_MDNS
583 #define CHIP_DEVICE_CONFIG_ENABLE_MDNS 0
584 #endif
585
586 /**
587  * CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
588  *
589  * Enable support to DNS-SD SRP client usage for service advertising and discovery in CHIP.
590  */
591 #ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
592 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 0
593 #endif
594
595 // -------------------- Thread Configuration --------------------
596
597 /**
598  * CHIP_DEVICE_CONFIG_ENABLE_THREAD
599  *
600  * Enable support for Thread in the chip Device Layer.
601  */
602 #ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD
603 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0
604 #endif
605
606 /**
607  * CHIP_DEVICE_CONFIG_THREAD_FTD
608  *
609  * Enable Full Thread Device features
610  */
611 #ifndef CHIP_DEVICE_CONFIG_THREAD_FTD
612 #define CHIP_DEVICE_CONFIG_THREAD_FTD 1
613 #endif
614
615 /**
616  * CHIP_DEVICE_CONFIG_THREAD_TASK_NAME
617  *
618  * The name of the Thread task.
619  */
620 #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_NAME
621 #define CHIP_DEVICE_CONFIG_THREAD_TASK_NAME "THREAD"
622 #endif
623
624 /**
625  * CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
626  *
627  * The size (in bytes) of the OpenThread task stack.
628  */
629 #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
630 #define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE 8192
631 #endif
632
633 /**
634  * CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY
635  *
636  * The priority of the OpenThread task.
637  */
638 #ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY
639 #define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 2
640 #endif
641
642 /**
643  * CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME
644  *
645  * Name of the Thread interface on LwIP-based platforms.
646  */
647 #ifndef CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME
648 #define CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME "th"
649 #endif
650
651 /**
652  * CHIP_DEVICE_CONFIG_THREAD_IF_MTU
653  *
654  * Default MTU for Thread interface
655  */
656 #ifndef CHIP_DEVICE_CONFIG_THREAD_IF_MTU
657 #define CHIP_DEVICE_CONFIG_THREAD_IF_MTU 1280
658 #endif
659
660 /**
661  * CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX
662  *
663  * A prefix string to be used when forming a default Thread network name.
664  */
665 #ifndef CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX
666 #define CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX "CHIP-PAN-"
667 #endif
668
669 /**
670  * CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT
671  *
672  * The amount of time (in milliseconds) to wait for connectivity with a Thread mesh
673  * to be established on during a Network Provisioning TestConnectivity operation.
674  */
675 #ifndef CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT
676 #define CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT 30000
677 #endif
678
679 // -------------------- Trait Manager Configuration --------------------
680
681 /**
682  * CHIP_DEVICE_CONFIG_ENABLE_TRAIT_MANAGER
683  *
684  * Enable or disable the chip Trait Manager.
685  *
686  * NOTE: The Trait Manager is an experimental feature of the chip Device Layer.
687  */
688 #ifndef CHIP_DEVICE_CONFIG_ENABLE_TRAIT_MANAGER
689 #define CHIP_DEVICE_CONFIG_ENABLE_TRAIT_MANAGER 0
690 #endif
691
692 // -------------------- Test Configuration --------------------
693
694 /**
695  * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY
696  *
697  * Enables the use of a hard-coded default chip device id and credentials if no device id
698  * is found in chip NV storage.  The value specifies which of 10 identities, numbered 1 through 10,
699  * is to be used.  A value of 0 disables use of a default identity.
700  *
701  * This option is for testing only and should be disabled in production releases.
702  */
703 #ifndef CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY
704 #define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 0
705 #endif
706
707 // -------------------- Network Telemetry Configuration --------------------
708
709 /**
710  * @def CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY
711  *
712  * @brief
713  *   Enable automatically uploading Wi-Fi telemetry via trait on an interval.
714  */
715 #ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY
716 #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY (0)
717 #endif
718
719 /**
720  * @def CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY
721  *
722  * @brief
723  *   Enable automatically uploading minimal Thread telemetry and topology via trait on an interval.
724  */
725 #ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY
726 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY (0)
727 #endif
728
729 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY && !CHIP_DEVICE_CONFIG_ENABLE_THREAD
730 #error "If CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY set, then CHIP_DEVICE_CONFIG_ENABLE_THREAD must also be set."
731 #endif
732
733 /**
734  * @def CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL
735  *
736  * @brief
737  *   Enable automatically uploading all Thread telemetry and topology via trait on an interval.
738  *   This is suitable for products that have router capability.
739  *
740  * @note
741  *   If set, CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY must also be set.
742  */
743 #ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL
744 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL (0)
745 #endif
746
747 #if CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL && !CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY
748 #error "If CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL set, then CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY must also be set."
749 #endif
750
751 // Enable Network Telemetry feature if it is enabled for at lease one network.
752 #define CHIP_DEVICE_CONFIG_ENABLE_NETWORK_TELEMETRY                                                                                \
753     (CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY || CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY)
754
755 /**
756  *  @def CHIP_DEVICE_CONFIG_DEFAULT_TELEMETRY_INTERVAL_MS
757  *
758  *  @brief
759  *    This sets the default interval at which network telemetry events
760  *    will be logged to chip buffers. This can be overwritten at runtime
761  *    with a trait.
762  *
763  */
764 #ifndef CHIP_DEVICE_CONFIG_DEFAULT_TELEMETRY_INTERVAL_MS
765 #define CHIP_DEVICE_CONFIG_DEFAULT_TELEMETRY_INTERVAL_MS 90000
766 #endif
767
768 // -------------------- Event Logging Configuration --------------------
769
770 /**
771  * @def CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE
772  *
773  * @brief
774  *   A size, in bytes, of the individual critical event logging buffer.
775  *   Note: the critical event buffer must exist.
776  */
777 #ifndef CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE
778 #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE (1024)
779 #endif
780
781 #if (CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE <= 0)
782 #error "The Prod critical event buffer must exist (CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE > 0)"
783 #endif
784
785 /**
786  * @def CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE
787  *
788  * @brief
789  *   A size, in bytes, of the individual production event logging buffer.
790  *   Note: the production event buffer must exist.
791  */
792 #ifndef CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE
793 #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE (512)
794 #endif
795
796 #if (CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE <= 0)
797 #error "The Prod event buffer must exist (CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE > 0)"
798 #endif
799
800 /**
801  * @def CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE
802  *
803  * @brief
804  *   A size, in bytes, of the individual info event logging buffer.
805  *   Note: set to 0 to disable info event buffer and all support
806  *   for the info level events.
807  */
808 #ifndef CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE
809 #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE (512)
810 #endif
811
812 /**
813  * @def CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
814  *
815  * @brief
816  *   A size, in bytes, of the individual debug event logging buffer.
817  *   Note: set to 0 to disable debug event buffer and all support
818  *   for the debug level events.
819  */
820 #ifndef CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
821 #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (256)
822 #endif
823
824 /**
825  *  @def CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH
826  *
827  *  @brief
828  *    The event id counter persisted storage epoch.
829  */
830 #ifndef CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH
831 #define CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH (0x10000)
832 #endif
833
834 /**
835  *  @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY
836  *
837  *  @brief
838  *    The critical event id counter (eidc) persisted storage key.
839  */
840 #ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY
841 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY "crit-eidc"
842 #endif
843
844 /**
845  *  @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_PROD_EIDC_KEY
846  *
847  *  @brief
848  *    The production event id counter (eidc) persisted storage key.
849  */
850 #ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_PROD_EIDC_KEY
851 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_PROD_EIDC_KEY "prod-eidc"
852 #endif
853
854 /**
855  *  @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY
856  *
857  *  @brief
858  *    The info event id counter (eidc) persisted storage key.
859  */
860 #ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY
861 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY "info-eidc"
862 #endif
863
864 /**
865  *  @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY
866  *
867  *  @brief
868  *    The debug event id counter (eidc) persisted storage key.
869  */
870 #ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY
871 #define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY "debug-eidc"
872 #endif
873
874 // -------------------- Software Update Manager Configuration --------------------
875
876 /**
877  * CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER
878  *
879  * Enable or disable the chip Software Update Manager.
880  *
881  */
882 #ifndef CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER
883 #define CHIP_DEVICE_CONFIG_ENABLE_SOFTWARE_UPDATE_MANAGER 1
884 #endif
885
886 /**
887  * CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_URI_LEN
888  *
889  * Specifies the size in bytes of the buffer that stores the
890  * URI
891  *
892  */
893 #ifndef CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_URI_LEN
894 #define CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_URI_LEN 128
895 #endif
896
897 /**
898  * CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_ENDPOINT_ID
899  *
900  * Specifies the service endpoint id of the chip Software Update service.  When a device
901  * attempts software update, this is the endpoint to which it will send its Software Update
902  * Query request.
903  */
904 #ifndef CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_ENDPOINT_ID
905 #define CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_ENDPOINT_ID 0x18B4300200000002ULL
906 #endif
907
908 /**
909  * CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_ENDPOINT_ID
910  *
911  * Specifies the service endpoint id of the chip File Download service.  When a device
912  * attempts file download over BDX, this is the endpoint to which it will send its BDX request.
913  */
914 #ifndef CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_ENDPOINT_ID
915 #define CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_ENDPOINT_ID 0x18B4300200000013ULL
916 #endif
917
918 /**
919  * CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_RESPONSE_TIMEOUT
920  *
921  * Specifies the maximum amount of time (in milliseconds) to wait for a response from a
922  * chip Software Update service.
923  *
924  */
925 #ifndef CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_RESPONSE_TIMEOUT
926 #define CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_RESPONSE_TIMEOUT 10000
927 #endif
928
929 /**
930  * CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_RESPONSE_TIMEOUT
931  *
932  * Specifies the maximum amount of time (in milliseconds) to wait for a response from a
933  * chip File Download service.
934  *
935  */
936 #ifndef CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_RESPONSE_TIMEOUT
937 #define CHIP_DEVICE_CONFIG_FILE_DOWNLOAD_RESPONSE_TIMEOUT 10000
938 #endif
939
940 /**
941  * CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_RETRIES
942  *
943  * Specifies the maximum number of times a failed software is retried.
944  *
945  */
946 #ifndef CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_RETRIES
947 #define CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_RETRIES 5
948 #endif
949
950 /**
951  * CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_WAIT_TIME_INTERVAL_MS
952  *
953  * If scheduled software update check is disabled & default retry policy is used,
954  * specify the max wait time interval to be used (in milliseconds)
955  */
956 #ifndef CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_WAIT_TIME_INTERVAL_MS
957 #define CHIP_DEVICE_CONFIG_SOFTWARE_UPDATE_MAX_WAIT_TIME_INTERVAL_MS 1 * 60 * 60 * 1000 // 1 hour
958 #endif
959
960 /**
961  *  @def CHIP_DEVICE_CONFIG_SWU_MIN_WAIT_TIME_INTERVAL_PERCENT_PER_STEP
962  *
963  *  @brief
964  *    If default software update retry policy is used,
965  *    specify the minimum wait
966  *    time as a percentage of the max wait interval for that step.
967  *
968  */
969 #ifndef CHIP_DEVICE_CONFIG_SWU_MIN_WAIT_TIME_INTERVAL_PERCENT_PER_STEP
970 #define CHIP_DEVICE_CONFIG_SWU_MIN_WAIT_TIME_INTERVAL_PERCENT_PER_STEP 50
971 #endif
972
973 /**
974  *  @def CHIP_DEVICE_CONFIG_SWU_WAIT_TIME_MULTIPLIER_MS
975  *
976  *  @brief
977  *    If default software update retry policy is used,
978  *    specify the multiplier that multiplies the result of a Fibonacci computation
979  *    based on a specific index to provide a max wait time for
980  *    a step.
981  *
982  */
983 #ifndef CHIP_DEVICE_CONFIG_SWU_WAIT_TIME_MULTIPLIER_MS
984 #define CHIP_DEVICE_CONFIG_SWU_WAIT_TIME_MULTIPLIER_MS 1 * 60 * 1000 // 1 minute
985 #endif
986
987 /**
988  * CHIP_DEVICE_CONFIG_SWU_BDX_BLOCK_SIZE
989  *
990  * Specifies the block size to be used during software download over BDX.
991  */
992 #define CHIP_DEVICE_CONFIG_SWU_BDX_BLOCK_SIZE 1024
993
994 /**
995  * CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE
996  *
997  * Specifies the date of the build. Useful for deterministic builds.
998  */
999 #ifndef CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE
1000 #define CHIP_DEVICE_CONFIG_FIRWMARE_BUILD_DATE __DATE__
1001 #endif
1002
1003 /**
1004  * CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME
1005  *
1006  * Specifies the time of the build. Useful for deterministic builds.
1007  */
1008 #ifndef CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME
1009 #define CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME __TIME__
1010 #endif