Hi, I'm considering to write a KMDF battery miniclass driver for HID-based batteries to act as as replacement for the in-build Microsoft "HidBatt" driver. The reason for wanting to do so is that HidBatt doesn't seem to support all relevant battery parameters. Battery parameters like "CycleCount" and "Temperature" (from HID Power Device spec.) are for some reason not parsed by the HidBatt driver.
My tentative plan is to start with the Microsoft "simbatt" sample (Class=Battery) and modify the INF HWID to "HID_DEVICE_UP:0084_U:0004", so that it matches the HidBatt driver. I'm hoping that I'll afterwards will be able to query HID FEATURE reports to populate static battery parameters on device initialization. However, I'm unsure how to make the driver continuously obtain HID input reports to update dynamic battery parameters like "RemainingCapacity". Microsoft's "Obtaining HID Reports by kernel-mode drivers" documentation suggests using IRP_MJ_READ requests for this, but I'm unsure how to implement it.
Is there any sample code online for a non-HIDClass KMDF driver that is continuously obtaining HID input reports?
Another possibility if to instead write an upper filter driver on top of "HidBatt" and only populates the missing parameters. However, I'm not sure if that is possible. The Battery mini class documentation does at least only mention lower filter driver drivers, and not upper.
Any advise is highly appreciated,
Fredrik