Skip to content

Commit

Permalink
Update functions.sh: Correct check
Browse files Browse the repository at this point in the history
Unlike the "ZWOptical camera" string instead of "ZWO", "Planetary Camera" comes after the true model.
  • Loading branch information
EricClaeys authored Dec 9, 2024
1 parent 880f2f7 commit cefafff
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ function get_connected_cameras_info()
{
if ($1 == "Bus" && $3 == "Device") {
ZWO = $7;
if ((ZWO == "ZWOptical" && $8 == "company") ||
(ZWO == "Planetary" && $8 == "Camera")) {
# Check for "ZWOptical company" instead of ZWO on some older cameras
if (ZWO == "ZWOptical" && $8 == "company") {
model = $9;
model_cont = 10;
} else {
Expand All @@ -327,7 +327,12 @@ function get_connected_cameras_info()
}
if (model != "") {
# The model may have multiple tokens.
for (i=model_cont; i<= NF; i++) model = model " " $i
for (i=model_cont; i<= NF; i++) {
# Check for "ASI120 Planetary Camera" on some older cameras.
if ($i == "Planetary")
break;
model = model " " $i;
}
printf("ZWO\t%d\t%s\n", num++, model);
model = "<found>"; # This camera was output
}
Expand Down

0 comments on commit cefafff

Please sign in to comment.