Skip to content

Commit 0a995c7

Browse files
authored
Update capture_RPi.cpp: Check for no cmdToUse
1 parent abb61b0 commit 0a995c7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/capture_RPi.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,19 @@ int main(int argc, char *argv[])
475475
exit(EXIT_ERROR_STOP);
476476
}
477477

478+
if (CG.cmdToUse == NULL) {
479+
// We can't do anything if we don't know how to control the camera.
480+
char command[200];
481+
snprintf(command, sizeof(command)-1, "%s/addMessage.sh --type error --msg '%s: %s'",
482+
CG.allskyScripts,
483+
CG.ME,
484+
"Unknown command to control RPi camera; contact Allsky Support.");
485+
Log(4, "Executing %s\n", command);
486+
(void) system(command);
487+
488+
exit(EXIT_ERROR_STOP);
489+
}
490+
478491
char bufTemp[1024] = { 0 };
479492
char const *bayer[] = { "RG", "BG", "GR", "GB" };
480493
bool justTransitioned = false;

0 commit comments

Comments
 (0)