camlib
Documentation for camlib is still a work-in-progress
Loading...
Searching...
No Matches
Backend interface

Layer over OS-dependent I/O interface. More...

Classes

struct  PtpDeviceEntry
 Linked-list entry for a single USB device. More...
 

Macros

#define PTP_TIMEOUT   1000
 

Functions

struct PtpDeviceEntryptpusb_device_list (struct PtpRuntime *r)
 Get a linked list of USB or PTP Devices.
 
void ptpusb_free_device_list (struct PtpDeviceEntry *e)
 
int ptp_device_open (struct PtpRuntime *r, struct PtpDeviceEntry *entry)
 Open and connect to a device from the PtpDeviceEntry structure.
 
int ptp_device_init (struct PtpRuntime *r)
 Connects to the first PTP device it finds.
 
int ptp_cmd_write (struct PtpRuntime *r, void *to, int length)
 Send data over the raw command endpoint.
 
int ptp_cmd_read (struct PtpRuntime *r, void *to, int length)
 Receive raw data over the command endpoint.
 
int ptp_device_reset (struct PtpRuntime *r)
 Reset the USB endpoints if possible.
 
int ptp_send_packet (struct PtpRuntime *r, int length)
 Send packets in r->data.
 
int ptp_receive_all_packets (struct PtpRuntime *r)
 Receive all packets into r->data.
 
int ptp_read_int (struct PtpRuntime *r, void *to, int length)
 Poll the interrupt endpoint.
 
int ptp_device_close (struct PtpRuntime *r)
 Disconnect from the current device.
 
int ptpip_connect (struct PtpRuntime *r, const char *addr, int port, int extra_tmout)
 Connect to a TCP port on the default network adapter.
 
int ptpip_cmd_write (struct PtpRuntime *r, void *data, int size)
 
int ptpip_cmd_read (struct PtpRuntime *r, void *data, int size)
 
int ptpip_connect_events (struct PtpRuntime *r, const char *addr, int port)
 
int ptpip_event_send (struct PtpRuntime *r, void *data, int size)
 
int ptpip_event_read (struct PtpRuntime *r, void *data, int size)
 
int ptpip_close (struct PtpRuntime *r)
 
void ptpusb_free_device_list_entry (void *)
 
int ptpusb_get_status (struct PtpRuntime *r)
 Get status of connected device.
 

Detailed Description

Layer over OS-dependent I/O interface.

Macro Definition Documentation

◆ PTP_TIMEOUT

#define PTP_TIMEOUT   1000

Definition at line 10 of file cl_backend.h.

Function Documentation

◆ ptp_device_open()

int ptp_device_open ( struct PtpRuntime * r,
struct PtpDeviceEntry * entry )

Open and connect to a device from the PtpDeviceEntry structure.

Note
Sets kill switch to 0

◆ ptpip_connect()

int ptpip_connect ( struct PtpRuntime * r,
const char * addr,
int port,
int extra_tmout )

Connect to a TCP port on the default network adapter.

Note
Sets kill switch to 0

◆ ptpusb_device_list()

struct PtpDeviceEntry * ptpusb_device_list ( struct PtpRuntime * r)

Get a linked list of USB or PTP Devices.

Returns
linked list of devices or NULL if no devices are connected (or OS error)