diff --git a/camlib_8h.html b/camlib_8h.html index 259e945..0e1b63a 100644 --- a/camlib_8h.html +++ b/camlib_8h.html @@ -139,6 +139,9 @@   #define CAMLIB_SLEEP(ms)   + +#define PUB #define CAMLIB_DEFAULT_SIZE   1000000   @@ -237,30 +240,30 @@ const char * ptp_perror (int rc)  Evaluates PtpGeneralError into string message.
  - -int ptp_write_unicode_string (char *dat, char *string) -  - -int ptp_read_unicode_string (char *buffer, char *dat, int max) -  - -int ptp_read_utf8_string (void *dat, char *string, int max) -  - -int ptp_read_string (uint8_t *dat, char *string, int max) -  - -int ptp_write_string (uint8_t *dat, char *string) -  - -int ptp_write_utf8_string (void *dat, char *string) -  - -int ptp_read_uint16_array (uint8_t *dat, uint16_t *buf, int max, int *length) -  - -int ptp_read_uint16_array_s (uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length) -  + +PUB int ptp_write_unicode_string (char *dat, char *string) +  + +PUB int ptp_read_unicode_string (char *buffer, char *dat, int max) +  + +PUB int ptp_read_utf8_string (void *dat, char *string, int max) +  + +PUB int ptp_read_string (uint8_t *dat, char *string, int max) +  + +PUB int ptp_write_string (uint8_t *dat, char *string) +  + +PUB int ptp_write_utf8_string (void *dat, char *string) +  + +PUB int ptp_read_uint16_array (uint8_t *dat, uint16_t *buf, int max, int *length) +  + +PUB int ptp_read_uint16_array_s (uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length) +  int ptp_new_cmd_packet (struct PtpRuntime *r, struct PtpCommand *cmd)   diff --git a/camlib_8h_source.html b/camlib_8h_source.html index 22c083f..2830e10 100644 --- a/camlib_8h_source.html +++ b/camlib_8h_source.html @@ -117,286 +117,295 @@
