Skip to content

Commit

Permalink
Make all error messages shorter then 64 bytes
Browse files Browse the repository at this point in the history
In order to reduce memory requirements all error messages we require
that all error messages are shorter than 64 bytes.
  • Loading branch information
Rol-la committed Nov 28, 2022
1 parent c994f16 commit db59864
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/SensirionErrors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,16 @@ void errorToString(uint16_t error, char errorMessage[],
strncpy(errorMessage, "Wrong CRC found", errorMessageSize);
return;
case LowLevelError::WrongNumberBytesError:
strncpy(errorMessage,
"The number of bytes to be read are "
"not a multiple of 3",
strncpy(errorMessage, "Number of bytes not a multiple of 3",
errorMessageSize);
return;
case LowLevelError::NotEnoughDataError:
strncpy(errorMessage, "Not enough data received",
errorMessageSize);
return;
case LowLevelError::InternalBufferSizeError:
strncpy(
errorMessage,
"Can't execute this command on this board, internal "
"I2C buffer is too small",
errorMessageSize);
strncpy(errorMessage, "Internal I2C buffer too small",
errorMessageSize);
return;
}
break;
Expand Down

0 comments on commit db59864

Please sign in to comment.