24 #ifndef __GPHOTO2_PORT_H__
25 #define __GPHOTO2_PORT_H__
32 #include <gphoto2/gphoto2-port-portability-os2.h>
61 #define GP_PORT_MAX_BUF_LEN 4096
213 int index,
char *bytes,
int size);
215 int index,
char *bytes,
int size);
217 int value,
int index,
char *bytes,
int size);
219 int value,
int index,
char *bytes,
int size);
221 int value,
int index,
char *bytes,
int size);
223 int value,
int index,
char *bytes,
int size);
228 char *cmd,
int cmd_size,
229 char *sense,
int sense_size,
230 char *data,
int data_size);
235 __attribute__((__format__(printf,2,3)))
246 #define PIN_CTS GP_PIN_CTS
GPPortType
The gphoto port type.
int gp_port_check_int(GPPort *port, char *data, int size)
Check for intterupt.
_GPPortSerialParity
Serial parity.
@ GP_PORT_SERIAL_PARITY_ODD
Parity is odd.
@ GP_PORT_SERIAL_PARITY_EVEN
Parity is even.
@ GP_PORT_SERIAL_PARITY_OFF
Parity is off (disabled)
int gp_port_write(GPPort *port, const char *data, int size)
Writes a specified amount of data to a port.
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.
int gp_port_reset(GPPort *port)
Reset a port.
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.
int gp_port_get_info(GPPort *port, GPPortInfo *info)
Retreives information about the port.
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.
int gp_port_get_timeout(GPPort *port, int *timeout)
Get the current port timeout.
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.
GPPortSettings gp_port_settings
int gp_port_set_info(GPPort *port, GPPortInfo info)
Configure a port.
union _GPPortSettings GPPortSettings
Union of port settings.
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.
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)
int gp_port_usb_find_device_by_class(GPPort *port, int mainclass, int subclass, int protocol)
Find USB device by interface class.
int gp_port_set_timeout(GPPort *port, int timeout)
Set timeout of port.
int gp_port_get_pin(GPPort *port, GPPin pin, GPLevel *level)
Get setting of specific serial PIN.
int gp_port_usb_find_device(GPPort *port, int idvendor, int idproduct)
Find USB device by vendor/product.
int gp_port_new(GPPort **port)
Create new GPPort.
struct _GPPortPrivateLibrary GPPortPrivateLibrary
struct _GPPortSettingsUSB GPPortSettingsUSB
Port settings for USB ports.
int gp_port_read(GPPort *port, char *data, int size)
Read data from port.
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.
_GPLevel
Level to pull specific lines.
@ GP_LEVEL_HIGH
Pull to high (nV)
@ GP_LEVEL_LOW
Pull to low (0V)
int gp_port_set_settings(GPPort *port, GPPortSettings settings)
Set port settings.
int gp_port_open(GPPort *port)
Open a port.
int gp_port_set_error(GPPort *port, const char *format,...)
Set verbose port error message.
struct _GPPortSettingsSerial GPPortSettingsSerial
Port settings for serial ports.
const char * gp_port_get_error(GPPort *port)
Get verbose port error message.
enum _GPPortSerialParity GPPortSerialParity
Serial parity.
int gp_port_check_int_fast(GPPort *port, char *data, int size)
Check for interrupt without wait.
int gp_port_send_break(GPPort *port, int duration)
Send a break over a serial port.
@ GP_PIN_CD
Carrier Detect line.
@ GP_PIN_RING
RING (Modem) line.
int gp_port_get_settings(GPPort *port, GPPortSettings *settings)
Get the current port settings.
int gp_port_free(GPPort *port)
Free the port structure.
struct _GPPortSettingsUsbScsi GPPortSettingsUsbScsi
Port settings for USB Mass Storage raw SCSI ports.
enum _GPLevel GPLevel
Level to pull specific lines.
struct _GPPort GPPort
The GPhoto port structure.
int gp_port_close(GPPort *port)
Close a port.
int gp_port_seek(GPPort *port, int offset, int whence)
Seek on a port (for usb disk direct ports)
int gp_port_flush(GPPort *port, int direction)
Flush data on serial port.
@ GP_PORT_USB_ENDPOINT_OUT
USB bulk OUT ep.
@ GP_PORT_USB_ENDPOINT_INT
USB Interrupt ep.
@ GP_PORT_USB_ENDPOINT_IN
USB bulk IN ep.
enum _GPPin GPPin
Serial pins.
struct _GPPortSettingsUsbDiskDirect GPPortSettingsUsbDiskDirect
Port settings for USB mass storage direct IO ports.
int gp_port_usb_clear_halt(GPPort *port, int ep)
Clear USB endpoint HALT condition.
int gp_port_set_pin(GPPort *port, GPPin pin, GPLevel level)
Set specified serial PIN to value.
Internal private libgphoto2_port data. This structure contains private data.
Port settings for serial ports.
GPPortSerialParity parity
Port settings for USB ports.
int outep
Bulk OUT endpoint used.
int inep
Bulk IN endpoint used.
int config
USB bConfigurationValue used.
char port[64]
USB Portname. Specific to lowlevel USB.
int maxpacketsize
Maximum USB packetsize of the IN endpoint. (r/o)
int interface
USB Interface number used.
int intep
Interrupt endpoint used.
int altsetting
USB Alternative Setting used.
Port settings for USB mass storage direct IO ports.
Port settings for USB Mass Storage raw SCSI ports.
The GPhoto port structure.
GPPortSettings settings_pending
Settings to be committed.
GPPortPrivateCore * pc
Port library private data pointer.
int timeout
Port timeout in milliseconds.
GPPortPrivateLibrary * pl
Camera driver private data pointer.
GPPortSettings settings
Current port settings.
GPPortType type
Actual type of this port.
GPPortSettingsUSB usb
USB specific settings.
GPPortSettingsUsbScsi usbscsi
usb scsi port specific settings
GPPortSettingsUsbDiskDirect usbdiskdirect
usb disk direct port specific settings
GPPortSettingsSerial serial
Serial specific settings.