# Quantumancy sensor node — main component.
#
# The *_parse / *_compensate / *_level units are ESP-IDF-free pure logic,
# split out of their drivers so they can also be compiled and tested on a
# host with plain gcc — see ../test/run_tests.sh. They are listed here too
# because the on-device build needs them linked in exactly the same way.
#
# device_config.h is intentionally NOT listed as a source: it's a header the
# seeker generates locally (see device_config.h.example + README.md) and is
# gitignored. If it's missing, the build will fail on the #include in
# app_main.c with a clear "file not found" — that's deliberate, it's the
# signal to go copy the example file and fill it in.

idf_component_register(
    SRCS
        "app_main.c"
        "wifi_manager.c"
        "telemetry_client.c"
        "sensor_registry.c"
        "bmp280.c"
        "bmp280_compensate.c"
        "rd03e.c"
        "rd03e_parse.c"
        "mems_mic.c"
        "mems_level.c"
    INCLUDE_DIRS
        "."
    REQUIRES
        esp_wifi
        esp_netif
        esp_event
        nvs_flash
        esp_http_client
        driver
        json
        esp_timer
        log
)

# Note (unverified): recent ESP-IDF versions (v5.3+) split the old
# monolithic "driver" component into per-peripheral components
# (esp_driver_i2c, esp_driver_uart, esp_driver_i2s, ...); "driver" is kept
# as a backward-compatible umbrella that still pulls those in, which is why
# a plain REQUIRES driver is used above. If a real build against your exact
# IDF version complains it can't find driver/i2c_master.h, driver/uart.h,
# or driver/i2s_std.h, add esp_driver_i2c / esp_driver_uart / esp_driver_i2s
# explicitly to REQUIRES.
