How pvvx/zigbeetlc works
This repository provides Telink-based Zigbee 3.0 sensor firmware, with optional BLE support, device-specific displays and sensors, and Zigbee OTA. The principal device workflow samples sensor and battery state, exposes measurements and settings through Zigbee clusters, and reports data to a coordinator; button actions and BLE commands provide local control and configuration. The graph also preserves documented display, reporting, persistence, and OTA capabilities. Evidence is limited to the supplied excerpts and README; links to unsampled firmware subsystems use documented relationships only.
Main entry points: app_EpCfg.c Endpoint and clusters · app_main.c Application loop · main.c Firmware entry · sensor_th.c Sensor drivers
Components 18
Device runtime
- Firmware entry
src/main.c - Application loop
src/app_main.c - Button handling
src/app_ui.c
Sensing and display
- Sensor drivers
src/sensor_th.c - Battery readings
src/battery.c - Device displays
src/lcd.h
Zigbee application
- Endpoint and clusters
src/app_EpCfg.c - Zigbee callbacks
src/zcl_appCb.c - Measurement reporting
src/reporting.c - Custom clusters
src/custom_zcl/zcl_thermostat_ui_cfg.c
Configuration and updates
- BLE command interface
src/cmd_parser.c - Device settings
src/app_EpCfg.c - Nonvolatile settings
src/patch_zb_sdk/drv_nv.c - Flash operations
src/patch_zb_sdk/flash.c - Zigbee OTA handling
src/main.c - ZHA device quirk
zhaquirks/custom/zigbeetlc.py
Other components
- Device user
- Zigbee coordinator
Connections 20
- Firmware entry → Application loop: runs
src/main.c - Firmware entry → Zigbee OTA handling: converts OTA image
src/main.c - Application loop → Sensor drivers: samples sensors
- Application loop → Battery readings: reads battery
- Application loop → Button handling: polls buttons
- Application loop → Device displays: updates display
- Sensor drivers → Endpoint and clusters: supplies measurements
- Battery readings → Endpoint and clusters: supplies battery state
- Endpoint and clusters → Zigbee callbacks: dispatches callbacks
- Endpoint and clusters → Custom clusters: registers settings cluster
src/app_EpCfg.c - Endpoint and clusters → Measurement reporting: reports measurements
- Measurement reporting → Zigbee coordinator: sends reports
README.md - Zigbee coordinator → Endpoint and clusters: configures attributes
README.md - Device user → Button handling: presses button
README.md - Device user → BLE command interface: sends commands
src/cmd_parser.c - BLE command interface → Device settings: updates settings
src/cmd_parser.c - Device settings → Nonvolatile settings: persists settings
- Nonvolatile settings → Flash operations: reads and writes
src/patch_zb_sdk/drv_nv.c - Zigbee coordinator → Zigbee OTA handling: delivers firmware
README.md - Zigbee coordinator → ZHA device quirk: uses device quirk