How a taskbar battery monitor reads wireless devices
10 steps · about 5 h 10 min · Intermediate
- How Bluetooth Low Energy Devices Work: GATT Services and Characteristics Explained (article, freeCodeCamp, 25 min)
Start with the BLE vocabulary of services and characteristics, which is how Bluetooth devices expose their battery level.
- How to Read the Battery Level of Bluetooth LE Devices (article, Andreas Jakl, 15 min)
It applies the GATT ideas to one concrete job, finding the standard Battery Service (0x180F) and reading it.
- ESP32 BLE Server GATT Service Battery Level Indication (tutorial, Microcontrollers Lab, 30 min)
Seeing the device side of the Battery Level characteristic shows what a monitor app is actually reading.
- Tutorial about USB HID Report Descriptors (tutorial, Eleccelerator, 40 min)
Report descriptors tell the host how to interpret each byte, which is the key to decoding any HID packet.
- Generic Communication with USB HID Device Class (tutorial, Ravikiran B, 20 min)
It explains vendor-defined usage pages and feature reports, the channel most vendors use for custom battery queries.
- USB HID Down the rabbit hole: Reverse engineering the Logitech CU0019 USB receiver (blog, DEV Community (endes), 25 min)
A worked example of finding a vendor report in a real wireless receiver and reading its bytes.
- Reverse Engineering a USB Device in Linux (blog, The Gistre Blog (EPITA), 30 min)
It teaches the practical workflow of identifying a device by vendor and product ID and inspecting its HID traffic.
- libusb/hidapi: A Simple cross-platform library for communicating with HID devices (repo, GitHub (libusb), 40 min)
This is the standard C library for opening HID devices and sending or reading reports, so you can try your own queries.
- Notifications and the Notification Area - Win32 apps (doc, Microsoft Learn, 25 min)
Once you can read a battery level, this shows how a Windows app puts an icon and tooltip in the taskbar tray.
- krisgfx9/Wireless-Device-Battery-Monitor (repo, GitHub (krisgfx9), 1 h)
Finish by reading the trending C++ project, where the per-device protocol notes and tray code use everything above.