TwiceAsNice  2019-02-18
Classes | Macros | Enumerations | Functions | Variables
gphoto_driver.cpp File Reference
#include <fcntl.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <tiffio.h>
#include <tiffio.hxx>
#include <config.h>
#include <indilogger.h>
#include <gphoto2/gphoto2-version.h>
#include <libraw/libraw.h>
#include "gphoto_driver.h"
#include "dsusbdriver.h"
Include dependency graph for gphoto_driver.cpp:

Classes

struct  _gphoto_widget_list
 
struct  _gphoto_driver
 
struct  membuf
 

Macros

#define EOS_CUSTOMFUNCEX   "customfuncex"
 
#define EOS_MIRROR_LOCKUP_ENABLE   "20,1,3,14,1,60f,1,1"
 
#define EOS_MIRROR_LOCKUP_DISABLE   "20,1,3,14,1,60f,1,0"
 
#define GPHOTO_MATCH_WIDGET(widget1, widget2)   (widget2 && widget1 == widget2->widget)
 

Enumerations

enum  {
  DSLR_CMD_BULB_CAPTURE = 0x01, DSLR_CMD_CAPTURE = 0x02, DSLR_CMD_ABORT = 0x04, DSLR_CMD_DONE = 0x08,
  DSLR_CMD_THREAD_EXIT = 0x10
}
 

Functions

void gphoto_set_debug (const char *name)
 
static const char * widget_name (CameraWidget *widget)
 
static const char * lookup_widget (CameraWidget *config, const char *key, CameraWidget **widget)
 
int gphoto_widget_changed (gphoto_widget *widget)
 
int gphoto_read_widget (gphoto_widget *widget)
 
static gphoto_widgetfind_widget (gphoto_driver *gphoto, const char *name)
 
void show_widget (gphoto_widget *widget, const char *prefix)
 
int gphoto_set_config (Camera *camera, CameraWidget *config, GPContext *context)
 
int gphoto_set_widget_num (gphoto_driver *gphoto, gphoto_widget *widget, float value)
 
int gphoto_set_widget_text (gphoto_driver *gphoto, gphoto_widget *widget, const char *str)
 
static void widget_free (gphoto_widget *widget)
 
static double * parse_shutterspeed (gphoto_driver *gphoto, char **choices, int count)
 
static void * stop_bulb (void *arg)
 
static void reset_settings (gphoto_driver *gphoto)
 
int find_bulb_exposure (gphoto_driver *gphoto, gphoto_widget *widget)
 
int find_exposure_setting (gphoto_driver *gphoto, gphoto_widget *widget, uint32_t exptime_usec)
 
void gphoto_set_upload_settings (gphoto_driver *gphoto, int setting)
 
static int download_image (gphoto_driver *gphoto, CameraFilePath *fn, int fd)
 
bool gphoto_supports_temperature (gphoto_driver *gphoto)
 
float gphoto_get_last_sensor_temperature (gphoto_driver *gphoto)
 
int gphoto_mirrorlock (gphoto_driver *gphoto, int msec)
 
int gphoto_start_exposure (gphoto_driver *gphoto, uint32_t exptime_usec, int mirror_lock)
 
int gphoto_read_exposure_fd (gphoto_driver *gphoto, int fd)
 
int gphoto_abort_exposure (gphoto_driver *gphoto)
 
int gphoto_read_exposure (gphoto_driver *gphoto)
 
char ** gphoto_get_formats (gphoto_driver *gphoto, int *cnt)
 
char ** gphoto_get_iso (gphoto_driver *gphoto, int *cnt)
 
void gphoto_set_iso (gphoto_driver *gphoto, int iso)
 
char ** gphoto_get_exposure_presets (gphoto_driver *gphoto, int *cnt)
 
void gphoto_get_minmax_exposure (gphoto_driver *gphoto, double *min, double *max)
 
void gphoto_set_format (gphoto_driver *gphoto, int format)
 
int gphoto_get_format_current (gphoto_driver *gphoto)
 
int gphoto_get_iso_current (gphoto_driver *gphoto)
 
gphoto_drivergphoto_open (Camera *camera, GPContext *context, const char *model, const char *port, const char *shutter_release_port)
 
int gphoto_close (gphoto_driver *gphoto)
 
gphoto_widgetgphoto_get_widget_info (gphoto_driver *gphoto, gphoto_widget_list **iter)
 
static void find_all_widgets (gphoto_driver *gphoto, CameraWidget *widget, char *prefix)
 
gphoto_widget_listgphoto_find_all_widgets (gphoto_driver *gphoto)
 
void gphoto_show_options (gphoto_driver *gphoto)
 
void gphoto_get_buffer (gphoto_driver *gphoto, const char **buffer, size_t *size)
 