23 #define CAMLIB_SLEEP(ms) usleep(ms * 1000)
24#endif
25
-
26// Logging+panic mechanism, define it yourself or link in log.c
-
27void ptp_verbose_log(char *fmt, ...);
-
28__attribute__ ((noreturn)) void ptp_panic(char *fmt, ...);
-
29
-
30// 1mb default buffer size
-
31#define CAMLIB_DEFAULT_SIZE 1000000
-
32
-
-
34enum PtpGeneralError {
-
35 PTP_OK = 0,
-
36 PTP_NO_DEVICE = -1,
-
37 PTP_NO_PERM = -2,
-
38 PTP_OPEN_FAIL = -3,
-
39 PTP_OUT_OF_MEM = -4,
-
40 PTP_IO_ERR = -5,
-
41 PTP_RUNTIME_ERR = -6,
-
42 PTP_UNSUPPORTED = -7,
-
43 PTP_CHECK_CODE = -8,
-
44 PTP_CANCELED = -9,
-
45};
+
26#ifdef WIN32
+
27#define PUB __declspec(dllexport)
+
28#else
+
29#define PUB
+
30#endif
+
31
+
32// Logging+panic mechanism, define it yourself or link in log.c
+
33void ptp_verbose_log(char *fmt, ...);
+
34__attribute__ ((noreturn)) void ptp_panic(char *fmt, ...);
+
35
+
36// 1mb default buffer size
+
37#define CAMLIB_DEFAULT_SIZE 1000000
+
38
+
+ +
41 PTP_OK = 0,
+
42 PTP_NO_DEVICE = -1,
+
43 PTP_NO_PERM = -2,
+
44 PTP_OPEN_FAIL = -3,
+
45 PTP_OUT_OF_MEM = -4,
+
46 PTP_IO_ERR = -5,
+
47 PTP_RUNTIME_ERR = -6,
+
48 PTP_UNSUPPORTED = -7,
+
49 PTP_CHECK_CODE = -8,
+
50 PTP_CANCELED = -9,
+
51};
-
46
-
48const char *ptp_perror(int rc);
-
49
-
50enum PtpLiveViewType {
-
51 PTP_LV_NONE = 0,
-
52 PTP_LV_EOS = 1,
-
53 PTP_LV_CANON = 2,
-
54 PTP_LV_ML = 3, // ptplv v1
-
55 PTP_LV_EOS_ML_BMP = 4, // ptplv v2
-
56};
-
57
-
- -
60 PTP_DEV_EMPTY = 0,
-
61 PTP_DEV_EOS = 1,
-
62 PTP_DEV_CANON = 2,
-
63 PTP_DEV_NIKON = 3,
-
64 PTP_DEV_SONY = 4,
-
65 PTP_DEV_FUJI = 5,
-
66 PTP_DEV_PANASONIC = 6,
-
67};
+
52
+
54const char *ptp_perror(int rc);
+
55
+
56enum PtpLiveViewType {
+
57 PTP_LV_NONE = 0,
+
58 PTP_LV_EOS = 1,
+
59 PTP_LV_CANON = 2,
+
60 PTP_LV_ML = 3, // ptplv v1
+
61 PTP_LV_EOS_ML_BMP = 4, // ptplv v2
+
62};
+
63
+
+ +
66 PTP_DEV_EMPTY = 0,
+
67 PTP_DEV_EOS = 1,
+
68 PTP_DEV_CANON = 2,
+
69 PTP_DEV_NIKON = 3,
+
70 PTP_DEV_SONY = 4,
+
71 PTP_DEV_FUJI = 5,
+
72 PTP_DEV_PANASONIC = 6,
+
73};
-
68
-
69// Wrapper types for vendor specific capture modes
-
70enum ImageFormats {
-
71 IMG_FORMAT_ETC = 0,
-
72 IMG_FORMAT_RAW = 1,
-
73 IMG_FORMAT_STD = 2,
-
74 IMG_FORMAT_HIGH = 3,
-
75 IMG_FORMAT_RAW_JPEG = 4,
-
76};
-
77
-
- -
80 PTP_IP = (1 << 0),
-
81 PTP_IP_USB = (1 << 1), // TCP-based, but using USB-style packets (Fujifilm)
-
82 PTP_USB = (1 << 2),
-
83};
+
74
+
75// Wrapper types for vendor specific capture modes
+
76enum ImageFormats {
+
77 IMG_FORMAT_ETC = 0,
+
78 IMG_FORMAT_RAW = 1,
+
79 IMG_FORMAT_STD = 2,
+
80 IMG_FORMAT_HIGH = 3,
+
81 IMG_FORMAT_RAW_JPEG = 4,
+
82};
+
83
+
+ +
86 PTP_IP = (1 << 0),
+
87 PTP_IP_USB = (1 << 1), // TCP-based, but using USB-style packets (Fujifilm)
+
88 PTP_USB = (1 << 2),
+
89};
-
84
-
- -
87 void *next;
-
88 void *prev;
-
89 int code;
-
90 int memb_size;
-
91 int memb_cnt;
-
92 void *data;
-
93};
+
90
+
+ +
93 void *next;
+
94 void *prev;
+
95 int code;
+
96 int memb_size;
+
97 int memb_cnt;
+
98 void *data;
+
99};
-
94
-
-
97struct PtpRuntime {
- -
102
- -
106
- -
109 int session;
-
110
-
113 uint8_t *data;
-
114 int data_length;
-
115
- -
119
-
122 struct PtpDeviceInfo *di;
-
123 int device_type;
-
124
- -
128
- -
131
-
132 void *userdata;
-
133
-
135 pthread_mutex_t *mutex;
-
136
- +
100
+
+ + +
108
+ +
112
+ +
115 int session;
+
116
+
119 uint8_t *data;
+
120 int data_length;
+
121
+ +
125
+
128 struct PtpDeviceInfo *di;
+
129 int device_type;
+
130
+ +
134
+ +
137
+
139 void *userdata;
140
- +
142 pthread_mutex_t *mutex;
143
- -
148
-
149 struct ObjectCache *oc;
-
150};
+ +
147
+ +
150
+ +
155
+
156 struct ObjectCache *oc;
+
157};
-
151
-
- -
154 uint16_t code;
-
155 const char *name;
-
156 int value;
-
157 const char *str_value;
-
158};
+
158
+
+ +
161 uint16_t code;
+
162 const char *name;
+
163 int value;
+
164 const char *str_value;
+
165};
-
159
-
- -
162 uint16_t code;
-
163 uint32_t params[5];
-
164 int param_length;
-
165 int data_length;
-
166};
+
166
+
+ +
169 uint16_t code;
+
170 uint32_t params[5];
+
171 int param_length;
+
172 int data_length;
+
173};
-
167
-
-
169struct PtpArray {
-
170 uint32_t length;
-
171 uint32_t data[];
-
172};
+
174
+
+
176struct PtpArray {
+
177 uint32_t length;
+
178 uint32_t data[];
+
179};
-
173
- -
178
- -
183
-
187uint32_t ptp_get_param(struct PtpRuntime *r, int i);
-
188
- -
193
-
197uint8_t *ptp_get_payload(struct PtpRuntime *r);
-
198
- -
203
-
206struct PtpRuntime *ptp_new(int options);
-
207
-
211void ptp_reset(struct PtpRuntime *r);
-
212
-
215void ptp_init(struct PtpRuntime *r);
-
216
-
219void ptp_close(struct PtpRuntime *r);
-
220
-
223int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd);
-
224
-
227int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length);
-
228
-
231int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec);
-
232
- -
236
- +
180
+ +
185
+ +
190
+
194PUB uint32_t ptp_get_param(struct PtpRuntime *r, int i);
+
195
+ +
200
+
204PUB uint8_t *ptp_get_payload(struct PtpRuntime *r);
+
205
+ +
210
+
213PUB struct PtpRuntime *ptp_new(int options);
+
214
+
218PUB void ptp_reset(struct PtpRuntime *r);
+
219
+
222PUB void ptp_init(struct PtpRuntime *r);
+
223
+
226PUB void ptp_close(struct PtpRuntime *r);
+
227
+
230PUB int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd);
+
231
+
234PUB int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length);
+
235
+
238PUB int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec);
+
239
+
242PUB void ptp_mutex_unlock(struct PtpRuntime *r);
243
- -
247
- -
252
-
256int ptp_check_opcode(struct PtpRuntime *r, int opcode);
-
257
-
261int ptp_check_prop(struct PtpRuntime *r, int code);
-
262
-
266int ptp_buffer_resize(struct PtpRuntime *r, size_t size);
-
267
-
268int ptp_write_unicode_string(char *dat, char *string);
-
269int ptp_read_unicode_string(char *buffer, char *dat, int max);
-
270int ptp_read_utf8_string(void *dat, char *string, int max);
-
271int ptp_read_string(uint8_t *dat, char *string, int max);
-
272int ptp_write_string(uint8_t *dat, char *string);
-
273int ptp_write_utf8_string(void *dat, char *string);
-
274int ptp_read_uint16_array(uint8_t *dat, uint16_t *buf, int max, int *length);
-
275int ptp_read_uint16_array_s(uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length);
-
276inline static int ptp_write_u8 (void *buf, uint8_t out) { ((uint8_t *)buf)[0] = out; return 1; }
-
277inline static int ptp_write_u16(void *buf, uint16_t out) { ((uint16_t *)buf)[0] = out; return 2; }
-
278inline static int ptp_write_u32(void *buf, uint32_t out) { ((uint32_t *)buf)[0] = out; return 4; }
-
279inline static int ptp_read_u32 (void *buf, uint32_t *out) { *out = ((uint32_t *)buf)[0]; return 4; }
-
280inline static int ptp_read_u16 (void *buf, uint16_t *out) { *out = ((uint16_t *)buf)[0]; return 2; }
-
281inline static int ptp_read_u8 (void *buf, uint8_t *out) { *out = ((uint8_t *)buf)[0]; return 1; }
-
282
-
283// Build a new PTP/IP or PTP/USB command packet in r->data
-
284int ptp_new_cmd_packet(struct PtpRuntime *r, struct PtpCommand *cmd);
-
285
-
286// Only for PTP_USB or PTP_USB_IP use
-
287int ptp_new_data_packet(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int data_length);
-
288
-
289// Only use for PTP_IP
-
290int ptpip_data_start_packet(struct PtpRuntime *r, int data_length);
-
291int ptpip_data_end_packet(struct PtpRuntime *r, void *data, int data_length);
-
292
-
293// Used only by ptp_open_session
-
294void ptp_update_transaction(struct PtpRuntime *r, int t);
-
295
-
296// Set avail info for prop
-
297void ptp_set_prop_avail_info(struct PtpRuntime *r, int code, int memb_size, int cnt, void *data);
-
298
-
299void *ptp_dup_payload(struct PtpRuntime *r);
+ +
250
+
253PUB void ptp_mutex_lock(struct PtpRuntime *r);
+
254
+
258PUB int ptp_device_type(struct PtpRuntime *r);
+
259
+
263PUB int ptp_check_opcode(struct PtpRuntime *r, int opcode);
+
264
+
268PUB int ptp_check_prop(struct PtpRuntime *r, int code);
+
269
+
273PUB int ptp_buffer_resize(struct PtpRuntime *r, size_t size);
+
274
+
275// Data structure functions
+
276PUB int ptp_write_unicode_string(char *dat, char *string);
+
277PUB int ptp_read_unicode_string(char *buffer, char *dat, int max);
+
278PUB int ptp_read_utf8_string(void *dat, char *string, int max);
+
279PUB int ptp_read_string(uint8_t *dat, char *string, int max);
+
280PUB int ptp_write_string(uint8_t *dat, char *string);
+
281PUB int ptp_write_utf8_string(void *dat, char *string);
+
282PUB int ptp_read_uint16_array(uint8_t *dat, uint16_t *buf, int max, int *length);
+
283PUB int ptp_read_uint16_array_s(uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length);
+
284inline static int ptp_write_u8 (void *buf, uint8_t out) { ((uint8_t *)buf)[0] = out; return 1; }
+
285inline static int ptp_write_u16(void *buf, uint16_t out) { ((uint16_t *)buf)[0] = out; return 2; }
+
286inline static int ptp_write_u32(void *buf, uint32_t out) { ((uint32_t *)buf)[0] = out; return 4; }
+
287inline static int ptp_read_u32 (void *buf, uint32_t *out) { *out = ((uint32_t *)buf)[0]; return 4; }
+
288inline static int ptp_read_u16 (void *buf, uint16_t *out) { *out = ((uint16_t *)buf)[0]; return 2; }
+
289inline static int ptp_read_u8 (void *buf, uint8_t *out) { *out = ((uint8_t *)buf)[0]; return 1; }
+
290
+
291// Build a new PTP/IP or PTP/USB command packet in r->data
+
292int ptp_new_cmd_packet(struct PtpRuntime *r, struct PtpCommand *cmd);
+
293
+
294// Only for PTP_USB or PTP_USB_IP use
+
295int ptp_new_data_packet(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int data_length);
+
296
+
297// Only use for PTP_IP
+
298int ptpip_data_start_packet(struct PtpRuntime *r, int data_length);
+
299int ptpip_data_end_packet(struct PtpRuntime *r, void *data, int data_length);
300
-
301// Write r->data to a file called DUMP
-
303int ptp_dump(struct PtpRuntime *r);
-
304
-
305#define CAMLIB_INCLUDE_IMPL
-
306#include "cl_data.h"
-
307#include "cl_backend.h"
-
308#include "cl_ops.h"
-
309#include "cl_enum.h"
-
310#include "cl_bind.h"
-
311
-
312// Backwards compatibility (mostly renamed functions)
-
313#ifndef CAMLIB_NO_COMPAT
-
314 #define ptp_get_last_transaction(...) ptp_get_last_transaction_id(__VA_ARGS__)
-
315 #define ptp_generic_new(...) ptp_new(__VA_ARGS__)
-
316 #define ptp_generic_close(...) ptp_close(__VA_ARGS__)
-
317 #define ptp_generic_reset(...) ptp_reset(__VA_ARGS__)
-
318 #define ptp_generic_init(...) ptp_init(__VA_ARGS__)
-
319 #define ptp_generic_send(...) ptp_send(__VA_ARGS__)
-
320 #define ptp_generic_send_data(...) ptp_send_data(__VA_ARGS__)
-
321#endif
-
322
-
323typedef void ptp_object_found_callback(struct PtpRuntime *r, struct PtpObjectInfo *oi, void *arg);
-
324
-
325// Object service api (object.c) - optional
-
326struct ObjectCache *ptp_create_object_service(int *handles, int length, ptp_object_found_callback *callback, void *arg);
-
327struct PtpObjectInfo *ptp_object_service_get(struct PtpRuntime *r, struct ObjectCache *oc, int handle);
-
328struct PtpObjectInfo *ptp_object_service_get_index(struct PtpRuntime *r, struct ObjectCache *oc, int req_i);
-
329int ptp_object_service_length(struct PtpRuntime *r, struct ObjectCache *oc);
-
330int ptp_object_service_step(struct PtpRuntime *r, struct ObjectCache *oc);
-
331void ptp_object_service_add_priority(struct PtpRuntime *r, struct ObjectCache *oc, int handle);
+
301// Used only by ptp_open_session
+
302void ptp_update_transaction(struct PtpRuntime *r, int t);
+
303
+
304// Set avail info for prop
+
305void ptp_set_prop_avail_info(struct PtpRuntime *r, int code, int memb_size, int cnt, void *data);
+
306
+
307void *ptp_dup_payload(struct PtpRuntime *r);
+
308
+
309// Write r->data to a file called DUMP
+
311int ptp_dump(struct PtpRuntime *r);
+
312
+
313#define CAMLIB_INCLUDE_IMPL
+
314#include "cl_data.h"
+
315#include "cl_backend.h"
+
316#include "cl_ops.h"
+
317#include "cl_enum.h"
+
318#include "cl_bind.h"
+
319
+
320// Backwards compatibility (mostly renamed functions)
+
321#ifndef CAMLIB_NO_COMPAT
+
322 #define ptp_get_last_transaction(...) ptp_get_last_transaction_id(__VA_ARGS__)
+
323 #define ptp_generic_new(...) ptp_new(__VA_ARGS__)
+
324 #define ptp_generic_close(...) ptp_close(__VA_ARGS__)
+
325 #define ptp_generic_reset(...) ptp_reset(__VA_ARGS__)
+
326 #define ptp_generic_init(...) ptp_init(__VA_ARGS__)
+
327 #define ptp_generic_send(...) ptp_send(__VA_ARGS__)
+
328 #define ptp_generic_send_data(...) ptp_send_data(__VA_ARGS__)
+
329#endif
+
330
+
331typedef void ptp_object_found_callback(struct PtpRuntime *r, struct PtpObjectInfo *oi, void *arg);
332
-
333#endif
+
333// Object service api (object.c) - optional
+
334// Not documented yet
+
335struct ObjectCache *ptp_create_object_service(int *handles, int length, ptp_object_found_callback *callback, void *arg);
+
336struct PtpObjectInfo *ptp_object_service_get(struct PtpRuntime *r, struct ObjectCache *oc, int handle);
+
337struct PtpObjectInfo *ptp_object_service_get_index(struct PtpRuntime *r, struct ObjectCache *oc, int req_i);
+
338int ptp_object_service_length(struct PtpRuntime *r, struct ObjectCache *oc);
+
339int ptp_object_service_step(struct PtpRuntime *r, struct ObjectCache *oc);
+
340void ptp_object_service_add_priority(struct PtpRuntime *r, struct ObjectCache *oc, int handle);
+
341
+
342#endif
int ptp_dump(struct PtpRuntime *r)
const char * ptp_perror(int rc)
Evaluates PtpGeneralError into string message.
-
PtpConnType
Tells lib what backend and packet style to use.
Definition camlib.h:79
-
PtpGeneralError
Camlib library errors, not PTP return codes.
Definition camlib.h:34
-
PtpVendors
Unique camera types - each type should have similar opcodes and behavior.
Definition camlib.h:59
+
PtpConnType
Tells lib what backend and packet style to use.
Definition camlib.h:85
+
PtpGeneralError
Camlib library errors, not PTP return codes.
Definition camlib.h:40
+
PtpVendors
Unique camera types - each type should have similar opcodes and behavior.
Definition camlib.h:65
-
Generic Struct for arrays.
Definition camlib.h:169
-
Generic PTP command structure - accepted by operation API.
Definition camlib.h:161
-
Generic event / property change.
Definition camlib.h:153
-
Linked list to handle currently possible values for a property.
Definition camlib.h:86
-
Holds all camlib instance info.
Definition camlib.h:97
-
struct PtpRuntime * ptp_new(int options)
Allocate new PtpRuntime based on bitfield options - see PtpConnType.
-
void ptp_reset(struct PtpRuntime *r)
Reset all session-specific fields of PtpRuntime - both libusb and libwpd backends call this before es...
-
uint8_t io_kill_switch
Set to 1 to kill all IO operations. By default, this is 1. When a valid connection is achieved by lib...
Definition camlib.h:101
-
int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)
Send a command request to the device with a data phase (thread safe)
-
int ptp_get_param_length(struct PtpRuntime *r)
Get number of parameters in packet in data buffer.
-
uint8_t response_wait_default
Default value for wait_for_response.
Definition camlib.h:142
-
void ptp_close(struct PtpRuntime *r)
Frees PtpRuntime data buffer - doesn't free the actual structure, or device info (yet)
-
int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec)
Try and get an event from the camera over int endpoint (USB-only)
-
int ptp_get_return_code(struct PtpRuntime *r)
Returns the return code (RC) currently in the data buffer.
-
void * comm_backend
For session comm/io structures (holds backend instance pointers)
Definition camlib.h:130
-
int ptp_check_prop(struct PtpRuntime *r, int code)
Check if a property code is supported by looking through supported props in r->di.
-
int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd)
Send a command request to the device with no data phase.
-
void ptp_init(struct PtpRuntime *r)
Init PtpRuntime locally - uses default recommended settings (USB)
-
uint8_t * data
Global buffer for data reading and writing.
Definition camlib.h:113
-
int ptp_get_payload_length(struct PtpRuntime *r)
Get length of payload returned by ptp_get_payload.
-
uint8_t * ptp_get_payload(struct PtpRuntime *r)
Get ptr of packet payload in data buffer, after packet header.
-
struct PtpPropAvail * avail
For devices that implement it, this will hold a linked list of properties and an array of their suppo...
Definition camlib.h:147
-
int ptp_get_last_transaction_id(struct PtpRuntime *r)
Get transaction ID of packet in the data buffer.
-
int transaction
Definition camlib.h:108
-
void ptp_mutex_keep_locked(struct PtpRuntime *r)
Keep the mutex locked one more time for the current thread.
-
void ptp_mutex_lock(struct PtpRuntime *r)
Lock the IO mutex - only should be used by backend.
-
int max_packet_size
Definition camlib.h:118
-
pthread_mutex_t * mutex
Optional (see CAMLIB_DONT_USE_MUTEX)
Definition camlib.h:135
-
int data_phase_length
For Windows compatibility, this is set to indicate lenth for a data packet that will be sent after a ...
Definition camlib.h:127
-
int ptp_buffer_resize(struct PtpRuntime *r, size_t size)
Mostly for internal use - realloc the data buffer.
-
uint32_t ptp_get_param(struct PtpRuntime *r, int i)
Get parameter at index i.
-
struct PtpDeviceInfo * di
Info about current connection, used to detect camera type, supported opodes, etc.
Definition camlib.h:122
-
uint8_t wait_for_response
Optionally wait up to 256 seconds for a response. Some PTP operations require this,...
Definition camlib.h:139
-
int ptp_check_opcode(struct PtpRuntime *r, int opcode)
Check if an opcode is supported by looking through supported props in r->di.
-
uint8_t connection_type
One of enum PtpConnType.
Definition camlib.h:105
-
void ptp_mutex_unlock(struct PtpRuntime *r)
Unlock the IO mutex (unless it was kept locked)
-
int ptp_device_type(struct PtpRuntime *r)
Gets type of device from r->di.
+
Generic Struct for arrays.
Definition camlib.h:176
+
Generic PTP command structure - accepted by operation API.
Definition camlib.h:168
+
Generic event / property change.
Definition camlib.h:160
+
Linked list to handle currently possible values for a property.
Definition camlib.h:92
+
Holds all camlib instance info.
Definition camlib.h:103
+
PUB int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd)
Send a command request to the device with no data phase.
+
PUB int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)
Send a command request to the device with a data phase (thread safe)
+
PUB int ptp_check_opcode(struct PtpRuntime *r, int opcode)
Check if an opcode is supported by looking through supported props in r->di.
+
PUB void ptp_init(struct PtpRuntime *r)
Init PtpRuntime locally - uses default recommended settings (USB)
+
PUB struct PtpRuntime * ptp_new(int options)
Allocate new PtpRuntime based on bitfield options - see PtpConnType.
+
void * userdata
Free pointer to hold per ptp session information.
Definition camlib.h:139
+
uint8_t io_kill_switch
Set to 1 to kill all IO operations. By default, this is 1. When a valid connection is achieved by lib...
Definition camlib.h:107
+
PUB int ptp_get_last_transaction_id(struct PtpRuntime *r)
Get transaction ID of packet in the data buffer.
+
PUB void ptp_reset(struct PtpRuntime *r)
Reset all session-specific fields of PtpRuntime - both libusb and libwpd backends call this before es...
+
PUB void ptp_mutex_lock(struct PtpRuntime *r)
Lock the IO mutex - only should be used by backend.
+
uint8_t response_wait_default
Default value for wait_for_response.
Definition camlib.h:149
+
PUB int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec)
Try and get an event from the camera over int endpoint (USB-only)
+
PUB void ptp_close(struct PtpRuntime *r)
Frees PtpRuntime data buffer - doesn't free the actual structure, or device info (yet)
+
void * comm_backend
For session comm/io structures (holds backend instance pointers)
Definition camlib.h:136
+
PUB uint8_t * ptp_get_payload(struct PtpRuntime *r)
Get ptr of packet payload in data buffer, after packet header.
+
PUB uint32_t ptp_get_param(struct PtpRuntime *r, int i)
Get parameter at index i.
+
PUB int ptp_check_prop(struct PtpRuntime *r, int code)
Check if a property code is supported by looking through supported props in r->di.
+
uint8_t * data
Global buffer for data reading and writing.
Definition camlib.h:119
+
struct PtpPropAvail * avail
For devices that implement it, this will hold a linked list of properties and an array of their suppo...
Definition camlib.h:154
+
int transaction
Definition camlib.h:114
+
PUB int ptp_get_param_length(struct PtpRuntime *r)
Get number of parameters in packet in data buffer.
+
int max_packet_size
Definition camlib.h:124
+
PUB void ptp_mutex_unlock(struct PtpRuntime *r)
Unlock the IO mutex (unless it was kept locked)
+
pthread_mutex_t * mutex
Optional (see CAMLIB_DONT_USE_MUTEX)
Definition camlib.h:142
+
PUB int ptp_buffer_resize(struct PtpRuntime *r, size_t size)
Mostly for internal use - realloc the data buffer.
+
int data_phase_length
For Windows compatibility, this is set to indicate lenth for a data packet that will be sent after a ...
Definition camlib.h:133
+
PUB int ptp_get_return_code(struct PtpRuntime *r)
Returns the return code (RC) currently in the data buffer.
+
struct PtpDeviceInfo * di
Info about current connection, used to detect camera type, supported opodes, etc.
Definition camlib.h:128
+
uint8_t wait_for_response
Optionally wait up to 256 seconds for a response. Some PTP operations require this,...
Definition camlib.h:146
+
PUB int ptp_device_type(struct PtpRuntime *r)
Gets type of device from r->di.
+
uint8_t connection_type
One of enum PtpConnType.
Definition camlib.h:111
+
PUB int ptp_get_payload_length(struct PtpRuntime *r)
Get length of payload returned by ptp_get_payload.
+
PUB void ptp_mutex_keep_locked(struct PtpRuntime *r)
Keep the mutex locked one more time for the current thread.
diff --git a/menudata.js b/menudata.js index 8f154f4..f7e4472 100644 --- a/menudata.js +++ b/menudata.js @@ -38,6 +38,7 @@ var menudata={children:[ {text:"p",url:"functions.html#index_p"}, {text:"r",url:"functions.html#index_r"}, {text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}, {text:"w",url:"functions.html#index_w"}]}, {text:"Functions",url:"functions_func.html",children:[ {text:"p",url:"functions_func.html#index_p"}]}, diff --git a/search/all_9.js b/search/all_9.js index f42f5eb..a9caa3a 100644 --- a/search/all_9.js +++ b/search/all_9.js @@ -5,37 +5,37 @@ var searchData= ['ptp_20extension_2',['CHDK PTP Extension',['../md_docs_2chdk.html',1,'']]], ['ptp_20ip_3',['PTP/IP',['../md_docs_2ptp.html#autotoc_md18',1,'']]], ['ptp_20standard_4',['Quick Overview of PTP Standard',['../md_docs_2ptp.html#autotoc_md16',1,'']]], - ['ptp_5fbuffer_5fresize_5',['ptp_buffer_resize',['../structPtpRuntime.html#ac2f65b693efaf4fc67b7837a312dfdd6',1,'PtpRuntime']]], - ['ptp_5fcheck_5fopcode_6',['ptp_check_opcode',['../structPtpRuntime.html#adc6ae466c463c890efb88a377cb7cf82',1,'PtpRuntime']]], - ['ptp_5fcheck_5fprop_7',['ptp_check_prop',['../structPtpRuntime.html#a593667104ac08ecfba4b8860f83941ec',1,'PtpRuntime']]], - ['ptp_5fclose_8',['ptp_close',['../structPtpRuntime.html#a378d9504c871c190fb65357e6d580066',1,'PtpRuntime']]], - ['ptp_5fdevice_5ftype_9',['ptp_device_type',['../structPtpRuntime.html#af1ec006631ba510bd761704bb6e1603d',1,'PtpRuntime']]], + ['ptp_5fbuffer_5fresize_5',['ptp_buffer_resize',['../structPtpRuntime.html#ab84ae8f97ce135a3702bb73959fc539c',1,'PtpRuntime']]], + ['ptp_5fcheck_5fopcode_6',['ptp_check_opcode',['../structPtpRuntime.html#a05fa160eba529edd8a9ac6d22bbd5fcc',1,'PtpRuntime']]], + ['ptp_5fcheck_5fprop_7',['ptp_check_prop',['../structPtpRuntime.html#a7dd626eb23a1d69947553c2d2166c8a3',1,'PtpRuntime']]], + ['ptp_5fclose_8',['ptp_close',['../structPtpRuntime.html#a4d45b4f344f3094e4ede7c114df077c3',1,'PtpRuntime']]], + ['ptp_5fdevice_5ftype_9',['ptp_device_type',['../structPtpRuntime.html#aea7de1759aa5bd4984f11ab2cf175308',1,'PtpRuntime']]], ['ptp_5fdownload_5fobject_10',['ptp_download_object',['../structPtpRuntime.html#a39a3a5f00b93263321de0080a9bfb639',1,'PtpRuntime']]], ['ptp_5fdump_11',['ptp_dump',['../camlib_8h.html#a3b2d987487466928731e65a97cfc4930',1,'camlib.h']]], ['ptp_5fget_5fall_5fknown_12',['ptp_get_all_known',['../structPtpRuntime.html#ae0d253bf202fa9823e1d49fb016f541f',1,'PtpRuntime']]], - ['ptp_5fget_5fevent_13',['ptp_get_event',['../structPtpRuntime.html#a3e33de856b2118fe5575e0fdde30cbd3',1,'PtpRuntime']]], - ['ptp_5fget_5flast_5ftransaction_5fid_14',['ptp_get_last_transaction_id',['../structPtpRuntime.html#a86c195e74507973ca1a0350686d24b48',1,'PtpRuntime']]], + ['ptp_5fget_5fevent_13',['ptp_get_event',['../structPtpRuntime.html#a38596b29d61a48351bbd2a4a4209d2fb',1,'PtpRuntime']]], + ['ptp_5fget_5flast_5ftransaction_5fid_14',['ptp_get_last_transaction_id',['../structPtpRuntime.html#a2b1c40137fa07ca3b73dd064571584c1',1,'PtpRuntime']]], ['ptp_5fget_5fobject_15',['ptp_get_object',['../structPtpRuntime.html#ab2a74dc474f1a9f03242a1ac689875ca',1,'PtpRuntime']]], ['ptp_5fget_5fobject_5fhandles_16',['ptp_get_object_handles',['../structPtpRuntime.html#ad09031095738de83df9db2c0bc358f92',1,'PtpRuntime']]], - ['ptp_5fget_5fparam_17',['ptp_get_param',['../structPtpRuntime.html#acff70238e2dd5babd15b60d030f3febe',1,'PtpRuntime']]], - ['ptp_5fget_5fparam_5flength_18',['ptp_get_param_length',['../structPtpRuntime.html#a34187785d86801a9fb4ccfac95c2b031',1,'PtpRuntime']]], + ['ptp_5fget_5fparam_17',['ptp_get_param',['../structPtpRuntime.html#a74f5a485857253fdc89dc8c434c3c7a9',1,'PtpRuntime']]], + ['ptp_5fget_5fparam_5flength_18',['ptp_get_param_length',['../structPtpRuntime.html#aa34e3e2e7836cce6dc6684ce4a11063c',1,'PtpRuntime']]], ['ptp_5fget_5fpartial_5fobject_19',['ptp_get_partial_object',['../structPtpRuntime.html#a1730ddab297b7c9f0a7619bf4f379571',1,'PtpRuntime']]], - ['ptp_5fget_5fpayload_20',['ptp_get_payload',['../structPtpRuntime.html#a82fdb25285ca30f1ca7614f416edad13',1,'PtpRuntime']]], - ['ptp_5fget_5fpayload_5flength_21',['ptp_get_payload_length',['../structPtpRuntime.html#a80bfd0417dabf76cae794215a4189b6c',1,'PtpRuntime']]], - ['ptp_5fget_5freturn_5fcode_22',['ptp_get_return_code',['../structPtpRuntime.html#a4684ca0e83e0459c7d039087f045ef6f',1,'PtpRuntime']]], + ['ptp_5fget_5fpayload_20',['ptp_get_payload',['../structPtpRuntime.html#a5b0a3f02a682c7f39e1e1611d200b27e',1,'PtpRuntime']]], + ['ptp_5fget_5fpayload_5flength_21',['ptp_get_payload_length',['../structPtpRuntime.html#af77f9c198842550488926acc6350a11b',1,'PtpRuntime']]], + ['ptp_5fget_5freturn_5fcode_22',['ptp_get_return_code',['../structPtpRuntime.html#abc99c07ece06a1f0e994630c6c5bb935',1,'PtpRuntime']]], ['ptp_5fget_5fstorage_5fids_23',['ptp_get_storage_ids',['../cl__ops_8h.html#a61bc40b52adf3c423d850587f0d368ba',1,'cl_ops.h']]], ['ptp_5fget_5fthumbnail_24',['ptp_get_thumbnail',['../structPtpRuntime.html#a1349640be24b23301f82338a4e89202e',1,'PtpRuntime']]], - ['ptp_5finit_25',['ptp_init',['../structPtpRuntime.html#a65b732f6e2c304199c07807323d7baac',1,'PtpRuntime']]], - ['ptp_5fmutex_5fkeep_5flocked_26',['ptp_mutex_keep_locked',['../structPtpRuntime.html#aa24a3ce43b4f53f37731bd03d9735129',1,'PtpRuntime']]], - ['ptp_5fmutex_5flock_27',['ptp_mutex_lock',['../structPtpRuntime.html#aa67c5de195afa6e1a456d1ad4d148e40',1,'PtpRuntime']]], - ['ptp_5fmutex_5funlock_28',['ptp_mutex_unlock',['../structPtpRuntime.html#aefec40a1a3fb4ad24414d51e22c11701',1,'PtpRuntime']]], - ['ptp_5fnew_29',['ptp_new',['../structPtpRuntime.html#a04ea9521e71a938fe5044153af439b7b',1,'PtpRuntime']]], + ['ptp_5finit_25',['ptp_init',['../structPtpRuntime.html#a13bae3755015236bc0d80f03262f8564',1,'PtpRuntime']]], + ['ptp_5fmutex_5fkeep_5flocked_26',['ptp_mutex_keep_locked',['../structPtpRuntime.html#afd673777a9471de1d465f16c570e8ed6',1,'PtpRuntime']]], + ['ptp_5fmutex_5flock_27',['ptp_mutex_lock',['../structPtpRuntime.html#a35af7e9c296ee5cdbfba5a981454f0a0',1,'PtpRuntime']]], + ['ptp_5fmutex_5funlock_28',['ptp_mutex_unlock',['../structPtpRuntime.html#aab6f6615255ef672a7170fac815c8fa3',1,'PtpRuntime']]], + ['ptp_5fnew_29',['ptp_new',['../structPtpRuntime.html#a16ebc69184e82c377375ff8fc663339a',1,'PtpRuntime']]], ['ptp_5fopen_5fsession_30',['ptp_open_session',['../structPtpRuntime.html#ac1f078ea0df6b7f09bba6af0643f10b5',1,'PtpRuntime']]], ['ptp_5fperror_31',['ptp_perror',['../camlib_8h.html#a4be7b7db9e745e655b26523a9429b009',1,'camlib.h']]], ['ptp_5fpre_5ftake_5fpicture_32',['ptp_pre_take_picture',['../structPtpRuntime.html#aa317218a1bbbd18bc3b20ae9db1624f9',1,'PtpRuntime']]], - ['ptp_5freset_33',['ptp_reset',['../structPtpRuntime.html#a1f04daa3a557f761a6413b05dc7bb7b3',1,'PtpRuntime']]], - ['ptp_5fsend_34',['ptp_send',['../structPtpRuntime.html#a5b05005f4add36b980e0aa5099eb381b',1,'PtpRuntime']]], - ['ptp_5fsend_5fdata_35',['ptp_send_data',['../structPtpRuntime.html#a33813c63d683fbaf32c9a5ac0b35968e',1,'PtpRuntime']]], + ['ptp_5freset_33',['ptp_reset',['../structPtpRuntime.html#a2b58d078aae65e43bca41d037ccdf2d5',1,'PtpRuntime']]], + ['ptp_5fsend_34',['ptp_send',['../structPtpRuntime.html#a025478ecd387e2c1be6dfb7cc41488ea',1,'PtpRuntime']]], + ['ptp_5fsend_5fdata_35',['ptp_send_data',['../structPtpRuntime.html#a04dd3974506089f9c0b248e94b34a0ed',1,'PtpRuntime']]], ['ptp_5fset_5fgeneric_5fproperty_36',['ptp_set_generic_property',['../structPtpRuntime.html#a14deac23d2f24cc1188c499a1255e5f9',1,'PtpRuntime']]], ['ptp_5ftake_5fpicture_37',['ptp_take_picture',['../structPtpRuntime.html#aace66256ef8a5a751e1b1bdf38787aa1',1,'PtpRuntime']]], ['ptparray_38',['PtpArray',['../structPtpArray.html',1,'']]], diff --git a/search/all_e.js b/search/all_e.js index d185073..2757e24 100644 --- a/search/all_e.js +++ b/search/all_e.js @@ -1,5 +1,4 @@ var searchData= [ - ['wait_5ffor_5fresponse_0',['wait_for_response',['../structPtpRuntime.html#adbd0410bdf4fe67efe17ddf0937195c4',1,'PtpRuntime']]], - ['wip_1',['Magic Lantern PTP Ext (WIP)',['../md_docs_2ml.html',1,'']]] + ['userdata_0',['userdata',['../structPtpRuntime.html#a237458ab782308367b392a36045d1486',1,'PtpRuntime']]] ]; diff --git a/search/all_f.js b/search/all_f.js new file mode 100644 index 0000000..d185073 --- /dev/null +++ b/search/all_f.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['wait_5ffor_5fresponse_0',['wait_for_response',['../structPtpRuntime.html#adbd0410bdf4fe67efe17ddf0937195c4',1,'PtpRuntime']]], + ['wip_1',['Magic Lantern PTP Ext (WIP)',['../md_docs_2ml.html',1,'']]] +]; diff --git a/search/functions_0.js b/search/functions_0.js index 05a1bef..eb0bd32 100644 --- a/search/functions_0.js +++ b/search/functions_0.js @@ -1,36 +1,36 @@ var searchData= [ - ['ptp_5fbuffer_5fresize_0',['ptp_buffer_resize',['../structPtpRuntime.html#ac2f65b693efaf4fc67b7837a312dfdd6',1,'PtpRuntime']]], - ['ptp_5fcheck_5fopcode_1',['ptp_check_opcode',['../structPtpRuntime.html#adc6ae466c463c890efb88a377cb7cf82',1,'PtpRuntime']]], - ['ptp_5fcheck_5fprop_2',['ptp_check_prop',['../structPtpRuntime.html#a593667104ac08ecfba4b8860f83941ec',1,'PtpRuntime']]], - ['ptp_5fclose_3',['ptp_close',['../structPtpRuntime.html#a378d9504c871c190fb65357e6d580066',1,'PtpRuntime']]], - ['ptp_5fdevice_5ftype_4',['ptp_device_type',['../structPtpRuntime.html#af1ec006631ba510bd761704bb6e1603d',1,'PtpRuntime']]], + ['ptp_5fbuffer_5fresize_0',['ptp_buffer_resize',['../structPtpRuntime.html#ab84ae8f97ce135a3702bb73959fc539c',1,'PtpRuntime']]], + ['ptp_5fcheck_5fopcode_1',['ptp_check_opcode',['../structPtpRuntime.html#a05fa160eba529edd8a9ac6d22bbd5fcc',1,'PtpRuntime']]], + ['ptp_5fcheck_5fprop_2',['ptp_check_prop',['../structPtpRuntime.html#a7dd626eb23a1d69947553c2d2166c8a3',1,'PtpRuntime']]], + ['ptp_5fclose_3',['ptp_close',['../structPtpRuntime.html#a4d45b4f344f3094e4ede7c114df077c3',1,'PtpRuntime']]], + ['ptp_5fdevice_5ftype_4',['ptp_device_type',['../structPtpRuntime.html#aea7de1759aa5bd4984f11ab2cf175308',1,'PtpRuntime']]], ['ptp_5fdownload_5fobject_5',['ptp_download_object',['../structPtpRuntime.html#a39a3a5f00b93263321de0080a9bfb639',1,'PtpRuntime']]], ['ptp_5fdump_6',['ptp_dump',['../camlib_8h.html#a3b2d987487466928731e65a97cfc4930',1,'camlib.h']]], ['ptp_5fget_5fall_5fknown_7',['ptp_get_all_known',['../structPtpRuntime.html#ae0d253bf202fa9823e1d49fb016f541f',1,'PtpRuntime']]], - ['ptp_5fget_5fevent_8',['ptp_get_event',['../structPtpRuntime.html#a3e33de856b2118fe5575e0fdde30cbd3',1,'PtpRuntime']]], - ['ptp_5fget_5flast_5ftransaction_5fid_9',['ptp_get_last_transaction_id',['../structPtpRuntime.html#a86c195e74507973ca1a0350686d24b48',1,'PtpRuntime']]], + ['ptp_5fget_5fevent_8',['ptp_get_event',['../structPtpRuntime.html#a38596b29d61a48351bbd2a4a4209d2fb',1,'PtpRuntime']]], + ['ptp_5fget_5flast_5ftransaction_5fid_9',['ptp_get_last_transaction_id',['../structPtpRuntime.html#a2b1c40137fa07ca3b73dd064571584c1',1,'PtpRuntime']]], ['ptp_5fget_5fobject_10',['ptp_get_object',['../structPtpRuntime.html#ab2a74dc474f1a9f03242a1ac689875ca',1,'PtpRuntime']]], ['ptp_5fget_5fobject_5fhandles_11',['ptp_get_object_handles',['../structPtpRuntime.html#ad09031095738de83df9db2c0bc358f92',1,'PtpRuntime']]], - ['ptp_5fget_5fparam_12',['ptp_get_param',['../structPtpRuntime.html#acff70238e2dd5babd15b60d030f3febe',1,'PtpRuntime']]], - ['ptp_5fget_5fparam_5flength_13',['ptp_get_param_length',['../structPtpRuntime.html#a34187785d86801a9fb4ccfac95c2b031',1,'PtpRuntime']]], + ['ptp_5fget_5fparam_12',['ptp_get_param',['../structPtpRuntime.html#a74f5a485857253fdc89dc8c434c3c7a9',1,'PtpRuntime']]], + ['ptp_5fget_5fparam_5flength_13',['ptp_get_param_length',['../structPtpRuntime.html#aa34e3e2e7836cce6dc6684ce4a11063c',1,'PtpRuntime']]], ['ptp_5fget_5fpartial_5fobject_14',['ptp_get_partial_object',['../structPtpRuntime.html#a1730ddab297b7c9f0a7619bf4f379571',1,'PtpRuntime']]], - ['ptp_5fget_5fpayload_15',['ptp_get_payload',['../structPtpRuntime.html#a82fdb25285ca30f1ca7614f416edad13',1,'PtpRuntime']]], - ['ptp_5fget_5fpayload_5flength_16',['ptp_get_payload_length',['../structPtpRuntime.html#a80bfd0417dabf76cae794215a4189b6c',1,'PtpRuntime']]], - ['ptp_5fget_5freturn_5fcode_17',['ptp_get_return_code',['../structPtpRuntime.html#a4684ca0e83e0459c7d039087f045ef6f',1,'PtpRuntime']]], + ['ptp_5fget_5fpayload_15',['ptp_get_payload',['../structPtpRuntime.html#a5b0a3f02a682c7f39e1e1611d200b27e',1,'PtpRuntime']]], + ['ptp_5fget_5fpayload_5flength_16',['ptp_get_payload_length',['../structPtpRuntime.html#af77f9c198842550488926acc6350a11b',1,'PtpRuntime']]], + ['ptp_5fget_5freturn_5fcode_17',['ptp_get_return_code',['../structPtpRuntime.html#abc99c07ece06a1f0e994630c6c5bb935',1,'PtpRuntime']]], ['ptp_5fget_5fstorage_5fids_18',['ptp_get_storage_ids',['../cl__ops_8h.html#a61bc40b52adf3c423d850587f0d368ba',1,'cl_ops.h']]], ['ptp_5fget_5fthumbnail_19',['ptp_get_thumbnail',['../structPtpRuntime.html#a1349640be24b23301f82338a4e89202e',1,'PtpRuntime']]], - ['ptp_5finit_20',['ptp_init',['../structPtpRuntime.html#a65b732f6e2c304199c07807323d7baac',1,'PtpRuntime']]], - ['ptp_5fmutex_5fkeep_5flocked_21',['ptp_mutex_keep_locked',['../structPtpRuntime.html#aa24a3ce43b4f53f37731bd03d9735129',1,'PtpRuntime']]], - ['ptp_5fmutex_5flock_22',['ptp_mutex_lock',['../structPtpRuntime.html#aa67c5de195afa6e1a456d1ad4d148e40',1,'PtpRuntime']]], - ['ptp_5fmutex_5funlock_23',['ptp_mutex_unlock',['../structPtpRuntime.html#aefec40a1a3fb4ad24414d51e22c11701',1,'PtpRuntime']]], - ['ptp_5fnew_24',['ptp_new',['../structPtpRuntime.html#a04ea9521e71a938fe5044153af439b7b',1,'PtpRuntime']]], + ['ptp_5finit_20',['ptp_init',['../structPtpRuntime.html#a13bae3755015236bc0d80f03262f8564',1,'PtpRuntime']]], + ['ptp_5fmutex_5fkeep_5flocked_21',['ptp_mutex_keep_locked',['../structPtpRuntime.html#afd673777a9471de1d465f16c570e8ed6',1,'PtpRuntime']]], + ['ptp_5fmutex_5flock_22',['ptp_mutex_lock',['../structPtpRuntime.html#a35af7e9c296ee5cdbfba5a981454f0a0',1,'PtpRuntime']]], + ['ptp_5fmutex_5funlock_23',['ptp_mutex_unlock',['../structPtpRuntime.html#aab6f6615255ef672a7170fac815c8fa3',1,'PtpRuntime']]], + ['ptp_5fnew_24',['ptp_new',['../structPtpRuntime.html#a16ebc69184e82c377375ff8fc663339a',1,'PtpRuntime']]], ['ptp_5fopen_5fsession_25',['ptp_open_session',['../structPtpRuntime.html#ac1f078ea0df6b7f09bba6af0643f10b5',1,'PtpRuntime']]], ['ptp_5fperror_26',['ptp_perror',['../camlib_8h.html#a4be7b7db9e745e655b26523a9429b009',1,'camlib.h']]], ['ptp_5fpre_5ftake_5fpicture_27',['ptp_pre_take_picture',['../structPtpRuntime.html#aa317218a1bbbd18bc3b20ae9db1624f9',1,'PtpRuntime']]], - ['ptp_5freset_28',['ptp_reset',['../structPtpRuntime.html#a1f04daa3a557f761a6413b05dc7bb7b3',1,'PtpRuntime']]], - ['ptp_5fsend_29',['ptp_send',['../structPtpRuntime.html#a5b05005f4add36b980e0aa5099eb381b',1,'PtpRuntime']]], - ['ptp_5fsend_5fdata_30',['ptp_send_data',['../structPtpRuntime.html#a33813c63d683fbaf32c9a5ac0b35968e',1,'PtpRuntime']]], + ['ptp_5freset_28',['ptp_reset',['../structPtpRuntime.html#a2b58d078aae65e43bca41d037ccdf2d5',1,'PtpRuntime']]], + ['ptp_5fsend_29',['ptp_send',['../structPtpRuntime.html#a025478ecd387e2c1be6dfb7cc41488ea',1,'PtpRuntime']]], + ['ptp_5fsend_5fdata_30',['ptp_send_data',['../structPtpRuntime.html#a04dd3974506089f9c0b248e94b34a0ed',1,'PtpRuntime']]], ['ptp_5fset_5fgeneric_5fproperty_31',['ptp_set_generic_property',['../structPtpRuntime.html#a14deac23d2f24cc1188c499a1255e5f9',1,'PtpRuntime']]], ['ptp_5ftake_5fpicture_32',['ptp_take_picture',['../structPtpRuntime.html#aace66256ef8a5a751e1b1bdf38787aa1',1,'PtpRuntime']]], ['ptpip_5finit_5fcommand_5frequest_33',['ptpip_init_command_request',['../structPtpRuntime.html#a608fc909a1d17cf3e8ad39b261c994bf',1,'PtpRuntime']]], diff --git a/search/searchdata.js b/search/searchdata.js index 673d4b9..2d648e8 100644 --- a/search/searchdata.js +++ b/search/searchdata.js @@ -1,10 +1,10 @@ var indexSectionsWithContent = { - 0: "acdefilmopqrstw", + 0: "acdefilmopqrstuw", 1: "p", 2: "c", 3: "p", - 4: "acdimrtw", + 4: "acdimrtuw", 5: "p", 6: "cdeflmpw" }; diff --git a/search/variables_7.js b/search/variables_7.js index 36588a2..2757e24 100644 --- a/search/variables_7.js +++ b/search/variables_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['wait_5ffor_5fresponse_0',['wait_for_response',['../structPtpRuntime.html#adbd0410bdf4fe67efe17ddf0937195c4',1,'PtpRuntime']]] + ['userdata_0',['userdata',['../structPtpRuntime.html#a237458ab782308367b392a36045d1486',1,'PtpRuntime']]] ]; diff --git a/search/variables_8.js b/search/variables_8.js new file mode 100644 index 0000000..36588a2 --- /dev/null +++ b/search/variables_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['wait_5ffor_5fresponse_0',['wait_for_response',['../structPtpRuntime.html#adbd0410bdf4fe67efe17ddf0937195c4',1,'PtpRuntime']]] +]; diff --git a/structPtpRuntime-members.html b/structPtpRuntime-members.html index 65dd633..5d091d1 100644 --- a/structPtpRuntime-members.html +++ b/structPtpRuntime-members.html @@ -103,44 +103,44 @@ max_packet_sizePtpRuntime mutexPtpRuntime oc (defined in PtpRuntime)PtpRuntime - ptp_buffer_resize(struct PtpRuntime *r, size_t size)PtpRuntime - ptp_check_opcode(struct PtpRuntime *r, int opcode)PtpRuntime - ptp_check_prop(struct PtpRuntime *r, int code)PtpRuntime - ptp_close(struct PtpRuntime *r)PtpRuntime + ptp_buffer_resize(struct PtpRuntime *r, size_t size)PtpRuntime + ptp_check_opcode(struct PtpRuntime *r, int opcode)PtpRuntime + ptp_check_prop(struct PtpRuntime *r, int code)PtpRuntime + ptp_close(struct PtpRuntime *r)PtpRuntime ptp_close_session(struct PtpRuntime *r) (defined in PtpRuntime)PtpRuntime ptp_delete_object(struct PtpRuntime *r, int handle, int format_code) (defined in PtpRuntime)PtpRuntime - ptp_device_type(struct PtpRuntime *r)PtpRuntime + ptp_device_type(struct PtpRuntime *r)PtpRuntime ptp_download_object(struct PtpRuntime *r, int handle, FILE *stream, size_t max)PtpRuntime ptp_get_all_known(struct PtpRuntime *r, struct PtpGenericEvent **s, int *length)PtpRuntime ptp_get_device_info(struct PtpRuntime *r, struct PtpDeviceInfo *di) (defined in PtpRuntime)PtpRuntime - ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec)PtpRuntime - ptp_get_last_transaction_id(struct PtpRuntime *r)PtpRuntime + ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec)PtpRuntime + ptp_get_last_transaction_id(struct PtpRuntime *r)PtpRuntime ptp_get_object(struct PtpRuntime *r, int handle)PtpRuntime ptp_get_object_handles(struct PtpRuntime *r, int id, int format, int in, struct PtpArray **a)PtpRuntime ptp_get_object_info(struct PtpRuntime *r, uint32_t handle, struct PtpObjectInfo *oi) (defined in PtpRuntime)PtpRuntime - ptp_get_param(struct PtpRuntime *r, int i)PtpRuntime - ptp_get_param_length(struct PtpRuntime *r)PtpRuntime + ptp_get_param(struct PtpRuntime *r, int i)PtpRuntime + ptp_get_param_length(struct PtpRuntime *r)PtpRuntime ptp_get_partial_object(struct PtpRuntime *r, uint32_t handle, int offset, int max)PtpRuntime - ptp_get_payload(struct PtpRuntime *r)PtpRuntime - ptp_get_payload_length(struct PtpRuntime *r)PtpRuntime + ptp_get_payload(struct PtpRuntime *r)PtpRuntime + ptp_get_payload_length(struct PtpRuntime *r)PtpRuntime ptp_get_prop_desc(struct PtpRuntime *r, int code, struct PtpPropDesc *pd) (defined in PtpRuntime)PtpRuntime ptp_get_prop_value(struct PtpRuntime *r, int code) (defined in PtpRuntime)PtpRuntime - ptp_get_return_code(struct PtpRuntime *r)PtpRuntime + ptp_get_return_code(struct PtpRuntime *r)PtpRuntime ptp_get_storage_info(struct PtpRuntime *r, int id, struct PtpStorageInfo *si) (defined in PtpRuntime)PtpRuntime ptp_get_thumbnail(struct PtpRuntime *r, int handle)PtpRuntime - ptp_init(struct PtpRuntime *r)PtpRuntime + ptp_init(struct PtpRuntime *r)PtpRuntime ptp_init_capture(struct PtpRuntime *r, int storage_id, int object_format) (defined in PtpRuntime)PtpRuntime ptp_init_open_capture(struct PtpRuntime *r, int storage_id, int object_format) (defined in PtpRuntime)PtpRuntime ptp_move_object(struct PtpRuntime *r, int storage_id, int handle, int folder) (defined in PtpRuntime)PtpRuntime - ptp_mutex_keep_locked(struct PtpRuntime *r)PtpRuntime - ptp_mutex_lock(struct PtpRuntime *r)PtpRuntime - ptp_mutex_unlock(struct PtpRuntime *r)PtpRuntime - ptp_new(int options)PtpRuntime + ptp_mutex_keep_locked(struct PtpRuntime *r)PtpRuntime + ptp_mutex_lock(struct PtpRuntime *r)PtpRuntime + ptp_mutex_unlock(struct PtpRuntime *r)PtpRuntime + ptp_new(int options)PtpRuntime ptp_open_session(struct PtpRuntime *r)PtpRuntime ptp_pre_take_picture(struct PtpRuntime *r)PtpRuntime - ptp_reset(struct PtpRuntime *r)PtpRuntime - ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd)PtpRuntime - ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)PtpRuntime + ptp_reset(struct PtpRuntime *r)PtpRuntime + ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd)PtpRuntime + ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)PtpRuntime ptp_send_object_info(struct PtpRuntime *r, int storage_id, int handle, struct PtpObjectInfo *oi) (defined in PtpRuntime)PtpRuntime ptp_set_generic_property(struct PtpRuntime *r, const char *name, int value)PtpRuntime ptp_set_prop_value(struct PtpRuntime *r, int code, int value) (defined in PtpRuntime)PtpRuntime @@ -152,7 +152,7 @@ response_wait_defaultPtpRuntime session (defined in PtpRuntime)PtpRuntime transactionPtpRuntime - userdata (defined in PtpRuntime)PtpRuntime + userdataPtpRuntime wait_for_responsePtpRuntime
diff --git a/structPtpRuntime.html b/structPtpRuntime.html index 51e518a..306eb81 100644 --- a/structPtpRuntime.html +++ b/structPtpRuntime.html @@ -100,75 +100,75 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -230,7 +230,7 @@ int  - + @@ -288,6 +288,7 @@ + @@ -310,14 +311,14 @@

