diff --git a/camlib_8h_source.html b/camlib_8h_source.html index b76485a..ee72ba1 100644 --- a/camlib_8h_source.html +++ b/camlib_8h_source.html @@ -199,158 +199,160 @@
114
117struct PtpRuntime {
-
121 uint8_t io_kill_switch;
-
122
-
125 uint8_t connection_type;
-
126
-
128 int transaction;
-
129 int session;
-
130
-
133 uint8_t *data;
-
134 int data_length;
-
135
-
138 int max_packet_size;
-
139
-
142 struct PtpDeviceInfo *di;
-
143 int device_type;
-
144
-
147 int data_phase_length;
-
148
-
150 void *comm_backend;
-
151
-
153 void *userdata;
-
154
-
156 pthread_mutex_t *mutex;
-
157
-
160 uint8_t wait_for_response;
-
161
-
163 uint8_t response_wait_default;
-
164
-
168 struct PtpPropAvail *avail;
-
169
-
170 struct ObjectCache *oc;
-
171};
+
119 uint8_t io_kill_switch;
+
120
+
122 uint8_t operation_kill_switch;
+
123
+
126 uint8_t connection_type;
+
127
+
129 int transaction;
+
130 int session;
+
131
+
134 uint8_t *data;
+
135 int data_length;
+
136
+
139 int max_packet_size;
+
140
+
143 struct PtpDeviceInfo *di;
+
144 int device_type;
+
145
+
148 int data_phase_length;
+
149
+
151 void *comm_backend;
+
152
+
154 void *userdata;
+
155
+
157 pthread_mutex_t *mutex;
+
158
+
161 uint8_t wait_for_response;
+
162
+
164 uint8_t response_wait_default;
+
165
+
169 struct PtpPropAvail *avail;
+
170
+
171 struct ObjectCache *oc;
+
172};
-
172
-
-
174struct PtpGenericEvent {
-
175 uint16_t code;
-
176 const char *name;
-
177 int value;
-
178 const char *str_value;
-
179};
+
173
+
+ +
176 uint16_t code;
+
177 const char *name;
+
178 int value;
+
179 const char *str_value;
+
180};
-
180
-
- -
183 uint16_t code;
-
184 uint32_t params[5];
-
185 int param_length;
-
186};
+
181
+
+ +
184 uint16_t code;
+
185 uint32_t params[5];
+
186 int param_length;
+
187};
-
187
-
-
189struct PtpArray {
-
190 uint32_t length;
-
191 uint32_t data[];
-
192};
+
188
+
+
190struct PtpArray {
+
191 uint32_t length;
+
192 uint32_t data[];
+
193};
-
193
- -
198
- -
203
-
207PUB uint32_t ptp_get_param(struct PtpRuntime *r, int i);
-
208
- -
213
-
217PUB uint8_t *ptp_get_payload(struct PtpRuntime *r);
-
218
- -
223
-
226PUB struct PtpRuntime *ptp_new(int options);
-
227
-
231PUB void ptp_reset(struct PtpRuntime *r);
-
232
-
235PUB void ptp_init(struct PtpRuntime *r);
-
236
-
239PUB void ptp_close(struct PtpRuntime *r);
-
240
-
243PUB int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd);
-
244
-
247PUB int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length);
-
248
-
251PUB int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec);
-
252
-
255PUB void ptp_mutex_unlock(struct PtpRuntime *r);
-
256
- -
261
-
264PUB void ptp_mutex_lock(struct PtpRuntime *r);
-
265
-
269PUB int ptp_device_type(struct PtpRuntime *r);
-
270
-
274PUB int ptp_check_opcode(struct PtpRuntime *r, int opcode);
-
275
-
279PUB int ptp_check_prop(struct PtpRuntime *r, int code);
-
280
-
284PUB int ptp_buffer_resize(struct PtpRuntime *r, size_t size);
-
285
-
286// Data structure functions
-
287PUB int ptp_write_unicode_string(char *dat, const char *string);
-
288PUB int ptp_read_unicode_string(char *buffer, char *dat, int max);
-
289PUB int ptp_read_utf8_string(void *dat, char *string, int max);
-
290PUB int ptp_read_string(uint8_t *dat, char *string, int max);
-
291PUB int ptp_write_string(uint8_t *dat, const char *string);
-
292PUB int ptp_write_utf8_string(void *dat, const char *string);
-
293PUB int ptp_read_uint16_array(const uint8_t *dat, uint16_t *buf, int max, int *length);
-
294PUB int ptp_read_uint16_array_s(uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length);
-
295inline static int ptp_write_u8 (void *buf, uint8_t out) { ((uint8_t *)buf)[0] = out; return 1; }
-
296inline static int ptp_write_u16(void *buf, uint16_t out) { ((uint16_t *)buf)[0] = out; return 2; }
-
297inline static int ptp_write_u32(void *buf, uint32_t out) { ((uint32_t *)buf)[0] = out; return 4; }
-
298inline static int ptp_read_u32 (const void *buf, uint32_t *out) { *out = ((const uint32_t *)buf)[0]; return 4; }
-
299inline static int ptp_read_u16 (const void *buf, uint16_t *out) { *out = ((const uint16_t *)buf)[0]; return 2; }
-
300inline static int ptp_read_u8 (const void *buf, uint8_t *out) { *out = ((const uint8_t *)buf)[0]; return 1; }
-
301
-
302// Build a new PTP/IP or PTP/USB command packet in r->data
-
303int ptp_new_cmd_packet(struct PtpRuntime *r, struct PtpCommand *cmd);
-
304
-
305// Only for PTP_USB or PTP_USB_IP use
-
306int ptp_new_data_packet(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int data_length);
-
307
-
308// Only use for PTP_IP
-
309int ptpip_data_start_packet(struct PtpRuntime *r, int data_length);
-
310int ptpip_data_end_packet(struct PtpRuntime *r, void *data, int data_length);
-
311
-
312// Used only by ptp_open_session
-
313void ptp_update_transaction(struct PtpRuntime *r, int t);
-
314
-
315// Set avail info for prop
-
316void ptp_set_prop_avail_info(struct PtpRuntime *r, int code, int memb_size, int cnt, void *data);
-
317
-
318void *ptp_dup_payload(struct PtpRuntime *r);
-
319
-
322int ptp_dump(struct PtpRuntime *r);
-
323
-
324#define CAMLIB_INCLUDE_IMPL
-
325#include "cl_data.h"
-
326#include "cl_backend.h"
-
327#include "cl_ops.h"
-
328#include "cl_enum.h"
-
329#include "cl_bind.h"
-
330
-
331// Backwards compatibility (mostly renamed functions)
-
332#ifndef CAMLIB_NO_COMPAT
-
333 #define ptp_get_last_transaction(...) ptp_get_last_transaction_id(__VA_ARGS__)
-
334 #define ptp_generic_new(...) ptp_new(__VA_ARGS__)
-
335 #define ptp_generic_close(...) ptp_close(__VA_ARGS__)
-
336 #define ptp_generic_reset(...) ptp_reset(__VA_ARGS__)
-
337 #define ptp_generic_init(...) ptp_init(__VA_ARGS__)
-
338 #define ptp_generic_send(...) ptp_send(__VA_ARGS__)
-
339 #define ptp_generic_send_data(...) ptp_send_data(__VA_ARGS__)
-
340#endif
-
341
-
342#endif
+
194
+ +
199
+ +
204
+
208PUB uint32_t ptp_get_param(struct PtpRuntime *r, int i);
+
209
+ +
214
+
218PUB uint8_t *ptp_get_payload(struct PtpRuntime *r);
+
219
+ +
224
+
227PUB struct PtpRuntime *ptp_new(int options);
+
228
+
232PUB void ptp_reset(struct PtpRuntime *r);
+
233
+
236PUB void ptp_init(struct PtpRuntime *r);
+
237
+
240PUB void ptp_close(struct PtpRuntime *r);
+
241
+
244PUB int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd);
+
245
+
248PUB int ptp_send_data(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int length);
+
249
+
252PUB int ptp_get_event(struct PtpRuntime *r, struct PtpEventContainer *ec);
+
253
+
256PUB void ptp_mutex_unlock(struct PtpRuntime *r);
+
257
+ +
262
+
265PUB void ptp_mutex_lock(struct PtpRuntime *r);
+
266
+
270PUB int ptp_device_type(struct PtpRuntime *r);
+
271
+
275PUB int ptp_check_opcode(struct PtpRuntime *r, int opcode);
+
276
+
280PUB int ptp_check_prop(struct PtpRuntime *r, int code);
+
281
+
285PUB int ptp_buffer_resize(struct PtpRuntime *r, size_t size);
+
286
+
287// Data structure functions
+
288PUB int ptp_write_unicode_string(char *dat, const char *string);
+
289PUB int ptp_read_unicode_string(char *buffer, char *dat, int max);
+
290PUB int ptp_read_utf8_string(void *dat, char *string, int max);
+
291PUB int ptp_read_string(uint8_t *dat, char *string, int max);
+
292PUB int ptp_write_string(uint8_t *dat, const char *string);
+
293PUB int ptp_write_utf8_string(void *dat, const char *string);
+
294PUB int ptp_read_uint16_array(const uint8_t *dat, uint16_t *buf, int max, int *length);
+
295PUB int ptp_read_uint16_array_s(uint8_t *bs, uint8_t *be, uint16_t *buf, int max, int *length);
+
296inline static int ptp_write_u8 (void *buf, uint8_t out) { ((uint8_t *)buf)[0] = out; return 1; }
+
297inline static int ptp_write_u16(void *buf, uint16_t out) { ((uint16_t *)buf)[0] = out; return 2; }
+
298inline static int ptp_write_u32(void *buf, uint32_t out) { ((uint32_t *)buf)[0] = out; return 4; }
+
299inline static int ptp_read_u32 (const void *buf, uint32_t *out) { *out = ((const uint32_t *)buf)[0]; return 4; }
+
300inline static int ptp_read_u16 (const void *buf, uint16_t *out) { *out = ((const uint16_t *)buf)[0]; return 2; }
+
301inline static int ptp_read_u8 (const void *buf, uint8_t *out) { *out = ((const uint8_t *)buf)[0]; return 1; }
+
302
+
303// Build a new PTP/IP or PTP/USB command packet in r->data
+
304int ptp_new_cmd_packet(struct PtpRuntime *r, struct PtpCommand *cmd);
+
305
+
306// Only for PTP_USB or PTP_USB_IP use
+
307int ptp_new_data_packet(struct PtpRuntime *r, struct PtpCommand *cmd, void *data, int data_length);
+
308
+
309// Only use for PTP_IP
+
310int ptpip_data_start_packet(struct PtpRuntime *r, int data_length);
+
311int ptpip_data_end_packet(struct PtpRuntime *r, void *data, int data_length);
+
312
+
313// Used only by ptp_open_session
+
314void ptp_update_transaction(struct PtpRuntime *r, int t);
+
315
+
316// Set avail info for prop
+
317void ptp_set_prop_avail_info(struct PtpRuntime *r, int code, int memb_size, int cnt, void *data);
+
318
+
319void *ptp_dup_payload(struct PtpRuntime *r);
+
320
+
323int ptp_dump(struct PtpRuntime *r);
+
324
+
325#define CAMLIB_INCLUDE_IMPL
+
326#include "cl_data.h"
+
327#include "cl_backend.h"
+
328#include "cl_ops.h"
+
329#include "cl_enum.h"
+
330#include "cl_bind.h"
+
331
+
332// Backwards compatibility (mostly renamed functions)
+
333#ifndef CAMLIB_NO_COMPAT
+
334 #define ptp_get_last_transaction(...) ptp_get_last_transaction_id(__VA_ARGS__)
+
335 #define ptp_generic_new(...) ptp_new(__VA_ARGS__)
+
336 #define ptp_generic_close(...) ptp_close(__VA_ARGS__)
+
337 #define ptp_generic_reset(...) ptp_reset(__VA_ARGS__)
+
338 #define ptp_generic_init(...) ptp_init(__VA_ARGS__)
+
339 #define ptp_generic_send(...) ptp_send(__VA_ARGS__)
+
340 #define ptp_generic_send_data(...) ptp_send_data(__VA_ARGS__)
+
341#endif
+
342
+
343#endif
int ptp_dump(struct PtpRuntime *r)
Write r->data to a file called DUMP.
const char * ptp_perror(int rc)
Evaluates PtpGeneralError into string message.
PtpConnType
Tells lib what backend and packet style to use.
Definition camlib.h:98
@@ -367,9 +369,9 @@
@ PTP_OUT_OF_MEM
malloc failed
Definition camlib.h:49
PtpVendors
Unique camera types - each type should have similar opcodes and behavior.
Definition camlib.h:77
-
Generic Struct for arrays.
Definition camlib.h:189
-
Generic PTP command structure - accepted by operation API.
Definition camlib.h:182
-
Generic event / property change.
Definition camlib.h:174
+
Generic Struct for arrays.
Definition camlib.h:190
+
Generic PTP command structure - accepted by operation API.
Definition camlib.h:183
+
Generic event / property change.
Definition camlib.h:175
Linked list to handle currently possible values for a property.
Definition camlib.h:106
Represents a single device connection.
Definition camlib.h:117
PUB int ptp_send(struct PtpRuntime *r, struct PtpCommand *cmd)
Send a command request to the device with no data phase.
@@ -377,33 +379,34 @@
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:153
-
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:121
+
void * userdata
Free pointer to hold per ptp session information.
Definition camlib.h:154
+
uint8_t io_kill_switch
Set to 1 when it is no longer safe to send any data to the device (socket closed, device unplugged)
Definition camlib.h:119
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:163
+
uint8_t response_wait_default
Default value for wait_for_response.
Definition camlib.h:164
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:150
+
void * comm_backend
For session comm/io structures (holds backend instance pointers)
Definition camlib.h:151
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:133
-
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:168
-
int transaction
Definition camlib.h:128
+
uint8_t * data
Global buffer for data reading and writing.
Definition camlib.h:134
+
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:169
+
int transaction
Definition camlib.h:129
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:138
+
int max_packet_size
Definition camlib.h:139
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:156
+
pthread_mutex_t * mutex
Optional (see CAMLIB_DONT_USE_MUTEX)
Definition camlib.h:157
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:147
+
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:148
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:142
-
uint8_t wait_for_response
Optionally wait up to 256 seconds for a response. Some PTP operations require this,...
Definition camlib.h:160
+
struct PtpDeviceInfo * di
Info about current connection, used to detect camera type, supported opodes, etc.
Definition camlib.h:143
+
uint8_t wait_for_response
Optionally wait up to 256 seconds for a response. Some PTP operations require this,...
Definition camlib.h:161
+
uint8_t operation_kill_switch
Set to 1 when it is no longer safe to run operations (device is unresponsive, pipe issues)
Definition camlib.h:122
PUB void ptp_mutex_unlock_thread(struct PtpRuntime *r)
Completely unlock the mutex for the current thread, to ensure there isn't a deadlock....
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:125
+
uint8_t connection_type
One of enum PtpConnType.
Definition camlib.h:126
PUB int ptp_get_payload_length(struct PtpRuntime *r)
Get length of payload returned by ptp_get_payload.
diff --git a/cl__ops_8h_source.html b/cl__ops_8h_source.html index 01bfbe1..4c06b3e 100644 --- a/cl__ops_8h_source.html +++ b/cl__ops_8h_source.html @@ -199,8 +199,8 @@
152
153#endif
int ptp_get_storage_ids(struct PtpRuntime *r, struct PtpArray **a)
Returns allocated array of storage IDs call free() afterwards.
-
Generic Struct for arrays.
Definition camlib.h:189
-
Generic event / property change.
Definition camlib.h:174
+
Generic Struct for arrays.
Definition camlib.h:190
+
Generic event / property change.
Definition camlib.h:175
Represents a single device connection.
Definition camlib.h:117
int ptp_get_thumbnail(struct PtpRuntime *r, int handle)
Raw JPEG data is accessible from ptp_get_payload()
int ptp_set_generic_property(struct PtpRuntime *r, const char *name, int value)
Set a generic property - abstraction over SetDeviceProp.
diff --git a/doxygen_crawl.html b/doxygen_crawl.html index bb60f65..055dd68 100644 --- a/doxygen_crawl.html +++ b/doxygen_crawl.html @@ -40,6 +40,7 @@ + @@ -50,6 +51,7 @@ + @@ -156,6 +158,7 @@ + diff --git a/functions.html b/functions.html index 14032c2..ae25259 100644 --- a/functions.html +++ b/functions.html @@ -116,6 +116,11 @@

- m -

+

- o -

+ +

- p -