forked from mirror/smcFanControl
add '{pwm' decoding support
This commit is contained in:
@ -102,6 +102,11 @@ void printSI16(SMCVal_t val)
|
||||
printf("%d ", ntohs(*(SInt16*)val.bytes));
|
||||
}
|
||||
|
||||
void printPWM(SMCVal_t val)
|
||||
{
|
||||
printf("%.1f%% ", ntohs(*(UInt16*)val.bytes) * 100 / 65536.0);
|
||||
}
|
||||
|
||||
void printBytesHex(SMCVal_t val)
|
||||
{
|
||||
int i;
|
||||
@ -129,6 +134,8 @@ void printVal(SMCVal_t val)
|
||||
printSI8(val);
|
||||
else if (strcmp(val.dataType, DATATYPE_SI16) == 0 && val.dataSize == 2)
|
||||
printSI16(val);
|
||||
else if (strcmp(val.dataType, DATATYPE_PWM) == 0 && val.dataSize == 2)
|
||||
printPWM(val);
|
||||
|
||||
printBytesHex(val);
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
#define DATATYPE_SP78 "sp78"
|
||||
#define DATATYPE_SI8 "si8 "
|
||||
#define DATATYPE_SI16 "si16"
|
||||
#define DATATYPE_PWM "{pwm"
|
||||
|
||||
typedef struct {
|
||||
char major;
|
||||
|
||||
Reference in New Issue
Block a user