diff --git a/include/create/create.h b/include/create/create.h index d9d00e0..e1885b4 100644 --- a/include/create/create.h +++ b/include/create/create.h @@ -307,14 +307,15 @@ namespace create { uint16_t getVoltage() const; /* Get current flowing in/out of battery. + * A positive current implies Create is charging. * \return value in milliamps */ - uint16_t getCurrent() const; + int16_t getCurrent() const; /* Get the temperature of battery. * \return value in Celsius */ - uint8_t getTemperature() const; + int8_t getTemperature() const; /* Get battery's remaining charge. * \return value in milliamp-hours diff --git a/src/create.cpp b/src/create.cpp index f9ef69d..5cb9f72 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -577,9 +577,9 @@ namespace create { } } - uint16_t Create::getCurrent() const { + int16_t Create::getCurrent() const { if (data->isValidPacketID(ID_VOLTAGE)) { - return GET_DATA(ID_CURRENT); + return (int16_t) GET_DATA(ID_CURRENT); } else { CERR("[create::Create] ", "Current sensor not supported!"); @@ -587,9 +587,9 @@ namespace create { } } - uint8_t Create::getTemperature() const { + int8_t Create::getTemperature() const { if (data->isValidPacketID(ID_TEMP)) { - return GET_DATA(ID_TEMP); + return (int8_t) GET_DATA(ID_TEMP); } else { CERR("[create::Create] ", "Temperature sensor not supported!");