Detailed Description

Holds all camlib instance info.

Member Function Documentation

- -

◆ ptp_buffer_resize()

+ +

◆ ptp_buffer_resize()

Public Member Functions

int ptp_get_return_code (struct PtpRuntime *r)
 Returns the return code (RC) currently in the data buffer.
 
int ptp_get_param_length (struct PtpRuntime *r)
 Get number of parameters in packet in data buffer.
 
uint32_t ptp_get_param (struct PtpRuntime *r, int i)
 Get parameter at index i.
 
int ptp_get_last_transaction_id (struct PtpRuntime *r)
 Get transaction ID of packet in the data buffer.
 
uint8_t * ptp_get_payload (struct PtpRuntime *r)
 Get ptr of packet payload in data buffer, after packet header.
 
int ptp_get_payload_length (struct PtpRuntime *r)
 Get length of payload returned by ptp_get_payload.
 
-struct PtpRuntimeptp_new (int options)
 Allocate new PtpRuntime based on bitfield options - see PtpConnType.
 
-void ptp_reset (struct PtpRuntime *r)
 Reset all session-specific fields of PtpRuntime - both libusb and libwpd backends call this before establishing connection, so calling this is not required.
 
-void ptp_init (struct PtpRuntime *r)
 Init PtpRuntime locally - uses default recommended settings (USB)
 
