00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GPHOTO2_PORT_LIBRARY_H__
00022 #define __GPHOTO2_PORT_LIBRARY_H__
00023
00024 #include <gphoto2-port-info-list.h>
00025 #include <gphoto2-port.h>
00026
00027 typedef struct _GPPortOperations GPPortOperations;
00028 struct _GPPortOperations {
00029 int (*init) (GPPort *);
00030 int (*exit) (GPPort *);
00031 int (*open) (GPPort *);
00032 int (*close) (GPPort *);
00033 int (*read) (GPPort *, char *, int);
00034 int (*check_int)(GPPort *, char *, int, int);
00035 int (*write) (GPPort *, const char *, int);
00036 int (*update) (GPPort *);
00037
00038
00039
00040
00041
00042 int (*get_pin) (GPPort *, GPPin, GPLevel*);
00043 int (*set_pin) (GPPort *, GPPin, GPLevel);
00044 int (*send_break)(GPPort *, int);
00045 int (*flush) (GPPort *, int);
00046
00047
00048 int (*find_device)(GPPort * dev, int idvendor, int idproduct);
00049 int (*find_device_by_class)(GPPort * dev, int class, int subclass, int protocol);
00050 int (*clear_halt) (GPPort * dev, int ep);
00051 int (*msg_write) (GPPort * dev, int request, int value, int index,
00052 char *bytes, int size);
00053 int (*msg_read) (GPPort * dev, int request, int value, int index,
00054 char *bytes, int size);
00055 int (*msg_interface_write) (GPPort * dev, int request,
00056 int value, int index, char *bytes, int size);
00057 int (*msg_interface_read) (GPPort * dev, int request,
00058 int value, int index, char *bytes, int size);
00059 };
00060
00061 typedef GPPortType (* GPPortLibraryType) (void);
00062 typedef int (* GPPortLibraryList) (GPPortInfoList *list);
00063
00064 typedef GPPortOperations *(* GPPortLibraryOperations) (void);
00065
00066
00067
00068
00069
00070
00071 GPPortType gp_port_library_type (void);
00072 int gp_port_library_list (GPPortInfoList *list);
00073
00074 GPPortOperations *gp_port_library_operations (void);
00075
00076 #endif