Battery status API in macOS?

前端 未结 4 594
北荒
北荒 2020-11-28 07:49

How can I read the status of the battery on my MacBookPro from my own application?

Googling has so far only revealed APIs for device drivers to handle power events -

4条回答
  •  执念已碎
    2020-11-28 08:43

    Look at the System Management Controller. I don't have my MBP handy, but I believe you need to look at smc.h

提交回复
热议问题