Skip to content

Commit

Permalink
Support optional SQM LDR block
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Jun 22, 2024
1 parent 440a6bf commit b10c22c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion indi-aagcloudwatcher-ng/CloudWatcherController_ng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,12 @@ bool CloudWatcherController::getValues(int *internalSupplyVoltage, int *ambientT
int res = sscanf(inputBuffer, "!6 %d!4 %d!8 %d!5 %d", &zenerV, &ldrRes, &ldrFreq,
&rainSensTemp);

// If SQM Light sensor is not installed, then we skip the !8 block and read the rest
if (res != 4)
{
return false;
int res = sscanf(inputBuffer, "!6 %d!4 %d!5 %d", &zenerV, &ldrRes, &rainSensTemp);
if (res != 3)
return false;
}
}
else if (m_FirmwareVersion >= 3)
Expand Down

0 comments on commit b10c22c

Please sign in to comment.