-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathCHIPDeviceConfig.h
1429 lines (1273 loc) · 44.2 KB
/
CHIPDeviceConfig.h
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2019-2020 Google LLC.
* Copyright (c) 2018 Nest Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* Defines compile-time configuration values for the chip Device Layer.
*/
#pragma once
#if CHIP_HAVE_CONFIG_H
#include <platform/CHIPDeviceBuildConfig.h>
#endif
#include <lib/core/CHIPConfig.h>
/* Include a project-specific configuration file, if defined.
*
* An application or module that incorporates the chip Device Layer can define a project
* configuration file to override standard chip configuration with application-specific
* values. The project config file is typically located outside the Openchip source
* tree, alongside the source code for the application.
*/
#ifdef CHIP_DEVICE_PROJECT_CONFIG_INCLUDE
#include CHIP_DEVICE_PROJECT_CONFIG_INCLUDE
#endif
/* Include a platform-specific configuration file, if defined.
*
* A platform configuration file contains overrides to standard chip Device Layer
* configuration that are specific to the platform or OS on which chip is running.
* It is typically provided as apart of an adaptation layer that adapts Openchip
* to the target environment. This adaptation layer may be included in the Openchip
* source tree itself or implemented externally.
*/
#ifdef CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE
#include CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE
#endif
// -------------------- General Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_CHIP_TASK_NAME
*
* The name of the chip task.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_NAME
#define CHIP_DEVICE_CONFIG_CHIP_TASK_NAME "CHIP"
#endif
/**
* CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
*
* The size (in bytes) of the chip task stack.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE
#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 4096
#endif
/**
* CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
*
* The priority of the chip task.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 2
#endif
/**
* CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE
*
* The maximum number of events that can be held in the chip Platform event queue.
*/
#ifndef CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE
#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 100
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
*
* Enable support for background event processing.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING
#define CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING 0
#endif
/**
* CHIP_DEVICE_CONFIG_BG_TASK_NAME
*
* The name of the background task.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_NAME
#define CHIP_DEVICE_CONFIG_BG_TASK_NAME "BG"
#endif
/**
* CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE
*
* The size (in bytes) of the background task stack.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE
#define CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE (6 * 1024)
#endif
/**
* CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY
*
* The priority of the background task.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY 1
#endif
/**
* CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE
*
* The maximum number of events that can be held in the chip background event queue.
*/
#ifndef CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE
#define CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE 1
#endif
/**
* CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL
*
* The default amount of time in milliseconds that the sleepy end device will use as an idle interval.
* This interval is used by the device to periodically wake up and poll the data in the idle mode.
*/
#ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL System::Clock::Milliseconds32(5000)
#endif
/**
* CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
*
* The default amount of time in milliseconds that the sleepy end device will use as an active interval.
* This interval is used by the device to periodically wake up and poll the data in the active mode.
*/
#ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL System::Clock::Milliseconds32(200)
#endif
/**
* CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD
*
* Minimum amount the node SHOULD stay awake after network activity.
* Spec section 2.12.5
*/
#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD
#define CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD System::Clock::Milliseconds32(4000)
#endif
// -------------------- Device Identification Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME
*
* Human readable vendor name for the organization responsible for producing the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME "TEST_VENDOR"
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
* The CHIP-assigned vendor id for the organization responsible for producing the device.
*
* Default is the Test VendorID of 0xFFF1.
*
* Un-overridden default must match the default test DAC
* (see src/credentials/examples/DeviceAttestationCredsExample.cpp).
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME
*
* Human readable name of the device model.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME "TEST_PRODUCT"
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
*
* The unique id assigned by the device vendor to identify the product or device type. This
* number is scoped to the device vendor id.
*
* Un-overridden default must either match one of the given development certs
* or have a DeviceAttestationCredentialsProvider implemented.
* (see src/credentials/examples/DeviceAttestationCredsExample.cpp)
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8001
#endif
/**
* CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING
*
* Human readable string identifying version of the product assigned by the device vendor.
*/
#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "TEST_VERSION"
#endif
/**
* CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION
*
* The default hardware version number assigned to the device or product by the device vendor.
*
* Hardware versions are specific to a particular device vendor and product id, and typically
* correspond to a revision of the physical device, a change to its packaging, and/or a change
* to its marketing presentation. This value is generally *not* incremented for device software
* revisions.
*
* This is a default value which is used when a hardware version has not been stored in device
* persistent storage (e.g. by a factory provisioning process).
*/
#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 0
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0"
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*
* A monothonic number identifying the software version running on the device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1
#endif
/**
* CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
*
* Enables the use of a hard-coded default serial number if none
* is found in Chip NV storage.
*/
#ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
#endif
/**
* CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC
*
* The default conservative initial duration (in seconds) to set in the FailSafe for the commissioning
* flow to complete successfully. This may vary depending on the speed or sleepiness of the Commissionee.
*/
#ifndef CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC
#define CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC 60
#endif // CHIP_DEVICE_CONFIG_FAILSAFE_EXPIRY_LENGTH_SEC
/**
* CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC
*
* The default conservative value in seconds denoting the maximum total duration for which a fail safe
* timer can be re-armed.
*/
#ifndef CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC
#define CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC 900
#endif // CHIP_DEVICE_CONFIG_MAX_CUMULATIVE_FAILSAFE_SEC
/**
* CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
*
* Whether a device supports "concurrent connection commissioning mode" (1) or
* or "non-concurrenct connection commissioning mode" (0).
*
* See section "5.5. Commissioning Flows" in spec for definition.
*
* The default value is to support concurrent connection.
*/
#ifndef CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
#define CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION 1
#endif // CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
/**
* CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
*
* The default amount of time (in whole seconds) that the device will remain in "user selected"
* mode. User selected mode is typically initiated by a button press, or other direct interaction
* by a user. While in user selected mode, the device will respond to Device Identify Requests
* that have the UserSelectedMode flag set.
*/
#ifndef CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
#define CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC 30
#endif // CHIP_DEVICE_CONFIG_USER_SELECTED_MODE_TIMEOUT_SEC
/**
* CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID
*
* Enables the use of a hard-coded default unique ID utilized for the rotating device ID calculation.
*/
#ifndef CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID
#define CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID \
{ \
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff \
}
#endif
/**
* CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH
*
* Unique ID length in bytes. The value should be 16-bytes or longer.
*/
#ifndef CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH
#define CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH 16
#endif
// -------------------- WiFi Station Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
*
* Enable support for a WiFi station interface.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION 1
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL
*
* The interval at which the chip platform will attempt to reconnect to the configured WiFi
* network (in milliseconds).
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL
#define CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL 5000
#endif
/**
* CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS
*
* The maximum number of networks to return as a result of a NetworkProvisioning:ScanNetworks request.
*/
#ifndef CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS
#define CHIP_DEVICE_CONFIG_MAX_SCAN_NETWORKS_RESULTS 10
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT
*
* The amount of time (in milliseconds) after which the chip platform will timeout a WiFi scan
* operation that hasn't completed. A value of 0 will disable the timeout logic.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT
#define CHIP_DEVICE_CONFIG_WIFI_SCAN_COMPLETION_TIMEOUT 10000
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT
*
* The amount of time (in milliseconds) to wait for Internet connectivity to be established on
* the device's WiFi station interface during a Network Provisioning TestConnectivity operation.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT
#define CHIP_DEVICE_CONFIG_WIFI_CONNECTIVITY_TIMEOUT 30000
#endif
/**
* CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME
*
* Name of the WiFi station interface on LwIP-based platforms.
*/
#ifndef CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME
#define CHIP_DEVICE_CONFIG_LWIP_WIFI_STATION_IF_NAME "wl"
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME
*
* Name of the WiFi station interface
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME
#define CHIP_DEVICE_CONFIG_WIFI_STATION_IF_NAME "wlan0"
#endif
// -------------------- WiFi AP Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
*
* Enable support for a WiFi AP interface.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX
*
* A prefix string used in forming the WiFi soft-AP SSID. The remainder of the SSID
* consists of the final two bytes of the device's primary WiFi MAC address in hex.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX
#define CHIP_DEVICE_CONFIG_WIFI_AP_SSID_PREFIX "MATTER-"
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL
*
* The WiFi channel number to be used by the soft-AP.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL
#define CHIP_DEVICE_CONFIG_WIFI_AP_CHANNEL 1
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS
*
* The maximum number of stations allowed to connect to the soft-AP.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS
#define CHIP_DEVICE_CONFIG_WIFI_AP_MAX_STATIONS 4
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL
*
* The beacon interval (in milliseconds) for the WiFi soft-AP.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL
#define CHIP_DEVICE_CONFIG_WIFI_AP_BEACON_INTERVAL 100
#endif
/**
* CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT
*
* The amount of time (in milliseconds) after which the chip platform will deactivate the soft-AP
* if it has been idle.
*/
#ifndef CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT
#define CHIP_DEVICE_CONFIG_WIFI_AP_IDLE_TIMEOUT 120000
#endif
/**
* CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME
*
* Name of the WiFi AP interface on LwIP-based platforms.
*/
#ifndef CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME
#define CHIP_DEVICE_CONFIG_LWIP_WIFI_AP_IF_NAME "ap"
#endif
// -------------------- BLE/CHIPoBLE Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
*
* Enable support for chip-over-BLE (CHIPoBLE).
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0
#endif
/**
* CHIP_DEVICE_CONFIG_SINGLE_CHIPOBLE_CONNECTION
*
* Limit support for chip-over-BLE (CHIPoBLE) to a single connection.
* When set, CHIPoBLE advertisements will stop while a CHIPoBLE connection is active.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION
#define CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION 1
#endif
/**
* CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART
*
* Enable CHIPoBLE advertising start automatically after device power-up.
*
* CHIP's device may start advertising automatically only if its all primary device
* functions are within a CHIP network. Device providing unrelated to CHIP functionalities
* should not start advertising automatically after power-up.
*
* TODO: Default value should be changed to 0, after all platforms will implement enabling
* advertisement in their own way.
*/
#ifndef CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART
#define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART 1
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART
*
* Enable opening pairing window automatically after device power-up.
*
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART
#define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 1
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX
*
* A prefix string used in forming the BLE device name. The remainder of the name
* typically contains the setup discriminator as a 4-digit decimal number.
*
* NOTE: The device layer limits the total length of a device name to 16 characters.
* However, due to other data sent in CHIPoBLE advertise packets, the device name
* may need to be shorter.
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX
#define CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX "MATTER-"
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN
*
* The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in fast advertising mode. The minimum interval should be less and not equal to the
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX.
*
* Defaults to 32 (20 ms).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN
#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN 32
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX
*
* The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in fast advertising mode. The maximum interval should be greater and not equal to the
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN.
*
* Defaults to 96 (60 ms).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX
#define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX 96
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN
*
* The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in slow advertising mode. The minimum interval should be greater and not equal to the
* CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX.
*
* Defaults to 240 (150 ms).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN
#define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN 240
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX
*
* The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while
* in slow advertising mode. The maximum interval should be greater and not equal to the
* CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN.
*
* Defaults to 1920 (1200 ms).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX
#define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX 1920
#endif
/**
* CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME
*
* The amount of time in miliseconds after which BLE advertisement should be switched from the fast
* advertising to the slow advertising, counting from the moment of advertisement commencement.
*
* Defaults to 30000 (30 seconds).
*/
#ifndef CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME
#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME 30000
#endif
// -------------------- Service Provisioning Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID
*
* Specifies the service endpoint id of the chip Service Provisioning service. When a device
* undergoes service provisioning, this is the endpoint to which it will send its Pair Device
* to Account request.
*/
#ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID 0x18B4300200000010ULL
#endif
/**
* CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT
*
* The maximum amount of time (in milliseconds) to wait for service connectivity during the device
* service provisioning step. More specifically, this is the maximum amount of time the device will
* wait for connectivity to be established with the service at the point where the device waiting
* to send a Pair Device to Account request to the Service Provisioning service.
*/
#ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT 10000
#endif
/**
* CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT
*
* Specifies the maximum amount of time (in milliseconds) to wait for a response from the Service
* Provisioning service.
*/
#ifndef CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT 10000
#endif
// -------------------- Device DNS-SD Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS
*
* Time in seconds that a factory new device will advertise commissionable node discovery.
*/
#ifndef CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS
#define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (15 * 60)
#endif
/**
* CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES
*
* Maximum number of CHIP Commissioners or Commissionable Nodes that can be discovered
*/
#ifndef CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES
#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES 10
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
*
* Enable or disable whether this device advertises as a commissioner.
*
* Depends upon CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE set to 1
*
* For Video Players, this value will be 1
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
*
* Enable including commissioner code (CHIPDeviceController.cpp) in the commissionee (Server.cpp) code.
*
* For Video Players, this value will be 1
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
#define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE 0
#endif
/**
* CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE
*
* See issue 23625.
*
* Needs to be 1 when the following is 1:
* CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
*/
#ifndef CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE
#define CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE 0
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
*
* Enable or disable whether this device will attempt to
* discover commissioners and send Uder Directed Commissioning
* messages to them.
*
* For Video Player Clients, this value will be 1
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 0
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY
*
* Enable or disable whether this device advertises when not in commissioning mode.
*
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY
#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 0
#endif
/**
* CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS
*
* Default time in seconds that a device will advertise commissionable node discovery
* after commissioning mode ends. This value can be overridden by the user.
*
* Only valid when CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY==1
*/
#define CHIP_DEVICE_CONFIG_DISCOVERY_DISABLED 0
#define CHIP_DEVICE_CONFIG_DISCOVERY_NO_TIMEOUT -1
#ifndef CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS
#define CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS (15 * 60)
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE
*
* Enable or disable including device type in commissionable node discovery.
*
* For Video Players, this value will often be 1
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 0
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_TYPE
*
* Type of device using the CHIP Device Type Identifier.
*
* Examples:
* 0xFFFF = 65535 = Invalid Device Type
* 0x0051 = 81 = Smart Plug
* 0x0022 = 34 = Speaker
* 0x0023 = 35 = Video Player
*
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_TYPE
#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 65535 // 65535 = Invalid Device Type
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME
*
* Enable or disable including device name in commissionable node discovery.
*
* For Video Players, this value will often be 1
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME
#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 0
#endif
/**
* CHIP_DEVICE_CONFIG_DEVICE_NAME
*
* Name of device.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_NAME
#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test Kitchen"
#endif
/**
* CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT
*
* Pairing Hint, bitmap value of methods to put device into pairing mode
* when it has not yet been commissioned.
*
* Bits:
* 0 - Power Cycle
* 5 - See Device Manual
*/
#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT
#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT \
(1 << CHIP_COMMISSIONING_HINT_INDEX_POWER_CYCLE | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL)
#endif
/**
* CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION
*
* Pairing Instruction, when device has not yet been commissioned
*
* Meaning is depedent upon pairing hint value.
*/
#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION
#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION ""
#endif
/**
* CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT
*
* Pairing Hint, bitmap value of methods to put device into pairing mode
* when it has already been commissioned.
*
* Bits:
* 2 - Visit Administrator UX (always true for secondary)
* 5 - See Device Manual
*/
#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT
#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT \
(1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_ADMINISTRATOR_UX | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL)
#endif
/**
* CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION
*
* Pairing Instruction, when device has not yet been commissioned
*
* Meaning is depedent upon pairing hint value.
*/
#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION
#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION ""
#endif
// -------------------- Thread Configuration --------------------
/**
* CHIP_DEVICE_CONFIG_ENABLE_THREAD
*
* Enable support for Thread in the chip Device Layer.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_FTD
*
* Enable Full Thread Device features
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_FTD
#define CHIP_DEVICE_CONFIG_THREAD_FTD 1
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_SSED
*
* Enable support for Thread Synchronized Sleepy End Device behavior.
*
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_SSED
#define CHIP_DEVICE_CONFIG_THREAD_SSED 0
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_TASK_NAME
*
* The name of the Thread task.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_NAME
#define CHIP_DEVICE_CONFIG_THREAD_TASK_NAME "THREAD"
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
*
* The size (in bytes) of the OpenThread task stack.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE
#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE 8192
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY
*
* The priority of the OpenThread task.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY
#define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 3
#endif
/**
* CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME
*
* Name of the Thread interface on LwIP-based platforms.
*/
#ifndef CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME
#define CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME "th"
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_IF_MTU
*
* Default MTU for Thread interface
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_IF_MTU
#define CHIP_DEVICE_CONFIG_THREAD_IF_MTU 1280
#endif
/**
* CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX
*
* A prefix string to be used when forming a default Thread network name.
*/
#ifndef CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX
#define CHIP_DEVICE_CONFIG_DEFAULT_THREAD_NETWORK_NAME_PREFIX "CHIP-PAN-"
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT
*
* The amount of time (in milliseconds) to wait for connectivity with a Thread mesh
* to be established on during a Network Provisioning TestConnectivity operation.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT
#define CHIP_DEVICE_CONFIG_THREAD_CONNECTIVITY_TIMEOUT 30000
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI
*
* Enable Thread CLI interface at initialisation.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI
#define CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI 0
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
*
* Enable support to DNS-SD SRP client usage for service advertising and discovery in CHIP.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 0
#endif
/**
* CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES
*
* Amount of services available for advertising using SRP.
*/
#ifndef CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES
#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY && CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 3)
#elif CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY || CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY
#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 2)
#else
#define CHIP_DEVICE_CONFIG_THREAD_SRP_MAX_SERVICES (CHIP_CONFIG_MAX_FABRICS + 1)
#endif
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY
*
* Enable support to Commissionable Discovery for Thread devices.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 0
#endif
/**
* CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT
*
* Enable support to DNS client usage for resolving and browsing services in CHIP.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 0
#endif
// -------------------- Network Telemetry Configuration --------------------
/**
* @def CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY
*
* @brief
* Enable automatically uploading Wi-Fi telemetry via trait on an interval.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY
#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY (0)
#endif
/**
* @def CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY
*
* @brief
* Enable automatically uploading minimal Thread telemetry and topology via trait on an interval.
*/
#ifndef CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY (0)
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY && !CHIP_DEVICE_CONFIG_ENABLE_THREAD
#error "If CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY set, then CHIP_DEVICE_CONFIG_ENABLE_THREAD must also be set."
#endif
/**
* @def CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL
*
* @brief
* Enable automatically uploading all Thread telemetry and topology via trait on an interval.