dkorunic / iSMC

Apple SMC CLI tool that can decode and display temperature, fans, battery, power, voltage and current information
GNU General Public License v3.0
113 stars 13 forks source link

Writing to SMC keys #4

Closed jlehrer1 closed 3 years ago

jlehrer1 commented 4 years ago

Hi,

I can't believe I haven't found this repo before! Incredible. I didn't think I'd be able to find the new SMC keys. Anyways, is there a way to write values to these keys? For context, I'm trying to write an open source Fan Control app for the T2 Intel Macs, and smcFanControl no longer works on Catalina.

dkorunic commented 4 years ago

Hey @jlehrer1 , you can write values to keys by importing github.com/panotza/gosmc and calling gosmc.SMCWriteKey(). Make sure to read key first with gosmc.SMCReadKey() to get DataSize and DataType as you will need to know those for value conversions (for more info see conv.go) and for gosmc.SMCWriteKey() calls.