libgphoto2 photo camera library (libgphoto2) API
2.5.28
|
Go to the documentation of this file.
24 #ifndef LIBGPHOTO2_GPHOTO2_PORT_H
25 #define LIBGPHOTO2_GPHOTO2_PORT_H
30 #include <gphoto2/gphoto2-port-portability.h>
57 #define GP_PORT_MAX_BUF_LEN 4096
123 typedef struct _GPPortPrivateLibrary GPPortPrivateLibrary;
148 GPPortPrivateLibrary *
pl;
209 int index,
char *bytes,
int size);
211 int index,
char *bytes,
int size);
213 int value,
int index,
char *bytes,
int size);
215 int value,
int index,
char *bytes,
int size);
217 int value,
int index,
char *bytes,
int size);
219 int value,
int index,
char *bytes,
int size);
224 char *cmd,
int cmd_size,
225 char *sense,
int sense_size,
226 char *data,
int data_size);
231 __attribute__((__format__(printf,2,3)))
242 #define PIN_CTS GP_PIN_CTS
union _GPPortSettings GPPortSettings
Union of port settings.
Definition: gphoto2-port-info.h:32
struct _GPPortSettingsUsbScsi GPPortSettingsUsbScsi
Port settings for USB Mass Storage raw SCSI ports.
int gp_port_usb_msg_read(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB control message with input data.
Definition: gphoto2-port.c:884
GPPortSerialParity parity
Definition: gphoto2-port.h:66
int gp_port_get_info(GPPort *port, GPPortInfo *info)
Retreives information about the port.
Definition: gphoto2-port.c:242
struct _GPPort GPPort
The GPhoto port structure.
int gp_port_usb_msg_interface_write(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB interface control message with output data.
Definition: gphoto2-port.c:924
GPPortSettings gp_port_settings
Definition: gphoto2-port.h:240
int gp_port_get_settings(GPPort *port, GPPortSettings *settings)
Get the current port settings.
Definition: gphoto2-port.c:619
char path[128]
Definition: gphoto2-port.h:101
GPPort gp_port
Definition: gphoto2-port.h:238
int gp_port_get_pin(GPPort *port, GPPin pin, GPLevel *level)
Get setting of specific serial PIN.
Definition: gphoto2-port.c:638
@ GP_PIN_DTR
DTR line.
Definition: gphoto2-port.h:182
Port settings for USB Mass Storage raw SCSI ports.
Definition: gphoto2-port.h:100
int gp_port_new(GPPort **port)
Create new GPPort.
Definition: gphoto2-port.c:81
int gp_port_flush(GPPort *port, int direction)
Flush data on serial port.
Definition: gphoto2-port.c:749
int gp_port_set_info(GPPort *port, GPPortInfo info)
Configure a port.
Definition: gphoto2-port.c:136
int gp_port_set_settings(GPPort *port, GPPortSettings settings)
Set port settings.
Definition: gphoto2-port.c:577
GPPortSettingsUsbDiskDirect usbdiskdirect
usb disk direct port specific settings
Definition: gphoto2-port.h:113
GPPortPrivateCore * pc
Port library private data pointer.
Definition: gphoto2-port.h:149
enum _GPPortSerialParity GPPortSerialParity
Serial parity.
int intep
Interrupt endpoint used.
Definition: gphoto2-port.h:77
int gp_port_check_int(GPPort *port, char *data, int size)
Check for intterupt.
Definition: gphoto2-port.c:450
struct _GPPortSettingsUsbDiskDirect GPPortSettingsUsbDiskDirect
Port settings for USB mass storage direct IO ports.
@ GP_PIN_DSR
DSR line.
Definition: gphoto2-port.h:184
Port settings for USB ports.
Definition: gphoto2-port.h:74
int gp_port_set_pin(GPPort *port, GPPin pin, GPLevel level)
Set specified serial PIN to value.
Definition: gphoto2-port.c:690
int gp_port_usb_find_device(GPPort *port, int idvendor, int idproduct)
Find USB device by vendor/product.
Definition: gphoto2-port.c:777
@ GP_PIN_CTS
CTS line.
Definition: gphoto2-port.h:183
int gp_port_open(GPPort *port)
Open a port.
Definition: gphoto2-port.c:260
int maxpacketsize
Maximum USB packetsize of the IN endpoint. (r/o)
Definition: gphoto2-port.h:82
@ GP_PIN_RING
RING (Modem) line.
Definition: gphoto2-port.h:186
int config
USB bConfigurationValue used.
Definition: gphoto2-port.h:78
int gp_port_free(GPPort *port)
Free the port structure.
Definition: gphoto2-port.c:328
int gp_port_read(GPPort *port, char *data, int size)
Read data from port.
Definition: gphoto2-port.c:414
The GPhoto port structure.
Definition: gphoto2-port.h:139
int gp_port_usb_msg_write(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB control message with output data.
Definition: gphoto2-port.c:851
int gp_port_set_timeout(GPPort *port, int timeout)
Set timeout of port.
Definition: gphoto2-port.c:521
GPPortSettings settings_pending
Settings to be committed.
Definition: gphoto2-port.h:144
GPPortSettingsSerial serial
Serial specific settings.
Definition: gphoto2-port.h:111
@ GP_PIN_CD
Carrier Detect line.
Definition: gphoto2-port.h:185
GPPortSettingsUSB usb
USB specific settings.
Definition: gphoto2-port.h:112
Internal private libgphoto2_port data. This structure contains private data.
Definition: gphoto2-port.c:60
int inep
Bulk IN endpoint used.
Definition: gphoto2-port.h:75
@ GP_PIN_RTS
RTS line.
Definition: gphoto2-port.h:181
const char * gp_port_get_error(GPPort *port)
Get verbose port error message.
Definition: gphoto2-port.c:1197
int gp_port_reset(GPPort *port)
Reset a port.
Definition: gphoto2-port.c:306
int gp_port_close(GPPort *port)
Close a port.
Definition: gphoto2-port.c:284
struct _GPPortSettingsUSB GPPortSettingsUSB
Port settings for USB ports.
Port settings for USB mass storage direct IO ports.
Definition: gphoto2-port.h:93
@ GP_PORT_SERIAL_PARITY_ODD
Parity is odd.
Definition: gphoto2-port.h:53
int gp_port_send_scsi_cmd(GPPort *port, int to_dev, char *cmd, int cmd_size, char *sense, int sense_size, char *data, int data_size)
Send a SCSI command to a port (for usb scsi ports)
Definition: gphoto2-port.c:1105
int gp_port_usb_msg_class_write(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB class control message with output data.
Definition: gphoto2-port.c:1002
_GPPin
Serial pins.
Definition: gphoto2-port.h:180
_GPPortSerialParity
Serial parity.
Definition: gphoto2-port.h:50
int gp_port_usb_clear_halt(GPPort *port, int ep)
Clear USB endpoint HALT condition.
Definition: gphoto2-port.c:823
enum _GPLevel GPLevel
Level to pull specific lines.
@ GP_PORT_USB_ENDPOINT_OUT
USB bulk OUT ep.
Definition: gphoto2-port.h:119
int gp_port_send_break(GPPort *port, int duration)
Send a break over a serial port.
Definition: gphoto2-port.c:724
int outep
Bulk OUT endpoint used.
Definition: gphoto2-port.h:76
enum _GPPin GPPin
Serial pins.
_GPLevel
Level to pull specific lines.
Definition: gphoto2-port.h:194
int gp_port_seek(GPPort *port, int offset, int whence)
Seek on a port (for usb disk direct ports)
Definition: gphoto2-port.c:1071
char port[64]
USB Portname. Specific to lowlevel USB.
Definition: gphoto2-port.h:87
int gp_port_usb_msg_class_read(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB class control message with input data.
Definition: gphoto2-port.c:1037
Union of port settings.
Definition: gphoto2-port.h:110
@ GP_LEVEL_HIGH
Pull to high (nV)
Definition: gphoto2-port.h:196
GPPortSettingsUsbScsi usbscsi
usb scsi port specific settings
Definition: gphoto2-port.h:114
int gp_port_usb_msg_interface_read(GPPort *port, int request, int value, int index, char *bytes, int size)
Send a USB interface control message with input data.
Definition: gphoto2-port.c:959
@ GP_PORT_SERIAL_PARITY_EVEN
Parity is even.
Definition: gphoto2-port.h:52
@ GP_LEVEL_LOW
Pull to low (0V)
Definition: gphoto2-port.h:195
@ GP_PORT_USB_ENDPOINT_IN
USB bulk IN ep.
Definition: gphoto2-port.h:118
int gp_port_set_error(GPPort *port, const char *format,...)
Set verbose port error message.
Definition: gphoto2-port.c:1167
GPPortPrivateLibrary * pl
Camera driver private data pointer.
Definition: gphoto2-port.h:148
char path[128]
Definition: gphoto2-port.h:94
int gp_port_usb_find_device_by_class(GPPort *port, int mainclass, int subclass, int protocol)
Find USB device by interface class.
Definition: gphoto2-port.c:801
Port settings for serial ports.
Definition: gphoto2-port.h:62
int altsetting
USB Alternative Setting used.
Definition: gphoto2-port.h:80
int bits
Definition: gphoto2-port.h:65
int timeout
Port timeout in milliseconds.
Definition: gphoto2-port.h:146
@ GP_PORT_USB_ENDPOINT_INT
USB Interrupt ep.
Definition: gphoto2-port.h:120
int gp_port_check_int_fast(GPPort *port, char *data, int size)
Check for interrupt without wait.
Definition: gphoto2-port.c:483
GPPortSettings settings
Current port settings.
Definition: gphoto2-port.h:143
int gp_port_write(GPPort *port, const char *data, int size)
Writes a specified amount of data to a port.
Definition: gphoto2-port.c:379
struct _GPPortSettingsSerial GPPortSettingsSerial
Port settings for serial ports.
char port[128]
Definition: gphoto2-port.h:63
GPPortType type
Actual type of this port.
Definition: gphoto2-port.h:141
int stopbits
Definition: gphoto2-port.h:68
int interface
USB Interface number used.
Definition: gphoto2-port.h:79
int gp_port_get_timeout(GPPort *port, int *timeout)
Get the current port timeout.
Definition: gphoto2-port.c:555
@ GP_PORT_SERIAL_PARITY_OFF
Parity is off (disabled)
Definition: gphoto2-port.h:51
int speed
Definition: gphoto2-port.h:64
GPPortType
The gphoto port type.
Definition: gphoto2-port-info-list.h:34