In getSerial number, there is an off by one error when terminating the string:
{
// request from SCD30
if (ReadFromSCD30(CMD_READ_SERIALNBR, (uint8_t ) val, SCD30_SERIAL_NUM_WORDS 2) != SCD30_SERIAL_NUM_WORDS 2) return(false);
val[(SCD30_SERIAL_NUM_WORDS 2) + 1] = 0x0; // terminate
return(true);
}
It should be:
val[(SCD30_SERIAL_NUM_WORDS * 2)] = 0x0; // terminate
In getSerial number, there is an off by one error when terminating the string: { // request from SCD30 if (ReadFromSCD30(CMD_READ_SERIALNBR, (uint8_t ) val, SCD30_SERIAL_NUM_WORDS 2) != SCD30_SERIAL_NUM_WORDS 2) return(false); val[(SCD30_SERIAL_NUM_WORDS 2) + 1] = 0x0; // terminate return(true); }
It should be: val[(SCD30_SERIAL_NUM_WORDS * 2)] = 0x0; // terminate