uint8_t raw[2]; i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, (0x48 << 1) Keeping the sensor‑reading code isolated makes unit‑testing easier and prevents the AT parser from becoming a monolith. 4.3 Glue Layer – AT Command (if applicable) // at_cmd_myfeat.c #include "at.h" #include "my_feature.h"

/* Example: read a temperature sensor on I2C address 0x48 */ int my_feature_get_temperature(float *temp_c)

Add the registration call in the AT subsystem init routine (often at_init.c ). If the feature needs user‑configurable thresholds:

// Save a float threshold to NVS esp_err_t my_feature_save_threshold(float thr)

static void at_cmd_temp_handler(at_cmd_ctx_t *ctx, const char *params)

at_register_command("AT+TEMP?", at_cmd_temp_handler, AT_CMD_TYPE_QUERY);

Write this spec in a short markdown file ( FEATURE_SPEC.md ). It will be your contract with the code. Below is a generic flow; adapt the file names and APIs to the DWI259ETI SDK you have. 4.1 Add New Source Files (or extend existing ones) src/ ├─ feature/ │ ├─ my_feature.c // core logic │ └─ my_feature.h └─ at/ └─ at_cmd_myfeat.c // AT parser glue (if needed) 4.2 Core Logic ( my_feature.c ) #include "my_feature.h" #include "driver/gpio.h" #include "driver/i2c.h" #include "nvs.h" #include "esp_log.h"

Dwi259eti Firmware (UPDATED ✮)

uint8_t raw[2]; i2c_cmd_handle_t cmd = i2c_cmd_link_create(); i2c_master_start(cmd); i2c_master_write_byte(cmd, (0x48 << 1) Keeping the sensor‑reading code isolated makes unit‑testing easier and prevents the AT parser from becoming a monolith. 4.3 Glue Layer – AT Command (if applicable) // at_cmd_myfeat.c #include "at.h" #include "my_feature.h"

/* Example: read a temperature sensor on I2C address 0x48 */ int my_feature_get_temperature(float *temp_c) Dwi259eti Firmware

Add the registration call in the AT subsystem init routine (often at_init.c ). If the feature needs user‑configurable thresholds: It will be your contract with the code

// Save a float threshold to NVS esp_err_t my_feature_save_threshold(float thr) i2c_cmd_handle_t cmd = i2c_cmd_link_create()

static void at_cmd_temp_handler(at_cmd_ctx_t *ctx, const char *params)

at_register_command("AT+TEMP?", at_cmd_temp_handler, AT_CMD_TYPE_QUERY);

Write this spec in a short markdown file ( FEATURE_SPEC.md ). It will be your contract with the code. Below is a generic flow; adapt the file names and APIs to the DWI259ETI SDK you have. 4.1 Add New Source Files (or extend existing ones) src/ ├─ feature/ │ ├─ my_feature.c // core logic │ └─ my_feature.h └─ at/ └─ at_cmd_myfeat.c // AT parser glue (if needed) 4.2 Core Logic ( my_feature.c ) #include "my_feature.h" #include "driver/gpio.h" #include "driver/i2c.h" #include "nvs.h" #include "esp_log.h"