pict
Documentation for pict is still a work-in-progress
 
Loading...
Searching...
No Matches
cl_backend.h
Go to the documentation of this file.
1
2#ifndef CL_BACKEND_H
3#define CL_BACKEND_H
4
9
10#define PTP_TIMEOUT 1000
11
14 struct PtpDeviceEntry *prev;
15
16 int id;
17 int vendor_id;
18 int product_id;
19
20 uint32_t endpoint_in;
21 uint32_t endpoint_out;
22 uint32_t endpoint_int;
23
24 char name[16];
25 char manufacturer[16];
26 void *device_handle_ptr;
27
28 struct PtpDeviceEntry *next;
29};
30
32int ptp_comm_init(struct PtpRuntime *r);
33
35void ptp_comm_deinit(struct PtpRuntime *r);
36
39struct PtpDeviceEntry *ptpusb_device_list(struct PtpRuntime *r);
40
41void ptpusb_free_device_list(struct PtpDeviceEntry *e);
42
45int ptp_device_open(struct PtpRuntime *r, struct PtpDeviceEntry *entry);
46
48int ptp_device_init(struct PtpRuntime *r);
49
51int ptp_cmd_write(struct PtpRuntime *r, void *to, int length);
53int ptp_cmd_read(struct PtpRuntime *r, void *to, int length);
54
56int ptp_device_reset(struct PtpRuntime *r);
57
59int ptp_send_packet(struct PtpRuntime *r, int length);
60
62int ptp_receive_all_packets(struct PtpRuntime *r);
63
65int ptp_read_int(struct PtpRuntime *r, void *to, int length);
66
68int ptp_device_close(struct PtpRuntime *r);
69
72int ptpip_connect(struct PtpRuntime *r, const char *addr, int port, int extra_tmout);
73int ptpip_cmd_write(struct PtpRuntime *r, void *data, int size);
74int ptpip_cmd_read(struct PtpRuntime *r, void *data, int size);
75
76int ptpip_connect_events(struct PtpRuntime *r, const char *addr, int port);
77int ptpip_event_send(struct PtpRuntime *r, void *data, int size);
78int ptpip_event_read(struct PtpRuntime *r, void *data, int size);
79
80int ptpip_close(struct PtpRuntime *r);
81
82void ptpusb_free_device_list_entry(void *);
83
85int ptpusb_get_status(struct PtpRuntime *r);
86
88
89#endif
int ptp_cmd_write(struct PtpRuntime *r, void *to, int length)
Send data over the raw command endpoint.
int ptp_device_reset(struct PtpRuntime *r)
Reset the USB endpoints if possible.
int ptpusb_get_status(struct PtpRuntime *r)
Get status of connected device.
int ptp_cmd_read(struct PtpRuntime *r, void *to, int length)
Receive raw data over the command endpoint.
int ptp_device_open(struct PtpRuntime *r, struct PtpDeviceEntry *entry)
Open and connect to a device from the PtpDeviceEntry structure.
void ptp_comm_deinit(struct PtpRuntime *r)
Deinitializes backend and frees all memory.
struct PtpDeviceEntry * ptpusb_device_list(struct PtpRuntime *r)
Get a linked list of USB or PTP Devices.
int ptp_read_int(struct PtpRuntime *r, void *to, int length)
Poll the interrupt endpoint.
int ptp_device_init(struct PtpRuntime *r)
Connects to the first PTP device it finds.
int ptp_device_close(struct PtpRuntime *r)
Disconnect from the current device.
int ptp_receive_all_packets(struct PtpRuntime *r)
Receive all packets into r->data.
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 ptp_send_packet(struct PtpRuntime *r, int length)
Send packets in r->data.
int ptp_comm_init(struct PtpRuntime *r)
Initializes backend.
Linked-list entry for a single USB device.
Definition cl_backend.h:13