#
# Copyright (c) 2024-2026 Huawei Device Co., Ltd.
# 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.
#

import("../../iotc.gni")

iotc_core_device_inc = [
  "$iotc_core_path/device/define",
  "$iotc_core_path/device/init/include",
  "$iotc_core_path/device/model/include",
  "$iotc_core_path/device/product/include",
  "$iotc_core_path/device/report/include",
  "$iotc_core_path/device/config/include",
  "$iotc_core_path/device/service/include",
]

iotc_core_device_src = [
  "$iotc_core_path/device/init/core_prof_init.c",
  "$iotc_core_path/device/model/char_state_mdl.c",
  "$iotc_core_path/device/model/dev_info_mdl.c",
  "$iotc_core_path/device/report/profile_report.c",
  "$iotc_core_path/device/config/config_online_status.c",
  "$iotc_core_path/device/service/device_control.c",
  "$iotc_core_path/device/service/iotc_dev_svc.c",
  "$iotc_core_path/device/service/dev_svc_auth_setup.c",
  "$iotc_core_path/device/service/dev_mngr_ctx.c",
]

# KV persistence (utils_file backed): config blobs.
# Boards without a filesystem set iot_connect_kv_support = false and get the
# RAM-only config_stub.c instead (session state only, nothing survives reboot).
if (iot_connect_kv_support) {
  iotc_core_device_src += [
    "$iotc_core_path/device/config/config_info.c",
    "$iotc_core_path/device/config/config_revoke_flag.c",
    "$iotc_core_path/device/config/config_authinfo.c",
    "$iotc_core_path/device/config/config_revoke.c",
  ]
} else {
  iotc_core_device_src += [
    "$iotc_core_path/device/config/config_stub.c",
  ]
}

if(iotc_connect_wifi_cloud_support) {
  iotc_core_device_src += [
    "$iotc_core_path/device/config/config_register_info.c",
    "$iotc_core_path/device/service/svc_cloud_setup.c",
    "$iotc_core_path/device/service/svc_cloud_login.c",
    "$iotc_core_path/device/config/config_login_info.c",
  ]
}

iotc_core_device_def = []