fixed Fan Key if there are more than 10 like in an XServe

This commit is contained in:
Denis Ahrens
2019-03-02 18:02:41 +01:00
parent de3988463a
commit 3373ab1ab0
3 changed files with 12 additions and 10 deletions

View File

@ -557,24 +557,24 @@ kern_return_t SMCPrintFans(void)
for (i = 0; i < totalFans; i++)
{
printf("\nFan #%d:\n", i);
sprintf(key, "F%dID", i);
sprintf(key, "F%cID", fannum[i]);
SMCReadKey(key, &val);
if(val.dataSize > 0) {
printf(" Fan ID : %s\n", val.bytes+4);
}
sprintf(key, "F%dAc", i);
sprintf(key, "F%cAc", fannum[i]);
SMCReadKey(key, &val);
printf(" Actual speed : %.0f\n", getFloatFromVal(val));
sprintf(key, "F%dMn", i);
sprintf(key, "F%cMn", fannum[i]);
SMCReadKey(key, &val);
printf(" Minimum speed: %.0f\n", getFloatFromVal(val));
sprintf(key, "F%dMx", i);
sprintf(key, "F%cMx", fannum[i]);
SMCReadKey(key, &val);
printf(" Maximum speed: %.0f\n", getFloatFromVal(val));
sprintf(key, "F%dSf", i);
sprintf(key, "F%cSf", fannum[i]);
SMCReadKey(key, &val);
printf(" Safe speed : %.0f\n", getFloatFromVal(val));
sprintf(key, "F%dTg", i);
sprintf(key, "F%cTg", fannum[i]);
SMCReadKey(key, &val);
printf(" Target speed : %.0f\n", getFloatFromVal(val));
SMCReadKey("FS! ", &val);

View File

@ -98,6 +98,8 @@ typedef struct {
typedef unsigned char SMCBytes_t[32];
UInt8 fannum[] = "0123456789ABCDEFGHIJ";
typedef struct {
UInt32 key;
SMCKeyData_vers_t vers;