-void ptp_close (struct PtpRuntime *r)
 Frees PtpRuntime data buffer - doesn't free the actual structure, or device info (yet)
 
-int ptp_send (struct PtpRuntime *r, struct PtpCommand *cmd)
 Send a command request to the device with no data phase.
 
-int ptp_send_data (struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)
 Send a command request to the device with a data phase (thread safe)
 
-int ptp_get_event (struct PtpRuntime *r, struct PtpEventContainer *ec)
 Try and get an event from the camera over int endpoint (USB-only)
 
-void ptp_mutex_unlock (struct PtpRuntime *r)
 Unlock the IO mutex (unless it was kept locked)
 
void ptp_mutex_keep_locked (struct PtpRuntime *r)
 Keep the mutex locked one more time for the current thread.
 
-void ptp_mutex_lock (struct PtpRuntime *r)
 Lock the IO mutex - only should be used by backend.
 
int ptp_device_type (struct PtpRuntime *r)
 Gets type of device from r->di.
 
int ptp_check_opcode (struct PtpRuntime *r, int opcode)
 Check if an opcode is supported by looking through supported props in r->di.
 
int ptp_check_prop (struct PtpRuntime *r, int code)
 Check if a property code is supported by looking through supported props in r->di.
 
int ptp_buffer_resize (struct PtpRuntime *r, size_t size)
 Mostly for internal use - realloc the data buffer.
 
