Re: sysctl hw.acpi.acline

看板FB_hackers作者時間11年前 (2014/06/17 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/10 (看更多)
On Mon, Jun 16, 2014 at 5:32 PM, David Wolfskill <david@catwhisker.org> wrote: > On Mon, Jun 16, 2014 at 04:36:42PM +0200, CeDeROM wrote: >> ... >> How can I tell the power source on my FreeBSD (i.e. AC, Battery, UPS)? >> >> man acpi: >> ... >> hw.acpi.acline >> AC line state (1 means online, 0 means on battery power). >> .... > > From the perspective of the running system, you should not be able to > tell (merely from the state of the power supply, at least) whether power > is being supplied by UPS or "house wiring". > > You can make that distinction by querying the state of a UPS, if one is > connected (and set up to provide power to the system in question). I am porting from Linux code that use "/sys/class/power_supply/type" and can tell "Mains", "UPS", or "Battery". It would be nice if FreeBSD had something similar :-) From ACPI manual it seems that "hw.acpi.acline" shoud do the job, but this OID is not available on desktops.. and this is not noted anywhere that "hw.acpi.acline" is only available on a laptops.. so I am not sure if my code should depend on this OID and if this is a bug? Thanks! :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #1Jdp3UA0 (FB_hackers)
討論串 (同標題文章)
文章代碼(AID): #1Jdp3UA0 (FB_hackers)