Component_Name,Location,Layer,Responsibility,System_Requirements,Software_Features,Public_Interfaces,Dependencies,Interface_Type
State Manager,application_layer/business_stack/STM/,Application,"System state machine, state transitions, teardown coordination","SR-SYS-001, SR-SYS-002, SR-SYS-003","F-SYS, F-OTA, F-PWR","stm_getCurrentState(), stm_requestTransition(), stm_initiateTeardown(), stm_registerStateListener()","Event System, Error Handler, OTA Manager",API
Event System,application_layer/business_stack/event_system/,Application,"Publish/subscribe event bus, cross-component communication","SR-SYS-002, SR-COM-005","F-SYS, F-DAQ, F-COM, F-DIAG","event_publish(), event_subscribe(), event_unsubscribe()",None,Event Bus
Sensor Manager,application_layer/business_stack/sensor_manager/,Application,"Sensor lifecycle, acquisition scheduling, data filtering","SR-DAQ-001, SR-DAQ-002, SR-DAQ-003, SR-DAQ-004, SR-DAQ-005","F-DAQ, F-DQC","sensorMgr_initialize(), sensorMgr_startAcquisition(), sensorMgr_getLatestData(), sensorMgr_getSensorState()","Sensor Drivers, Event System, Time Utils, Machine Constant Manager",API
Machine Constant Manager,application_layer/business_stack/machine_constant_manager/,Application,"MC loading, validation, update coordination","SR-DQC-004, SR-DQC-005",F-DQC,"mcMgr_loadMachineConstants(), mcMgr_updateMachineConstants(), mcMgr_getMachineConstants(), mcMgr_validateMachineConstants()","Persistence, Event System",API
OTA Manager,application_layer/business_stack/fw_upgrader/,Application,"OTA negotiation, firmware reception, validation, activation","SR-OTA-001, SR-OTA-002, SR-OTA-003, SR-OTA-004, SR-OTA-005",F-OTA,"ota_handleRequest(), ota_receiveFirmwareChunk(), ota_validateFirmware(), ota_activateFirmware()","Network Stack, Persistence, State Manager, Security Manager",API
Main Hub APIs,application_layer/business_stack/main_hub_apis/,Application,"Main Hub communication protocol, message handling","SR-COM-001, SR-COM-002, SR-COM-003",F-COM,"mainHubAPI_initialize(), mainHubAPI_sendSensorData(), mainHubAPI_handleRequest(), mainHubAPI_getConnectionStatus()","Network Stack, Data Pool, Event System",API
Data Pool,application_layer/DP_stack/data_pool/,Application,"Runtime data storage, latest sensor values, system state","SR-DATA-002, SR-PERF-003","F-DATA, F-DAQ, F-COM","dataPool_initialize(), dataPool_updateSensorData(), dataPool_getLatestData(), dataPool_getAllSensorData()",Event System,API
Persistence,application_layer/DP_stack/persistence/,Application,"Persistent storage abstraction, serialization, wear management","SR-DATA-001, SR-DATA-002, SR-DATA-003, SR-DATA-004, SR-DATA-005","F-DATA, F-DIAG, F-DQC, F-OTA","persistence_writeSensorData(), persistence_writeDiagnostic(), persistence_writeMachineConstants(), persistence_flushCriticalData()","SD Card Driver, NVM Driver",API
Diagnostics Task,application_layer/diag_task/,Application,"Diagnostic event collection, storage, query interface","SR-DIAG-001, SR-DIAG-002, SR-DIAG-003, SR-DIAG-004",F-DIAG,"diagTask_initialize(), diagTask_reportEvent(), diagTask_getEvents(), diagTask_createSession()","Persistence, Event System, Security Manager",API
Error Handler,application_layer/error_handler/,Application,"Fault classification, escalation, state transition triggers","SR-PWR-003, SR-PWR-004, SR-DIAG-001","F-PWR, F-DIAG, F-SYS","errorHandler_reportError(), errorHandler_classifyError(), errorHandler_getErrorStatistics()","State Manager, Diagnostics Task",API
Network Stack,drivers/network_stack/,Driver,"Wi-Fi/Zigbee/LoRa communication, TLS/DTLS protocols","SR-COM-002, SR-COM-004, SR-COM-005","F-COM, F-SEC, F-OTA","networkStack_initialize(), networkStack_connect(), networkStack_sendData(), networkStack_setupTLS()","Wi-Fi Wrapper, Socket Abstraction",API
SD Card Driver,drivers/SDcard/,Driver,"SD card interface, FAT32 file system operations","SR-DATA-001, SR-DATA-005","F-DATA, F-OTA","sdcard_initialize(), sdcard_mount(), sdcard_writeFile(), sdcard_readFile()",SPI Wrapper,API
NVM Driver,drivers/nvm/,Driver,"Non-volatile memory (NVS) operations","SR-DATA-004, SR-SEC-003","F-DATA, F-SEC, F-DQC","nvm_initialize(), nvm_writeBlob(), nvm_readBlob(), nvm_getStats()",ESP-IDF NVS,API
Sensor Drivers,drivers/sensors/,Driver,"Hardware-specific sensor implementations","SR-DAQ-001, SR-HW-001","F-DAQ, F-HW","sensor_initialize(), sensor_read(), sensor_calibrate(), sensor_healthCheck()","I2C/SPI/UART/ADC Wrappers",API
Temperature Sensor,drivers/sensors/temprature/,Driver,"Temperature sensor hardware interface",SR-DAQ-001,F-DAQ,"temp_initialize(), temp_read(), temp_calibrate()","I2C Wrapper, ADC Wrapper",Hardware
Humidity Sensor,drivers/sensors/humidity/,Driver,"Humidity sensor hardware interface",SR-DAQ-001,F-DAQ,"humidity_initialize(), humidity_read(), humidity_calibrate()",I2C Wrapper,Hardware
CO2 Sensor,drivers/sensors/co2/,Driver,"CO2 sensor hardware interface",SR-DAQ-001,F-DAQ,"co2_initialize(), co2_read(), co2_calibrate()","UART Wrapper, I2C Wrapper",Hardware
Ammonia Sensor,drivers/sensors/ammonia/,Driver,"Ammonia sensor hardware interface",SR-DAQ-001,F-DAQ,"ammonia_initialize(), ammonia_read(), ammonia_calibrate()","ADC Wrapper, I2C Wrapper",Hardware
VOC Sensor,drivers/sensors/voc/,Driver,"VOC sensor hardware interface",SR-DAQ-001,F-DAQ,"voc_initialize(), voc_read(), voc_calibrate()",I2C Wrapper,Hardware
Light Sensor,drivers/sensors/light/,Driver,"Light sensor hardware interface",SR-DAQ-001,F-DAQ,"light_initialize(), light_read(), light_calibrate()","ADC Wrapper, I2C Wrapper",Hardware
GPIO Wrapper,ESP_IDF_FW_wrappers/gpio/,ESP-IDF Wrapper,"GPIO abstraction and discipline enforcement","SR-HW-002, SR-HW-003",F-HW,"gpio_initialize(), gpio_setDirection(), gpio_setLevel(), gpio_getLevel()",ESP-IDF GPIO,Hardware
I2C Wrapper,ESP_IDF_FW_wrappers/i2c/,ESP-IDF Wrapper,"I2C interface abstraction",SR-HW-002,"F-HW, F-DAQ","i2c_initialize(), i2c_write(), i2c_read(), i2c_writeRead()",ESP-IDF I2C,Hardware
SPI Wrapper,ESP_IDF_FW_wrappers/spi/,ESP-IDF Wrapper,"SPI interface abstraction",SR-HW-002,"F-HW, F-DATA","spi_initialize(), spi_transmit(), spi_receive(), spi_transmitReceive()",ESP-IDF SPI,Hardware
UART Wrapper,ESP_IDF_FW_wrappers/uart/,ESP-IDF Wrapper,"UART interface abstraction",SR-HW-002,"F-HW, F-DAQ","uart_initialize(), uart_write(), uart_read(), uart_flush()",ESP-IDF UART,Hardware
ADC Wrapper,ESP_IDF_FW_wrappers/adc/,ESP-IDF Wrapper,"ADC interface abstraction",SR-HW-002,"F-HW, F-DAQ, F-PWR","adc_initialize(), adc_readRaw(), adc_readVoltage(), adc_calibrate()",ESP-IDF ADC,Hardware
Wi-Fi Wrapper,ESP_IDF_FW_wrappers/wifi/,ESP-IDF Wrapper,"Wi-Fi interface abstraction",SR-COM-001,F-COM,"wifi_initialize(), wifi_connect(), wifi_disconnect(), wifi_getStatus()",ESP-IDF Wi-Fi,Hardware
Task Abstraction,os/task/,OS,"Task management and scheduling abstraction",SR-PERF-001,All Features,"task_create(), task_delete(), task_suspend(), task_resume()",FreeRTOS,OS
Software Timer,os/swtimer/,OS,"Software timer abstraction",SR-PERF-001,All Features,"swtimer_create(), swtimer_start(), swtimer_stop(), swtimer_delete()",FreeRTOS,OS
Logger,utils/logger/,Utility,"Debug and diagnostic logging",SR-DIAG-002,All Features,"logger_initialize(), logger_log(), logger_setLevel(), logger_flush()",None,Utility
Time Utils,utils/time_utils/,Utility,"Timestamp generation and time management",SR-DAQ-004,"F-DAQ, F-DIAG","timeUtils_initialize(), timeUtils_getCurrentTimestamp(), timeUtils_formatTimestamp()",ESP-IDF System Time,Utility
Security Manager,application_layer/security/,Application,"Security policy enforcement, violation handling","SR-SEC-001, SR-SEC-002, SR-SEC-003, SR-SEC-004",F-SEC,"secMgr_initialize(), secMgr_reportViolation(), secMgr_setSecurityPolicy()","Encryption Engine, Certificate Manager, Diagnostics",API
Encryption Engine,application_layer/security/crypto/,Application,"Cryptographic operations, key management","SR-SEC-002, SR-SEC-003",F-SEC,"crypto_encrypt(), crypto_decrypt(), crypto_sha256(), crypto_generateKey()","Hardware Crypto, NVM Driver",API
Certificate Manager,application_layer/security/cert_mgr/,Application,"Certificate validation, lifecycle management",SR-SEC-003,F-SEC,"certMgr_loadDeviceCertificate(), certMgr_validateCertificate(), certMgr_setupTLSContext()","Network Stack, Encryption Engine",API
Power Manager,application_layer/power_manager/,Application,"Power event coordination, recovery management","SR-PWR-001, SR-PWR-002",F-PWR,"powerMgr_initialize(), powerMgr_getCurrentVoltage(), powerMgr_triggerEmergencyFlush()","ADC Driver, Persistence, State Manager",API
HMI Manager,application_layer/hmi/,Application,"Local display and button interface management",SR-SYS-004,F-SYS,"hmi_initialize(), hmi_updateDisplay(), hmi_handleButtonPress()","OLED Driver, Button Driver, Event System",API