How krisgfx9/wireless-device-battery-monitor works
Wireless Battery polls supported wireless devices and presents their battery state in a taskbar widget or system tray, with refresh and device-change handling. Its shared polling layer dispatches to vendor-specific HID drivers and produces a common device-status model; platform entry points provide Windows and Linux presentation. Other documented capabilities include translations, brand-colored display, diagnostic output, and an opt-in device-support request. Driver and UI details are represented at subsystem level where the excerpts do not show individual dispatches; edges are limited to documented or indexed relationships.
Main entry points: main.cpp Windows app · devices.cpp Poll coordinator · drivers Vendor drivers · main_linux.cpp Linux app
Components 20
Application
- Windows app
src/main.cpp - Linux app
src/linux/main_linux.cpp
Device polling
- Device status
src/devices.h - Poll coordinator
src/devices.cpp - Vendor drivers
src/drivers - HID access
src/hid.cpp - Linux HID
src/linux/hid_linux.cpp - Linux device scan
src/linux/devices_linux.cpp - HeadsetControl driver
src/drivers/headsetcontrol.cpp - Generic drivers
src/drivers/generic.cpp - Mouse drivers
src/drivers/misc_mice.cpp - Steam controller
src/drivers/steam_controller.cpp
Presentation
- Taskbar widget
src/widget.cpp - Tray display
src/main.cpp - Brand colors
src/brands.cpp - Device labels
src/labels.cpp - Translations
src/i18n.cpp
Device support
- Support report
src/report.cpp - Request service
Other components
- User
Connections 21
- User → Windows app: uses
- User → Linux app: uses
- Windows app → Poll coordinator: polls devices
src/main.cpp - Linux app → Poll coordinator: polls devices
src/linux/main_linux.cpp - Poll coordinator → Device status: returns statuses
src/devices.cpp - Poll coordinator → Vendor drivers: dispatches polling
src/devices.cpp - Poll coordinator → HID access: enumerates HID
src/devices.cpp - Linux app → Linux device scan: uses device scan
src/linux/main_linux.cpp - Linux device scan → Linux HID: uses HID
src/linux/devices_linux.cpp - Steam controller → HID access: opens and reads
src/drivers/steam_controller.cpp - Windows app → Taskbar widget: updates widget
src/main.cpp - Windows app → Tray display: manages tray
src/main.cpp - Windows app → Support report: opens support
src/main.cpp - Windows app → Device labels: uses labels
src/main.cpp - Windows app → Translations: uses translations
src/main.cpp - Taskbar widget → Brand colors: uses colors
- Support report → Request service: posts request
src/report.cpp - Support report → HID access: scans collections
src/report.cpp - Vendor drivers → HeadsetControl driver: includes support
src/drivers/headsetcontrol.cpp - Vendor drivers → Generic drivers: includes fallback
src/drivers/generic.cpp - Vendor drivers → Mouse drivers: includes protocols
src/drivers/misc_mice.cpp