Bounded CHDKbridge subprocess lifecycle for USHER's visible-camera backend. More...
#include <signal.h>#include <stdint.h>

Go to the source code of this file.
Macros | |
| #define | CHDK_CONTROL_REPLY_SIZE 4U |
| #define | CHDK_CONTROL_REPLY_TAG 0xc1U |
Functions | |
| int | chdk_pipe_init (void) |
| Prepare bounded controller ownership without accessing USB. | |
| void | chdk_pipe_set_running (const volatile sig_atomic_t *running) |
| Configure cancellation for controller operations. | |
| int | chdk_pipe_shoot (const char *filename) |
| Capture directly to a new JPEG destination without overwriting a file. | |
| uint8_t | chdk_pipe_control (uint8_t command, uint8_t value, uint8_t *observed, uint8_t *evidence) |
| Apply one supported lens command and qualify device evidence. | |
| void | chdk_pipe_deinit (void) |
| Terminate and reap the owned process group using bounded grace periods. | |
Detailed Description
Bounded CHDKbridge subprocess lifecycle for USHER's visible-camera backend.
Each invocation owns one PTP session. No host Lua or shell is used.
Definition in file chdk_pipe.h.
Macro Definition Documentation
◆ CHDK_CONTROL_REPLY_SIZE
| #define CHDK_CONTROL_REPLY_SIZE 4U |
Definition at line 27 of file chdk_pipe.h.
◆ CHDK_CONTROL_REPLY_TAG
| #define CHDK_CONTROL_REPLY_TAG 0xc1U |
Definition at line 28 of file chdk_pipe.h.
Function Documentation
◆ chdk_pipe_control()
| uint8_t chdk_pipe_control | ( | uint8_t | command, |
| uint8_t | value, | ||
| uint8_t * | observed, | ||
| uint8_t * | evidence ) |
Apply one supported lens command and qualify device evidence.
- Parameters
-
command Absolute zoom or lens retraction. value Requested zoom value; must be zero for retraction. [out] observed Returned device value; meaningful with applied status. [out] evidence Returned evidence kind; meaningful with applied status.
- Returns
- A CAM_CONTROL status; UNKNOWN means execution could not be confirmed.
Check both the reply shape and echoed command. Do not retry an ambiguous operation or infer success from the controller's exit alone.
Definition at line 477 of file chdk_pipe.c.
◆ chdk_pipe_deinit()
| void chdk_pipe_deinit | ( | void | ) |
Terminate and reap the owned process group using bounded grace periods.
Definition at line 239 of file chdk_pipe.c.
◆ chdk_pipe_init()
| int chdk_pipe_init | ( | void | ) |
Prepare bounded controller ownership without accessing USB.
- Returns
- 0 when the executable is accessible and shutdown is not requested.
Settings and camera readiness are checked in the capture invocation.
Definition at line 386 of file chdk_pipe.c.
◆ chdk_pipe_set_running()
| void chdk_pipe_set_running | ( | const volatile sig_atomic_t * | running | ) |
Configure cancellation for controller operations.
- Parameters
-
running Borrowed service flag, or NULL to disable flag-based cancellation.
Keep the flag alive for the lifetime of controller work; cleanup waits must still reap a child after cancellation.
Definition at line 167 of file chdk_pipe.c.
◆ chdk_pipe_shoot()
| int chdk_pipe_shoot | ( | const char * | filename | ) |
Capture directly to a new JPEG destination without overwriting a file.
- Parameters
-
filename Caller-owned destination path.
- Returns
- 0 for a checked saved JPEG, otherwise -1; capture is never replayed.
Definition at line 440 of file chdk_pipe.c.