diff --git a/SerialMessage.h b/SerialMessage.h index 32b12e3..82b253c 100644 --- a/SerialMessage.h +++ b/SerialMessage.h @@ -15,7 +15,7 @@ template class SerialMessage{ public: // @warning Never use this to construct a SerialMessage object - SerialMessage() = default; + SerialMessage() = delete; /** * @brief Construct a new Serial Message object */ @@ -46,19 +46,19 @@ class SerialMessage{ * @brief Return a pointer to the args array * @return a pointer to the args array */ - uint32_t * GetArgs(); + int32_t * GetArgs(); /** * @brief Returns the number of args that have been populated for the current message * @return the number of args that have been populated for the current message */ - int GetArgsLength(); + uint32_t GetArgsLength(); /** * @brief Returns the number of args that have been populated for the current message * @return the number of args that have been populated for the current message */ - int GetPopulatedArgs(); + uint32_t GetPopulatedArgs(); /** * @brief Prints the args array to the serial monitor @@ -89,10 +89,10 @@ class SerialMessage{ SerialState state{IDLE}; char data[byteSize]; // an array to store the received data char temp_data[byteSize]; // an array that will be used with strtok() - uint16_t ndx{0}; + uint32_t ndx{0}; static constexpr uint16_t args_length{30}; - uint16_t populatedArgs{0}; // the number of args that have been populated for the current message - uint32_t args[args_length]; + uint32_t populatedArgs{0}; // the number of args that have been populated for the current message + int32_t args[args_length]; const char startMarker = '!'; const char endMarker = ';'; @@ -196,17 +196,17 @@ void SerialMessage::ClearNewData(){ } template -uint32_t * SerialMessage::GetArgs(){ +int32_t * SerialMessage::GetArgs(){ return args; } template -int SerialMessage::GetArgsLength(){ +uint32_t SerialMessage::GetArgsLength(){ return args_length; } template -int SerialMessage::GetPopulatedArgs(){ +uint32_t SerialMessage::GetPopulatedArgs(){ return populatedArgs; }