diff --git a/smc-command/smc.c b/smc-command/smc.c index 8a3a780..2acf9a1 100644 --- a/smc-command/smc.c +++ b/smc-command/smc.c @@ -97,6 +97,11 @@ void printSI8(SMCVal_t val) printf("%d ", (signed char)*val.bytes); } +void printSI16(SMCVal_t val) +{ + printf("%d ", ntohs(*(SInt16*)val.bytes)); +} + void printBytesHex(SMCVal_t val) { int i; @@ -122,6 +127,8 @@ void printVal(SMCVal_t val) printSP78(val); else if (strcmp(val.dataType, DATATYPE_SI8) == 0 && val.dataSize == 1) printSI8(val); + else if (strcmp(val.dataType, DATATYPE_SI16) == 0 && val.dataSize == 2) + printSI16(val); printBytesHex(val); } diff --git a/smc-command/smc.h b/smc-command/smc.h index 8f4312d..f19179e 100644 --- a/smc-command/smc.h +++ b/smc-command/smc.h @@ -44,6 +44,7 @@ #define DATATYPE_UINT32 "ui32" #define DATATYPE_SP78 "sp78" #define DATATYPE_SI8 "si8 " +#define DATATYPE_SI16 "si16" typedef struct { char major;