Skip to content

Commit

Permalink
Forgot to add cl_ops.h
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Apr 12, 2024
1 parent 0c05030 commit a41f5bd
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions src/cl_ops.h
Original file line number Diff line number Diff line change
@@ -1,62 +1,110 @@
/** \file */
/** \file */
#ifndef OPERATIONS_H
#define OPERATIONS_H

/// @brief Set a generic property - abstraction over SetDeviceProp
/// @note May reject writes if an invalid property is found (see event code)
/// @memberof PtpRuntime
int ptp_set_generic_property(struct PtpRuntime *r, char *name, int value);

/// @brief Call before taking a picture - this is generally for 'focusing'
/// Sometimes will do nothing.
/// On some cameras this does nothing.
/// @note This is meant for a onMouseDown-like event. ptp_take_picture should be called on onMouseUp
/// @memberof PtpRuntime
int ptp_pre_take_picture(struct PtpRuntime *r);

/// @brief Call after calling ptp_pre_take_picture - this time a picture will be taken.
/// @memberof PtpRuntime
int ptp_take_picture(struct PtpRuntime *r);

/// @brief Open a new session - required for most commands
/// @memberof PtpRuntime
int ptp_open_session(struct PtpRuntime *r);

/// @memberof PtpRuntime
int ptp_close_session(struct PtpRuntime *r);

/// @memberof PtpRuntime
int ptp_get_device_info(struct PtpRuntime *r, struct PtpDeviceInfo *di);

/// @brief Returns allocated array of storage IDs
/// call free() afterwards
int ptp_get_storage_ids(struct PtpRuntime *r, struct PtpArray **a);

/// @memberof PtpRuntime
int ptp_init_capture(struct PtpRuntime *r, int storage_id, int object_format);

/// @memberof PtpRuntime
int ptp_init_open_capture(struct PtpRuntime *r, int storage_id, int object_format);

/// @memberof PtpRuntime
int ptp_terminate_open_capture(struct PtpRuntime *r, int trans);

/// @memberof PtpRuntime
int ptp_get_storage_info(struct PtpRuntime *r, int id, struct PtpStorageInfo *si);

/// @memberof PtpRuntime
int ptp_send_object_info(struct PtpRuntime *r, int storage_id, int handle, struct PtpObjectInfo *oi);

/// @memberof PtpRuntime
int ptp_get_prop_value(struct PtpRuntime *r, int code);

/// @memberof PtpRuntime
int ptp_set_prop_value(struct PtpRuntime *r, int code, int value);

/// @memberof PtpRuntime
int ptp_set_prop_value_data(struct PtpRuntime *r, int code, void *data, int length);

/// @memberof PtpRuntime
int ptp_get_prop_desc(struct PtpRuntime *r, int code, struct PtpPropDesc *pd);

/// @brief Gets a list of object handles in a storage device or folder.
// @param id storage ID
// @param format Can specify file format ID, or zero for all IDs
// @param in Can be folder object ID, or 0 for recursive (entire filesystem)
// @param[out] a Output array is a pointer to data packet, and will be overwritten by new operations
/// @memberof PtpRuntime
int ptp_get_object_handles(struct PtpRuntime *r, int id, int format, int in, struct PtpArray **a);

/// @memberof PtpRuntime
int ptp_get_object_info(struct PtpRuntime *r, uint32_t handle, struct PtpObjectInfo *oi);

/// @memberof PtpRuntime
int ptp_move_object(struct PtpRuntime *r, int storage_id, int handle, int folder);

/// @memberof PtpRuntime
int ptp_delete_object(struct PtpRuntime *r, int handle, int format_code);

/// @brief Raw JPEG data is accessible from ptp_get_payload()
/// @note Not thread safe.
/// @memberof PtpRuntime
int ptp_get_thumbnail(struct PtpRuntime *r, int handle);

/// @note Not thread safe.
/// @memberof PtpRuntime
int ptp_get_partial_object(struct PtpRuntime *r, uint32_t handle, int offset, int max);

/// @brief Download an object
/// @memberof PtpRuntime
int ptp_get_object(struct PtpRuntime *r, int handle);

/// @brief Download an object from handle, to a local file (uses GetPartialObject)
/// @memberof PtpRuntime
int ptp_download_object(struct PtpRuntime *r, int handle, FILE *stream, size_t max);

/// @brief Recieve a generic list of all properties received in DeviceInfo
/// This is similar to getting all events, but for first startup when you know nothing.
/// Some vendors do this, but this gets all the properties manually.
/// @param[out] s Output structure, caller must free
/// @memberof PtpRuntime
int ptp_get_all_known(struct PtpRuntime *r, struct PtpGenericEvent **s, int *length);

/// @note PTP/IP only
/// @memberof PtpRuntime
int ptpip_init_events(struct PtpRuntime *r);

/// @note PTP/IP only
/// @memberof PtpRuntime
int ptpip_init_command_request(struct PtpRuntime *r, char *device_name);

// EOS Only functions - not for Canon point and shoot
Expand Down

0 comments on commit a41f5bd

Please sign in to comment.