Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indi-gphoto with external shutter #1023

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions indi-gphoto/gphoto_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,26 +627,13 @@ static void *stop_bulb(void *arg)
DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing DSUSB shutter.");
gphoto->dsusb->closeShutter();
}
if (gphoto->bulb_widget)
{
DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing internal shutter.");
DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Using widget:%s", gphoto->bulb_widget->name);
if (strcmp(gphoto->bulb_widget->name, "eosremoterelease") == 0)
{
//600D eosremoterelease RELEASE FULL
gphoto_set_widget_num(gphoto, gphoto->bulb_widget, EOS_RELEASE_FULL);
}
else
{
gphoto_set_widget_num(gphoto, gphoto->bulb_widget, FALSE);
}
}

if (gphoto->bulb_port[0] && (gphoto->bulb_fd >= 0))
{
DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing remote serial shutter.");
DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing remote serial shutter (%s)",gphoto->bulb_port);

// Close Nikon Shutter
if (!strstr(device, "Nikon"))
if (strstr(device, "Nikon"))
{
uint8_t close_shutter[3] = {0xFF, 0x01, 0x00};
knro marked this conversation as resolved.
Show resolved Hide resolved
if (write(gphoto->bulb_fd, close_shutter, 3) != 3)
Expand All @@ -656,6 +643,20 @@ static void *stop_bulb(void *arg)
ioctl(gphoto->bulb_fd, TIOCMBIC, &RTS_flag);
close(gphoto->bulb_fd);
}
else if (gphoto->bulb_widget)
{
DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "Closing internal shutter.");
DEBUGFDEVICE(device, INDI::Logger::DBG_DEBUG, "Using widget:%s", gphoto->bulb_widget->name);
if (strcmp(gphoto->bulb_widget->name, "eosremoterelease") == 0)
{
//600D eosremoterelease RELEASE FULL
gphoto_set_widget_num(gphoto, gphoto->bulb_widget, EOS_RELEASE_FULL);
}
else
{
gphoto_set_widget_num(gphoto, gphoto->bulb_widget, FALSE);
}
}
gphoto->command |= DSLR_CMD_DONE;
pthread_cond_signal(&gphoto->signal);
}
Expand Down Expand Up @@ -1221,7 +1222,7 @@ int gphoto_start_exposure(gphoto_driver *gphoto, uint32_t exptime_usec, int mirr
}

// Open Nikon Shutter
if (!strstr(device, "Nikon"))
if (strstr(device, "Nikon"))
{
uint8_t open_shutter[3] = {0xFF, 0x01, 0x01};
if (write(gphoto->bulb_fd, open_shutter, 3) != 3)
Expand Down Expand Up @@ -1418,10 +1419,12 @@ int gphoto_read_exposure_fd(gphoto_driver *gphoto, int fd)
return GP_OK;

case GP_EVENT_FILE_ADDED:
if (downloadComplete) break;
knro marked this conversation as resolved.
Show resolved Hide resolved
DEBUGDEVICE(device, INDI::Logger::DBG_DEBUG, "File added event completed.");
fn = static_cast<CameraFilePath *>(data);
if (gphoto->handle_sdcard_image != IGNORE_IMAGE)
download_image(gphoto, fn, fd);

downloadComplete = true;
// Wait 1 second for GP_EVENT_CAPTURE_COMPLETE
// If that times out, we already marked downloadComplete as true so we will exist gracefully.
Expand Down
Loading