blob: edd68b95380a845c7cb787b8e01d3b82ae550ab3 [file] [log] [blame]
/*
*
* Copyright (c) 2021-2023 Project CHIP Authors
*
* 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
* Platform-specific configuration overrides for CHIP on
* Telink platform.
*/
#pragma once
// ==================== General Platform Adaptations ====================
#define CHIP_CONFIG_ABORT() abort()
#define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE const char *
#define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2
#define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY "rc"
// ==================== Security Adaptations ====================
#ifdef CONFIG_CHIP_CRYPTO_PSA
#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(psa_hash_operation_t)
#elif defined(CONFIG_CC3XX_BACKEND)
// Size of the statically allocated context for SHA256 operations in CryptoPAL
// determined empirically.
#define CHIP_CONFIG_SHA256_CONTEXT_SIZE 244
#else
#define CHIP_CONFIG_SHA256_CONTEXT_SIZE 208
#endif
// ==================== General Configuration Overrides ====================
#ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS
#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 8
#endif // CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS
#ifndef CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS
#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 8
#endif // CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS
#ifndef CHIP_LOG_FILTERING
#define CHIP_LOG_FILTERING 0
#endif // CHIP_LOG_FILTERING
#ifndef CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS
#define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1
#endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS
#ifdef CONFIG_PM
#ifndef CHIP_CONFIG_MAX_GROUP_DATA_PEERS
#define CHIP_CONFIG_MAX_GROUP_DATA_PEERS 7
#endif // CHIP_CONFIG_MAX_GROUP_DATA_PEERS
#ifndef CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC
#define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC 2
#endif // CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC
#ifndef CHIP_IM_MAX_NUM_COMMAND_HANDLER
#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 1
#endif // CHIP_IM_MAX_NUM_COMMAND_HANDLER
#ifndef CHIP_IM_MAX_NUM_WRITE_HANDLER
#define CHIP_IM_MAX_NUM_WRITE_HANDLER 1
#endif // CHIP_IM_MAX_NUM_WRITE_HANDLER
#ifndef CHIP_IM_MAX_NUM_WRITE_CLIENT
#define CHIP_IM_MAX_NUM_WRITE_CLIENT 1
#endif // CHIP_IM_MAX_NUM_WRITE_CLIENT
#ifndef CHIP_IM_MAX_REPORTS_IN_FLIGHT
#define CHIP_IM_MAX_REPORTS_IN_FLIGHT 1
#endif // CHIP_IM_MAX_REPORTS_IN_FLIGHT
#ifndef CHIP_CONFIG_LAMBDA_EVENT_SIZE
#define CHIP_CONFIG_LAMBDA_EVENT_SIZE (16)
#endif // CHIP_CONFIG_LAMBDA_EVENT_SIZE
#ifndef CHIP_CONFIG_DEVICE_MAX_ACTIVE_DEVICES
#define CHIP_CONFIG_DEVICE_MAX_ACTIVE_DEVICES 2
#endif // CHIP_CONFIG_DEVICE_MAX_ACTIVE_DEVICES
#endif // CONFIG_PM
#ifndef CHIP_CONFIG_MAX_FABRICS
#define CHIP_CONFIG_MAX_FABRICS 5
#endif
#ifdef CONFIG_CHIP_LOG_SIZE_OPTIMIZATION
// Disable some of the too detailed log modules to save flash
#define CHIP_CONFIG_LOG_MODULE_ExchangeManager_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_Crypto_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_Crypto_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_BDX_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_BDX_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_EventLogging_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_EventLogging_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_SetupPayload_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_SetupPayload_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_CASESessionManager_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_CASESessionManager_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_DataManagement_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_FabricProvisioning_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_chipSystemLayer_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_chipSystemLayer_PROGRESS 0
#define CHIP_CONFIG_LOG_MODULE_Zcl_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_SecureChannel_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_Ble_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_AppServer_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_Support_DETAIL 0
#define CHIP_CONFIG_LOG_MODULE_Support_PROGRESS 0
#endif
#ifndef CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC
#ifdef CONFIG_CHIP_ICD_IDLE_MODE_DURATION
#define CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC CONFIG_CHIP_ICD_IDLE_MODE_DURATION
#endif // CONFIG_CHIP_ICD_IDLE_MODE_DURATION
#endif // CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC
#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS
#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_DURATION
#define CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS CONFIG_CHIP_ICD_ACTIVE_MODE_DURATION
#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_DURATION
#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS
#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD
#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD
#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
#ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC
#ifdef CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC
#define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC
#endif // CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC
#endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC