Originally Posted by tut
BTW, you can find proper power source detection example in src/usr.sbin/powerd/powerd.c
- see 'acline_init' and 'acline_read' functions. Note that sometimes ACPI may be absent or disabled because of broken BIOS so power source detection using APM is preferable in the case.
, I've found following line in 'nvidia_drv.so' file:
!system=ACPI subsystem=ACAD type=\_SB_.AC__ notify=%x
It seems you are using wrong pattern. Look at following messages on my notebook:
!system=ACPI subsystem=ACAD type=\_SB_.PCI0.AC0_ notify=0x00
!system=ACPI subsystem=ACAD type=\_SB_.PCI0.AC0_ notify=0x01
I'm not sure you should do hardcoded 'type' parameter matching, numbers may vary. And as I wrote before the best method is in powerd.c implementation.