mirror of
https://github.com/hholtmann/smcFanControl.git
synced 2025-11-04 19:49:16 +01:00
add support for the sp78 format
This commit is contained in:
@ -87,6 +87,11 @@ void printUInt(SMCVal_t val)
|
||||
printf("%u ", (unsigned int) _strtoul(val.bytes, val.dataSize, 10));
|
||||
}
|
||||
|
||||
void printSP78(SMCVal_t val)
|
||||
{
|
||||
printf("%u.%02u ", *val.bytes, (*(val.bytes+1)) * 100 / 256);
|
||||
}
|
||||
|
||||
void printBytesHex(SMCVal_t val)
|
||||
{
|
||||
int i;
|
||||
@ -108,6 +113,8 @@ void printVal(SMCVal_t val)
|
||||
printUInt(val);
|
||||
else if (strcmp(val.dataType, DATATYPE_FPE2) == 0)
|
||||
printFPE2(val);
|
||||
else if (strcmp(val.dataType, DATATYPE_SP78) == 0 && val.dataSize == 2)
|
||||
printSP78(val);
|
||||
|
||||
printBytesHex(val);
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
#define DATATYPE_UINT8 "ui8 "
|
||||
#define DATATYPE_UINT16 "ui16"
|
||||
#define DATATYPE_UINT32 "ui32"
|
||||
#define DATATYPE_SP78 "sp78"
|
||||
|
||||
typedef struct {
|
||||
char major;
|
||||
@ -65,7 +66,7 @@ typedef struct {
|
||||
char dataAttributes;
|
||||
} SMCKeyData_keyInfo_t;
|
||||
|
||||
typedef char SMCBytes_t[32];
|
||||
typedef unsigned char SMCBytes_t[32];
|
||||
|
||||
typedef struct {
|
||||
UInt32 key;
|
||||
|
||||
Reference in New Issue
Block a user