CHIPProjectConfig.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. *
  3. * Copyright (c) 2020 Project CHIP Authors
  4. * Copyright (c) 2019 Google LLC.
  5. * All rights reserved.
  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. * @file
  21. * Example project configuration file for CHIP.
  22. *
  23. * This is a place to put application or project-specific overrides
  24. * to the default configuration values for general CHIP features.
  25. *
  26. */
  27. #pragma once
  28. // Use a default pairing code if one hasn't been provisioned in flash.
  29. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
  30. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
  31. #endif
  32. #ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
  33. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
  34. #endif
  35. // For convenience, Chip Security Test Mode can be enabled and the
  36. // requirement for authentication in various protocols can be disabled.
  37. //
  38. // WARNING: These options make it possible to circumvent basic Chip security functionality,
  39. // including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
  40. //
  41. #define CHIP_CONFIG_SECURITY_TEST_MODE 0
  42. /**
  43. * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
  44. *
  45. * 0xFFF1: Test vendor.
  46. */
  47. #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1
  48. /**
  49. * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
  50. *
  51. * 0x8009: example window app
  52. */
  53. #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8010
  54. /**
  55. * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
  56. *
  57. * Enable support for Chip-over-BLE (CHIPoBLE).
  58. */
  59. #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1
  60. /**
  61. * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
  62. *
  63. * Enables the use of a hard-coded default serial number if none
  64. * is found in Chip NV storage.
  65. */
  66. #define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"
  67. /**
  68. * CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS
  69. *
  70. * Enable recording UTC timestamps.
  71. */
  72. #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1
  73. /**
  74. * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
  75. *
  76. * A size, in bytes, of the individual debug event logging buffer.
  77. */
  78. #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)
  79. /**
  80. * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL
  81. *
  82. * The interval (in units of 0.625ms) at which the device will send BLE advertisements while
  83. * in fast advertising mode.
  84. *
  85. * 40 (25ms).
  86. */
  87. #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL 40
  88. /**
  89. * CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL
  90. *
  91. * The interval (in units of 0.625ms) at which the device will send BLE advertisements while
  92. * in slow advertisement mode.
  93. *
  94. * 800 (500ms).
  95. */
  96. #define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL 800
  97. /**
  98. * CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
  99. *
  100. * The amount of time in miliseconds after which BLE should change his advertisements
  101. * from fast interval to slow interval.
  102. *
  103. * 30000 (30 secondes).
  104. */
  105. #define CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT (30 * 1000)
  106. /**
  107. * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL
  108. *
  109. * @brief
  110. * Active retransmit interval, or time to wait before retransmission after
  111. * subsequent failures in milliseconds.
  112. *
  113. * This is the default value, that might be adjusted by end device depending on its
  114. * needs (e.g. sleeping period) using Service Discovery TXT record CRA key.
  115. *
  116. */
  117. #define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32)
  118. #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1