PUB int ptp_get_return_code (struct PtpRuntime *r)
 Returns the return code (RC) currently in the data buffer.
 
PUB int ptp_get_param_length (struct PtpRuntime *r)
 Get number of parameters in packet in data buffer.
 
PUB uint32_t ptp_get_param (struct PtpRuntime *r, int i)
 Get parameter at index i.
 
PUB int ptp_get_last_transaction_id (struct PtpRuntime *r)
 Get transaction ID of packet in the data buffer.
 
PUB uint8_t * ptp_get_payload (struct PtpRuntime *r)
 Get ptr of packet payload in data buffer, after packet header.
 
PUB int ptp_get_payload_length (struct PtpRuntime *r)
 Get length of payload returned by ptp_get_payload.
 
+PUB struct PtpRuntimeptp_new (int options)
 Allocate new PtpRuntime based on bitfield options - see PtpConnType.
 
+PUB void ptp_reset (struct PtpRuntime *r)
 Reset all session-specific fields of PtpRuntime - both libusb and libwpd backends call this before establishing connection, so calling this is not required.
 
+PUB void ptp_init (struct PtpRuntime *r)
 Init PtpRuntime locally - uses default recommended settings (USB)
 
+PUB void ptp_close (struct PtpRuntime *r)
 Frees PtpRuntime data buffer - doesn't free the actual structure, or device info (yet)
 
