libgphoto2 photo camera library (libgphoto2) Internals
2.5.23
|
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ltdl.h>
#include <gphoto2/gphoto2-port-result.h>
#include <gphoto2/gphoto2-port-library.h>
#include <gphoto2/gphoto2-port-log.h>
#include "gphoto2-port-info.h"
Go to the source code of this file.
Data Structures | |
struct | _GPPortPrivateCore |
Internal private libgphoto2_port data. This structure contains private data. More... | |
Macros | |
#define | _DEFAULT_SOURCE |
#define | _(String) (String) |
#define | N_(String) (String) |
#define | ngettext(String1, String2, Count) ((Count==1)?String1:String2) |
#define | CHECK_RESULT(result) {int r=(result); if (r<0) return (r);} |
#define | CHECK_SUPP(p, t, o) {if (!(o)) {gp_port_set_error ((p), _("The operation '%s' is not supported by this device"), (t)); return (GP_ERROR_NOT_SUPPORTED);}} |
#define | CHECK_INIT(p) {if (!(p)->pc->ops) {gp_port_set_error ((p), _("The port has not yet been initialized")); return (GP_ERROR_BAD_PARAMETERS);}} |
#define | LOG_DATA(DATA, SIZE, EXPECTED, MSG_PRE, MSG_POST, ...) |
#define | FAST_TIMEOUT 50 |
Functions | |
int | gp_port_new (GPPort **port) |
Create new GPPort. More... | |
static int | gp_port_init (GPPort *port) |
static int | gp_port_exit (GPPort *port) |
int | gp_port_set_info (GPPort *port, GPPortInfo info) |
Configure a port. More... | |
int | gp_port_get_info (GPPort *port, GPPortInfo *info) |
Retreives information about the port. More... | |
int | gp_port_open (GPPort *port) |
Open a port. More... | |
int | gp_port_close (GPPort *port) |
Close a port. More... | |
int | gp_port_reset (GPPort *port) |
Reset a port. More... | |
int | gp_port_free (GPPort *port) |
Free the port structure. More... | |
int | gp_port_write (GPPort *port, const char *data, int size) |
Writes a specified amount of data to a port. More... | |
int | gp_port_read (GPPort *port, char *data, int size) |
Read data from port. More... | |
int | gp_port_check_int (GPPort *port, char *data, int size) |
Check for intterupt. More... | |
int | gp_port_check_int_fast (GPPort *port, char *data, int size) |
Check for interrupt without wait. More... | |
int | gp_port_set_timeout (GPPort *port, int timeout) |
Set timeout of port. More... | |
int | gp_port_timeout_set (GPPort *, int) |
int | gp_port_timeout_get (GPPort *, int *) |
int | gp_port_get_timeout (GPPort *port, int *timeout) |
Get the current port timeout. More... | |
int | gp_port_set_settings (GPPort *port, GPPortSettings settings) |
Set port settings. More... | |
int | gp_port_settings_get (GPPort *, GPPortSettings *) |
int | gp_port_settings_set (GPPort *, GPPortSettings) |
int | gp_port_get_settings (GPPort *port, GPPortSettings *settings) |
Get the current port settings. More... | |
int | gp_port_get_pin (GPPort *port, GPPin pin, GPLevel *level) |
Get setting of specific serial PIN. More... | |
int | gp_port_set_pin (GPPort *port, GPPin pin, GPLevel level) |
Set specified serial PIN to value. More... | |
int | gp_port_send_break (GPPort *port, int duration) |
Send a break over a serial port. More... | |
int | gp_port_flush (GPPort *port, int direction) |
Flush data on serial port. More... | |
int | gp_port_usb_find_device (GPPort *port, int idvendor, int idproduct) |
Find USB device by vendor/product. More... | |
int | gp_port_usb_find_device_by_class (GPPort *port, int mainclass, int subclass, int protocol) |
Find USB device by interface class. More... | |
int | gp_port_usb_clear_halt (GPPort *port, int ep) |
Clear USB endpoint HALT condition. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | gp_port_seek (GPPort *port, int offset, int whence) |
Seek on a port (for usb disk direct ports) More... | |
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) More... | |
int | gp_port_set_error (GPPort *port, const char *format,...) |
Set verbose port error message. More... | |
const char * | gp_port_get_error (GPPort *port) |
Get verbose port error message. More... | |
Variables | |
struct { | |
GPPin pin | |
unsigned char number | |
const char * description_short | |
const char * description_long | |
} | PinTable [] |
struct { | |
GPLevel level | |
const char * description | |
} | LevelTable [] |
Definition in file gphoto2-port.c.
#define _ | ( | String | ) | (String) |
Definition at line 54 of file gphoto2-port.c.
#define _DEFAULT_SOURCE |
Definition at line 27 of file gphoto2-port.c.
#define CHECK_INIT | ( | p | ) | {if (!(p)->pc->ops) {gp_port_set_error ((p), _("The port has not yet been initialized")); return (GP_ERROR_BAD_PARAMETERS);}} |
Definition at line 61 of file gphoto2-port.c.
Definition at line 59 of file gphoto2-port.c.
#define CHECK_SUPP | ( | p, | |
t, | |||
o | |||
) | {if (!(o)) {gp_port_set_error ((p), _("The operation '%s' is not supported by this device"), (t)); return (GP_ERROR_NOT_SUPPORTED);}} |
Definition at line 60 of file gphoto2-port.c.
#define FAST_TIMEOUT 50 |
The timeout in milliseconds for fast interrupt reads.
Definition at line 483 of file gphoto2-port.c.
#define LOG_DATA | ( | DATA, | |
SIZE, | |||
EXPECTED, | |||
MSG_PRE, | |||
MSG_POST, | |||
... | |||
) |
Definition at line 63 of file gphoto2-port.c.
#define N_ | ( | String | ) | (String) |
Definition at line 55 of file gphoto2-port.c.
#define ngettext | ( | String1, | |
String2, | |||
Count | |||
) | ((Count==1)?String1:String2) |
Definition at line 56 of file gphoto2-port.c.
int gp_port_check_int | ( | GPPort * | port, |
char * | data, | ||
int | size | ||
) |
Check for intterupt.
port | a GPPort |
data | a pointer to an allocated buffer |
size | the number of bytes that should be read |
Reads a specified number of bytes from the interrupt endpoint into the supplied buffer. Function waits port->timeout miliseconds for data on interrupt endpoint.
Definition at line 463 of file gphoto2-port.c.
References CHECK_INIT, _GPPortOperations::check_int, CHECK_RESULT, CHECK_SUPP, gp_log(), GP_LOG_DATA, LOG_DATA, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPort::timeout.
int gp_port_check_int_fast | ( | GPPort * | port, |
char * | data, | ||
int | size | ||
) |
Check for interrupt without wait.
port | a GPPort |
data | a pointer to an allocated buffer |
size | the number of bytes that should be read |
Reads a specified number of bytes from the inerrupt endpoint into the supplied buffer. Function waits 50 miliseconds for data on interrupt endpoint.
Definition at line 496 of file gphoto2-port.c.
References CHECK_INIT, _GPPortOperations::check_int, CHECK_RESULT, CHECK_SUPP, FAST_TIMEOUT, gp_log(), GP_LOG_DATA, LOG_DATA, _GPPortPrivateCore::ops, and _GPPort::pc.
int gp_port_close | ( | GPPort * | port | ) |
Close a port.
port | a GPPort |
Closes a port temporarily. It can afterwards be reopened using gp_port_open.
Definition at line 297 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, _GPPortOperations::close, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
Referenced by gp_camera_exit(), gp_camera_init(), and gp_port_free().
|
static |
Definition at line 124 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, _GPPortOperations::exit, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
Referenced by gp_port_free(), and gp_port_set_info().
int gp_port_flush | ( | GPPort * | port, |
int | direction | ||
) |
Flush data on serial port.
port | a GPPort |
direction | the direction of the flush |
Flushes the serial output or input (depending on direction) of the serial port.
Definition at line 762 of file gphoto2-port.c.
References CHECK_RESULT, CHECK_SUPP, _GPPortOperations::flush, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
int gp_port_free | ( | GPPort * | port | ) |
Free the port structure.
port | a GPPort |
Closes the port and frees the memory.
Definition at line 341 of file gphoto2-port.c.
References GP_OK, gp_port_close(), gp_port_exit(), _GPPortPrivateCore::info, _GPPortPrivateCore::lh, _GPPortInfo::library_filename, _GPPortInfo::name, _GPPortPrivateCore::ops, _GPPortInfo::path, and _GPPort::pc.
Referenced by gp_abilities_list_detect(), gp_camera_free(), and gp_port_new().
const char* gp_port_get_error | ( | GPPort * | port | ) |
Get verbose port error message.
port | a GPPort |
Retrieves an error message from a port. If you want to make sure that you get correct error messages, you need to call gp_port_set_error with an error message of NULL each time before calling another port-related function of which you want to check the return value.
Definition at line 1210 of file gphoto2-port.c.
References _, _GPPortPrivateCore::error, and _GPPort::pc.
int gp_port_get_info | ( | GPPort * | port, |
GPPortInfo * | info | ||
) |
Retreives information about the port.
Retrieves the informations set by gp_port_set_info().
port | a GPPort |
info | GPPortInfo |
Definition at line 255 of file gphoto2-port.c.
References GP_OK, _GPPortPrivateCore::info, and _GPPort::pc.
Referenced by gp_camera_get_port_info(), and gp_camera_init().
Get setting of specific serial PIN.
port | a GPPort |
pin | the serial pin to be retrieved |
level | the setting of the pin |
Definition at line 651 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, _GPPortOperations::get_pin, GP_OK, level, _GPPortPrivateCore::ops, _GPPort::pc, and pin.
int gp_port_get_settings | ( | GPPort * | port, |
GPPortSettings * | settings | ||
) |
Get the current port settings.
port | a GPPort |
settings | pointer to the retrieved settings |
Retreives the current settings of a port.
Definition at line 632 of file gphoto2-port.c.
References GP_OK, and _GPPort::settings.
Referenced by gp_camera_set_port_speed(), and gp_port_settings_get().
int gp_port_get_timeout | ( | GPPort * | port, |
int * | timeout | ||
) |
Get the current port timeout.
port | a GPPort |
timeout | pointer to timeout |
Retreives the current timeout of the port.
Definition at line 568 of file gphoto2-port.c.
References GP_OK, and _GPPort::timeout.
Referenced by gp_port_timeout_get().
|
static |
Definition at line 112 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, GP_OK, _GPPortOperations::init, _GPPortPrivateCore::ops, and _GPPort::pc.
Referenced by gp_port_set_info().
int gp_port_new | ( | GPPort ** | port | ) |
Create new GPPort.
Allocate and initialize the memory for a new GPPort.
After you called this function, you probably want to call gp_port_set_info in order to make the newly created port functional.
port | Pointer the GPPort* pointer |
Definition at line 94 of file gphoto2-port.c.
References GP_ERROR_NO_MEMORY, GP_OK, and gp_port_free().
Referenced by gp_abilities_list_detect(), and gp_camera_new().
int gp_port_open | ( | GPPort * | port | ) |
Open a port.
port | a GPPort |
Opens a port which should have been created with gp_port_new and configured with gp_port_set_info and gp_port_set_settings
Definition at line 273 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_OK, GP_PORT_SERIAL, GP_PORT_USB, _GPPortOperations::open, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPort::type.
Referenced by gp_camera_exit(), and gp_camera_init().
int gp_port_read | ( | GPPort * | port, |
char * | data, | ||
int | size | ||
) |
Read data from port.
port | a GPPort |
data | a pointer to an allocated buffer |
size | the number of bytes that should be read |
Reads a specified number of bytes from the port into the supplied buffer. It returns the number of bytes read or a negative error code.
Definition at line 427 of file gphoto2-port.c.
References CHECK_INIT, CHECK_SUPP, gp_log(), GP_LOG_DATA, gp_port_result_as_string(), LOG_DATA, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::read.
int gp_port_reset | ( | GPPort * | port | ) |
Reset a port.
port | a GPPort |
Resets a port. Device will likely reconnect and appear under a new id.
Definition at line 319 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_OK, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::reset.
int gp_port_seek | ( | GPPort * | port, |
int | offset, | ||
int | whence | ||
) |
Seek on a port (for usb disk direct ports)
port | a GPPort |
offset | offset to seek to |
whence | the underlying lseek call whence parameter |
Seeks to a specific offset on the usb disk
Definition at line 1084 of file gphoto2-port.c.
References CHECK_INIT, CHECK_SUPP, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::seek.
int gp_port_send_break | ( | GPPort * | port, |
int | duration | ||
) |
Send a break over a serial port.
port | a GPPort |
duration | duration of break in milliseconds |
Sends a break with the specified duration in milliseconds.
Definition at line 737 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_OK, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::send_break.
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)
port | a GPPort |
to_dev | data direction, set to 1 for a scsi cmd which sends data to the device, set to 0 for cmds which read data from the dev. |
cmd | buffer holding the command to send |
cmd_size | sizeof cmd buffer |
sense | buffer for returning scsi sense information |
sense_size | sizeof sense buffer |
data | buffer containing informatino to write to the device (to_dev is 1), or to store data read from the device (to_dev 0). |
Send a SCSI command to a usb scsi port attached device.
Definition at line 1118 of file gphoto2-port.c.
References CHECK_INIT, CHECK_SUPP, GP_LOG_DATA, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::send_scsi_cmd.
int gp_port_set_error | ( | GPPort * | port, |
const char * | format, | ||
... | |||
) |
Set verbose port error message.
port | a GPPort |
format | printf style format string |
... | variable arguments depending on format string |
Sets an error message that can later be retrieved using gp_port_get_error.
Definition at line 1180 of file gphoto2-port.c.
References _, _GPPortPrivateCore::error, GP_OK, and _GPPort::pc.
Referenced by gp_abilities_list_detect().
int gp_port_set_info | ( | GPPort * | port, |
GPPortInfo | info | ||
) |
Configure a port.
Makes a port functional by passing in the necessary path information (from the serial:/dev/ttyS0 or similar variables). After calling this function, you can access the port using for example gp_port_open().
port | a GPPort |
info | the GPPortInfo to set |
Definition at line 149 of file gphoto2-port.c.
References _GPPortSettingsUSB::altsetting, _GPPortSettingsSerial::bits, CHECK_RESULT, _GPPortSettingsUSB::config, GP_ERROR_LIBRARY, GP_ERROR_NOT_SUPPORTED, GP_OK, gp_port_exit(), gp_port_init(), GP_PORT_SERIAL, gp_port_set_settings(), gp_port_set_timeout(), GP_PORT_USB, GP_PORT_USB_DISK_DIRECT, GP_PORT_USB_SCSI, _GPPortSettingsUSB::inep, _GPPortPrivateCore::info, _GPPortSettingsUSB::interface, _GPPortPrivateCore::lh, _GPPortInfo::library_filename, _GPPortInfo::name, _GPPortPrivateCore::ops, _GPPortSettingsUSB::outep, _GPPortSettingsSerial::parity, _GPPortInfo::path, _GPPortSettingsUsbDiskDirect::path, _GPPortSettingsUsbScsi::path, _GPPort::pc, _GPPortSettingsUSB::port, _GPPortSettings::serial, _GPPort::settings, _GPPortSettingsSerial::speed, _GPPortSettingsSerial::stopbits, _GPPortInfo::type, _GPPort::type, _GPPortSettings::usb, _GPPortSettings::usbdiskdirect, and _GPPortSettings::usbscsi.
Referenced by gp_abilities_list_detect(), and gp_camera_set_port_info().
Set specified serial PIN to value.
port | a GPPort |
pin | the serial pin to be retrieved |
level | the setting of the pin |
Pulls the specified pin of a serial port to the specified level.
Definition at line 703 of file gphoto2-port.c.
References _, CHECK_INIT, CHECK_RESULT, CHECK_SUPP, description, description_long, description_short, GP_OK, level, LevelTable, number, _GPPortPrivateCore::ops, _GPPort::pc, pin, PinTable, and _GPPortOperations::set_pin.
int gp_port_set_settings | ( | GPPort * | port, |
GPPortSettings | settings | ||
) |
Set port settings.
port | a GPPort |
settings | the GPPortSettings to be set |
Adjusts the settings of a port. You should always call gp_port_get_settings, adjust the values depending on the type of the port, and then call gp_port_set_settings.
Definition at line 590 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_OK, _GPPortPrivateCore::ops, _GPPort::pc, _GPPort::settings_pending, and _GPPortOperations::update.
Referenced by gp_camera_set_port_speed(), gp_port_set_info(), and gp_port_settings_set().
int gp_port_set_timeout | ( | GPPort * | port, |
int | timeout | ||
) |
Set timeout of port.
port | a GPPort |
timeout | the timeout |
Sets the timeout of a port. gp_port_read will wait timeout milliseconds for data. If no data will be received in that period, GP_ERROR_TIMEOUT will be returned.
Definition at line 534 of file gphoto2-port.c.
References GP_OK, and _GPPort::timeout.
Referenced by gp_port_set_info(), and gp_port_timeout_set().
int gp_port_settings_get | ( | GPPort * | port, |
GPPortSettings * | settings | ||
) |
int gp_port_settings_set | ( | GPPort * | port, |
GPPortSettings | settings | ||
) |
int gp_port_timeout_get | ( | GPPort * | port, |
int * | timeout | ||
) |
int gp_port_timeout_set | ( | GPPort * | port, |
int | timeout | ||
) |
int gp_port_usb_clear_halt | ( | GPPort * | port, |
int | ep | ||
) |
Clear USB endpoint HALT condition.
port | a GPPort |
ep | endpoint to clear HALT |
Clears the HALT (stall?) endpoint condition of the specified endpoint.
Definition at line 836 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, _GPPortOperations::clear_halt, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
int gp_port_usb_find_device | ( | GPPort * | port, |
int | idvendor, | ||
int | idproduct | ||
) |
Find USB device by vendor/product.
port | a GPPort |
idvendor | USB vendor id |
idproduct | USB product id |
Find the USB device with the specified vendor:product id pair.
Definition at line 790 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, _GPPortOperations::find_device, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
Referenced by gp_abilities_list_detect_usb(), and gp_camera_init().
int gp_port_usb_find_device_by_class | ( | GPPort * | port, |
int | mainclass, | ||
int | subclass, | ||
int | protocol | ||
) |
Find USB device by interface class.
port | a GPPort |
mainclass | the USB interface class |
subclass | the USB interface subclass |
protocol | the USB interface protocol |
Find the USB device with the specified vendor:product id pair.
Definition at line 814 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, _GPPortOperations::find_device_by_class, GP_OK, _GPPortPrivateCore::ops, and _GPPort::pc.
Referenced by gp_abilities_list_detect_usb(), and gp_camera_init().
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB class control command and read associated data.
Definition at line 1050 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, gp_log(), GP_LOG_DATA, LOG_DATA, _GPPortOperations::msg_class_read, _GPPortPrivateCore::ops, and _GPPort::pc.
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB class control command and write associated data.
Definition at line 1015 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_LOG_DATA, _GPPortOperations::msg_class_write, _GPPortPrivateCore::ops, and _GPPort::pc.
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB control command and read associated data.
Definition at line 972 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, gp_log(), GP_LOG_DATA, LOG_DATA, _GPPortOperations::msg_interface_read, _GPPortPrivateCore::ops, and _GPPort::pc.
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB interface control command and write associated data.
Definition at line 937 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_LOG_DATA, _GPPortOperations::msg_interface_write, _GPPortPrivateCore::ops, and _GPPort::pc.
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB interface control command and read associated data.
Definition at line 897 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, gp_log(), GP_LOG_DATA, LOG_DATA, _GPPortOperations::msg_read, _GPPortPrivateCore::ops, and _GPPort::pc.
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.
port | a GPPort |
request | control request code |
value | control value |
index | control index |
bytes | pointer to data |
size | size of the data |
Sends a specific USB control command and write associated data.
Definition at line 864 of file gphoto2-port.c.
References CHECK_INIT, CHECK_RESULT, CHECK_SUPP, GP_LOG_DATA, _GPPortOperations::msg_write, _GPPortPrivateCore::ops, and _GPPort::pc.
int gp_port_write | ( | GPPort * | port, |
const char * | data, | ||
int | size | ||
) |
Writes a specified amount of data to a port.
port | a GPPort |
data | the data to write to the port |
size | the number of bytes to write to the port |
Writes data to the port. On non-serial ports the amount of data written is returned (and not just GP_OK).
Definition at line 392 of file gphoto2-port.c.
References CHECK_INIT, CHECK_SUPP, gp_log(), GP_LOG_DATA, gp_port_result_as_string(), LOG_DATA, _GPPortPrivateCore::ops, _GPPort::pc, and _GPPortOperations::write.
const char* description |
Definition at line 684 of file gphoto2-port.c.
Referenced by gp_port_set_pin().
const char* description_long |
Definition at line 670 of file gphoto2-port.c.
Referenced by gp_port_set_pin().
const char* description_short |
Definition at line 669 of file gphoto2-port.c.
Referenced by gp_port_set_pin().
GPLevel level |
Definition at line 683 of file gphoto2-port.c.
Referenced by gp_log(), gp_log_add_func(), gp_log_with_source_location(), gp_logv(), gp_port_get_pin(), and gp_port_set_pin().
struct { ... } LevelTable[] |
Referenced by gp_port_set_pin().
unsigned char number |
Definition at line 668 of file gphoto2-port.c.
Referenced by gp_port_set_pin(), and gpi_jpeg_make_quantization().
GPPin pin |
Definition at line 667 of file gphoto2-port.c.
Referenced by gp_port_get_pin(), and gp_port_set_pin().
struct { ... } PinTable[] |
Referenced by gp_port_set_pin().