void gphoto_free_buffer (gphoto_driver *gphoto)
 
const char * gphoto_get_file_extension (gphoto_driver *gphoto)
 
int gphoto_get_dimensions (gphoto_driver *gphoto, int *width, int *height)
 
static int _lookup_widget (CameraWidget *widget, const char *key, CameraWidget **child)
 
int gphoto_auto_focus (gphoto_driver *gphoto, char *errMsg)
 
int gphoto_capture_preview (gphoto_driver *gphoto, CameraFile *previewFile, char *errMsg)
 
int gphoto_start_preview (gphoto_driver *gphoto)
 
int gphoto_stop_preview (gphoto_driver *gphoto)
 
int gphoto_manual_focus (gphoto_driver *gphoto, int xx, char *errMsg)
 
const char * gphoto_get_manufacturer (gphoto_driver *gphoto)
 
const char * gphoto_get_model (gphoto_driver *gphoto)
 
int gphoto_get_capture_target (gphoto_driver *gphoto, int *capture_target)
 
int gphoto_set_capture_target (gphoto_driver *gphoto, int capture_target)
 
int gphoto_delete_sdcard_image (gphoto_driver *gphoto, bool delete_sdcard_image)
 

Variables

static GPPortInfoList * portinfolist = nullptr
 
static CameraAbilitiesList * abilities = nullptr
 
static char device [64]
 
int RTS_flag = TIOCM_RTS
 

Macro Definition Documentation

◆ EOS_CUSTOMFUNCEX

#define EOS_CUSTOMFUNCEX   "customfuncex"

◆ EOS_MIRROR_LOCKUP_DISABLE

#define EOS_MIRROR_LOCKUP_DISABLE   "20,1,3,14,1,60f,1,0"

◆ EOS_MIRROR_LOCKUP_ENABLE

#define EOS_MIRROR_LOCKUP_ENABLE   "20,1,3,14,1,60f,1,1"

◆ GPHOTO_MATCH_WIDGET

#define GPHOTO_MATCH_WIDGET (   widget1,
  widget2 
)    (widget2 && widget1 == widget2->widget)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DSLR_CMD_BULB_CAPTURE 
DSLR_CMD_CAPTURE 
DSLR_CMD_ABORT 
DSLR_CMD_DONE 
DSLR_CMD_THREAD_EXIT 

Function Documentation

◆ _lookup_widget()

static int _lookup_widget ( CameraWidget *  widget,
const char *  key,
CameraWidget **  child 
)
static

◆ download_image()

static int download_image ( gphoto_driver gphoto,
CameraFilePath *  fn,
int  fd 
)
static

◆ find_all_widgets()

static void find_all_widgets ( gphoto_driver gphoto,
CameraWidget *  widget,
char *  prefix 
)
static

◆ find_bulb_exposure()

int find_bulb_exposure ( gphoto_driver gphoto,
gphoto_widget widget 
)

◆ find_exposure_setting()

int find_exposure_setting ( gphoto_driver gphoto,
gphoto_widget widget,
uint32_t  exptime_usec 
)

◆ find_widget()

static gphoto_widget* find_widget ( gphoto_driver gphoto,
const char *  name 
)
static

◆ gphoto_abort_exposure()

int gphoto_abort_exposure ( gphoto_driver gphoto)

◆ gphoto_auto_focus()

int gphoto_auto_focus ( gphoto_driver gphoto,
char *  errMsg 
)

◆ gphoto_capture_preview()

int gphoto_capture_preview ( gphoto_driver gphoto,
CameraFile *  previewFile,
char *  errMsg 
)

◆ gphoto_close()

int gphoto_close ( gphoto_driver gphoto)

◆ gphoto_delete_sdcard_image()

int gphoto_delete_sdcard_image ( gphoto_driver gphoto,
bool  delete_sdcard_image 
)

◆ gphoto_find_all_widgets()

gphoto_widget_list* gphoto_find_all_widgets ( gphoto_driver gphoto)

◆ gphoto_free_buffer()

void gphoto_free_buffer ( gphoto_driver gphoto)

◆ gphoto_get_buffer()

void gphoto_get_buffer ( gphoto_driver gphoto,
const char **  buffer,
size_t *  size 
)

◆ gphoto_get_capture_target()

int gphoto_get_capture_target ( gphoto_driver gphoto,
int *  capture_target 
)

◆ gphoto_get_dimensions()

int gphoto_get_dimensions ( gphoto_driver gphoto,
int *  width,
int *  height 
)

◆ gphoto_get_exposure_presets()

char** gphoto_get_exposure_presets ( gphoto_driver gphoto,
int *  cnt 
)

