add options, allow passing SMC key
- keep default behaviour
- allow optional passing SMC keys
- add options to dump all or individual SMC keys
Reasoning: There is another PR which proposes to change the default keys read for CPU and GPU. This might not fit everybody (does not for me). So I wanted an option to pass the key that works for me.
TCXC as mentioned in https://github.com/lavoiesl/osx-cpu-temp/pull/33 does not work on my older MacBook Pro 2011, but TC0P or TC0D or TC0C work. On a newer MBP 13", the TC0D does not work. On my work MBP, the TC0D and TC0C as well as the TG0P and TG0D don't work.
To find out what works on a given machine, I added the option to dump all keys.
@lavoiesl : I'm happy to discuss any changes.
for reference see also https://logi.wiki/index.php/SMC_Sensor_Codes
Sorry for not replying. I love this idea. I changed master a bit, which I think can help making this easier to do. Wanna try updating it?
Took a while to get it back to work, but also fixed some issues. Ready for review.
Unfortunately, on my M1 Macs this does not produce any useful output anymore :(
Can we add something like:
#if (MAC_OS_X_VERSION_MAX_ALLOWED < 120000) /* older than Monterey? */
#ifndef kIOMainPortDefault
#define kIOMainPortDefault kIOMasterPortDefault
#endif
#endif
at the top or in the .h ? Else it will no longer compile on older systems.
/edit
I just realized this must have been a breaking API change for political correctness? Yikes… 😬