paulvha / scd30

arduino esp8266 ESP8266 SCD30 SCD-30 ESP32 UNOR4
Other
41 stars 11 forks source link

Off be one error in getSerialNumber #11

Closed ogni4247 closed 1 year ago

ogni4247 commented 3 years ago

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

paulvha commented 1 year ago

closing old issues