◆ gphoto_get_file_extension()

const char* gphoto_get_file_extension ( gphoto_driver gphoto)

◆ gphoto_get_format_current()

int gphoto_get_format_current ( gphoto_driver gphoto)

◆ gphoto_get_formats()

char** gphoto_get_formats ( gphoto_driver gphoto,
int *  cnt 
)

◆ gphoto_get_iso()

char** gphoto_get_iso ( gphoto_driver gphoto,
int *  cnt 
)

◆ gphoto_get_iso_current()

int gphoto_get_iso_current ( gphoto_driver gphoto)

◆ gphoto_get_last_sensor_temperature()

float gphoto_get_last_sensor_temperature ( gphoto_driver gphoto)

◆ gphoto_get_manufacturer()

const char* gphoto_get_manufacturer ( gphoto_driver gphoto)

◆ gphoto_get_minmax_exposure()

void gphoto_get_minmax_exposure ( gphoto_driver gphoto,
double *  min,
double *  max 
)

◆ gphoto_get_model()

const char* gphoto_get_model ( gphoto_driver gphoto)

◆ gphoto_get_widget_info()

gphoto_widget* gphoto_get_widget_info ( gphoto_driver gphoto,
gphoto_widget_list **  iter 
)

◆ gphoto_manual_focus()

int gphoto_manual_focus ( gphoto_driver gphoto,
int  xx,
char *  errMsg 
)

◆ gphoto_mirrorlock()

int gphoto_mirrorlock ( gphoto_driver gphoto,
int  msec 
)

◆ gphoto_open()

gphoto_driver* gphoto_open ( Camera camera,
GPContext *  context,
const char *  model,
const char *  port,
const char *  shutter_release_port 
)

◆ gphoto_read_exposure()

int gphoto_read_exposure ( gphoto_driver gphoto)

◆ gphoto_read_exposure_fd()

int gphoto_read_exposure_fd ( gphoto_driver gphoto,
int  fd 
)

◆ gphoto_read_widget()

int gphoto_read_widget ( gphoto_widget widget)

◆ gphoto_set_capture_target()

int gphoto_set_capture_target ( gphoto_driver gphoto,
int  capture_target 
)

◆ gphoto_set_config()

int gphoto_set_config ( Camera camera,
CameraWidget *  config,
GPContext *  context 
)

◆ gphoto_set_debug()

void gphoto_set_debug ( const char *  name)

◆ gphoto_set_format()

void gphoto_set_format ( gphoto_driver gphoto,
int  format 
)

◆ gphoto_set_iso()

void gphoto_set_iso ( gphoto_driver gphoto,
int  iso 
)

◆ gphoto_set_upload_settings()

void gphoto_set_upload_settings ( gphoto_driver gphoto,
int  setting 
)

◆ gphoto_set_widget_num()

int gphoto_set_widget_num ( gphoto_driver gphoto,
gphoto_widget widget,
float  value 
)

◆ gphoto_set_widget_text()

int gphoto_set_widget_text ( gphoto_driver gphoto,
gphoto_widget widget,
const char *  str 
)

◆ gphoto_show_options()

void gphoto_show_options ( gphoto_driver gphoto)

◆ gphoto_start_exposure()

int gphoto_start_exposure ( gphoto_driver gphoto,
uint32_t  exptime_usec,
int  mirror_lock 
)

◆ gphoto_start_preview()

int gphoto_start_preview ( gphoto_driver gphoto)

◆ gphoto_stop_preview()

int gphoto_stop_preview ( gphoto_driver gphoto)

◆ gphoto_supports_temperature()

bool gphoto_supports_temperature ( gphoto_driver gphoto)

◆ gphoto_widget_changed()

int gphoto_widget_changed ( gphoto_widget widget)

◆ lookup_widget()

static const char* lookup_widget ( CameraWidget *  config,
const char *  key,
CameraWidget **  widget 
)
static

◆ parse_shutterspeed()

static double* parse_shutterspeed ( gphoto_driver gphoto,
char **  choices,
int  count 
)
static

◆ reset_settings()

static void reset_settings ( gphoto_driver gphoto)
static

◆ show_widget()

void show_widget ( gphoto_widget widget,
const char *  prefix 
)

◆ stop_bulb()

static void* stop_bulb ( void *  arg)
static

◆ widget_free()

static void widget_free ( gphoto_widget widget)
static

◆ widget_name()

static const char* widget_name ( CameraWidget *  widget)
static

Variable Documentation

◆ abilities

CameraAbilitiesList* abilities = nullptr
static

◆ device

char device[64]
static

◆ portinfolist

GPPortInfoList* portinfolist = nullptr
static

◆ RTS_flag

int RTS_flag = TIOCM_RTS