+PUB int ptp_send (struct PtpRuntime *r, struct PtpCommand *cmd)
 Send a command request to the device with no data phase.
 
+PUB int ptp_send_data (struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length)
 Send a command request to the device with a data phase (thread safe)
 
+PUB int ptp_get_event (struct PtpRuntime *r, struct PtpEventContainer *ec)
 Try and get an event from the camera over int endpoint (USB-only)
 
+PUB void ptp_mutex_unlock (struct PtpRuntime *r)
 Unlock the IO mutex (unless it was kept locked)
 
PUB void ptp_mutex_keep_locked (struct PtpRuntime *r)
 Keep the mutex locked one more time for the current thread.
 
+PUB void ptp_mutex_lock (struct PtpRuntime *r)
 Lock the IO mutex - only should be used by backend.
 
PUB int ptp_device_type (struct PtpRuntime *r)
 Gets type of device from r->di.
 
PUB int ptp_check_opcode (struct PtpRuntime *r, int opcode)
 Check if an opcode is supported by looking through supported props in r->di.
 
PUB int ptp_check_prop (struct PtpRuntime *r, int code)
 Check if a property code is supported by looking through supported props in r->di.
 
PUB int ptp_buffer_resize (struct PtpRuntime *r, size_t size)
 Mostly for internal use - realloc the data buffer.
 
