camlib
Documentation for camlib is still a work-in-progress
Loading...
Searching...
No Matches
cl_bind.h
Go to the documentation of this file.
1
2#ifndef CL_BIND_H
3#define CL_BIND_H
4
5// Recommended buffer size for bind_run
6#define PTP_BIND_DEFAULT_SIZE 5000000
7
8#define BIND_MAX_NAME 64
9
10struct BindReq {
11 // @brief Argument passed to out or out_bytes
12 void *arg;
13 // @brief Output JSON data
14 int (*out)(struct BindReq *bind, char *fmt, ...);
16 int (*out_bytes)(struct BindReq *bind, void *bytes, size_t length);
17
19 char name[BIND_MAX_NAME];
20
23 int params[5];
24 int params_length;
26 char *string;
28 uint8_t *bytes;
29 int bytes_length;
30};
31
32
33// @brief Run a binding directly from an instance of struct BindReq
34int bind_run_req(struct PtpRuntime *r, struct BindReq *bind);
35
36#endif
int(* out_bytes)(struct BindReq *bind, void *bytes, size_t length)
Output raw binary data.
Definition cl_bind.h:16
int params[5]
Parameters for command.
Definition cl_bind.h:23
uint8_t * bytes
Data argument, NULL for none.
Definition cl_bind.h:28
char * string
String argument, NULL for none.
Definition cl_bind.h:26
char name[BIND_MAX_NAME]
Name of command to be run.
Definition cl_bind.h:19