int ptp_set_generic_property (struct PtpRuntime *r, const char *name, int value)
 Set a generic property - abstraction over SetDeviceProp.
 
ptp_delete_object (struct PtpRuntime *r, int handle, int format_code)
 
int ptp_get_thumbnail (struct PtpRuntime *r, int handle)
 Raw JPEG data is accessible from ptp_get_payload()
 Raw JPEG data is accessible from ptp_get_payload()
 
int ptp_get_partial_object (struct PtpRuntime *r, uint32_t handle, int offset, int max)
 
 
void * userdata
 Free pointer to hold per ptp session information.
 
pthread_mutex_t * mutex
- + @@ -334,14 +335,14 @@

-

◆ ptp_check_opcode()

+ +

◆ ptp_check_opcode()

int ptp_buffer_resize PUB int ptp_buffer_resize ( struct PtpRuntime * r,
- + @@ -358,14 +359,14 @@

-

◆ ptp_check_prop()

+ +

◆ ptp_check_prop()

int ptp_check_opcode PUB int ptp_check_opcode ( struct PtpRuntime * r,
- + @@ -382,14 +383,14 @@

-

◆ ptp_device_type()

+ +

◆ ptp_device_type()

int ptp_check_prop PUB int ptp_check_prop ( struct PtpRuntime * r,
- + @@ -436,14 +437,14 @@

-

◆ ptp_get_last_transaction_id()

+ +

◆ ptp_get_last_transaction_id()

int ptp_device_type PUB int ptp_device_type ( struct PtpRuntime * r)
- + @@ -456,14 +457,14 @@

-

◆ ptp_get_param()

+ +

◆ ptp_get_param()

int ptp_get_last_transaction_id PUB int ptp_get_last_transaction_id ( struct PtpRuntime * r)
- + @@ -480,14 +481,14 @@

-

◆ ptp_get_param_length()

+ +

◆ ptp_get_param_length()

uint32_t ptp_get_param PUB uint32_t ptp_get_param ( struct PtpRuntime * r,
- + @@ -532,14 +533,14 @@

-

◆ ptp_get_payload()

+ +

◆ ptp_get_payload()

int ptp_get_param_length PUB int ptp_get_param_length ( struct PtpRuntime * r)
- + @@ -552,14 +553,14 @@

-

◆ ptp_get_payload_length()

+ +

◆ ptp_get_payload_length()

uint8_t * ptp_get_payload PUB uint8_t * ptp_get_payload ( struct PtpRuntime * r)
- + @@ -572,14 +573,14 @@

-

◆ ptp_get_return_code()

+ +

◆ ptp_get_return_code()

int ptp_get_payload_length PUB int ptp_get_payload_length ( struct PtpRuntime * r)
- + @@ -611,19 +612,19 @@

-

Raw JPEG data is accessible from ptp_get_payload()

+

Raw JPEG data is accessible from ptp_get_payload()

Note
Not thread safe.
- -

◆ ptp_mutex_keep_locked()

+ +

◆ ptp_mutex_keep_locked()

int ptp_get_return_code PUB int ptp_get_return_code ( struct PtpRuntime * r)
- +
void ptp_mutex_keep_locked PUB void ptp_mutex_keep_locked ( struct PtpRuntime * r)