Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
chdk_camera_backend.c File Reference

Adapt CHDKbridge capture and lens controls to USHER's backend contract. More...

#include "chdk_camera_backend.h"
#include "chdk_pipe.h"
#include "camera_control.h"
#include "path_utils.h"
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
Include dependency graph for chdk_camera_backend.c:

Go to the source code of this file.

Macros

#define USHER_CHDK_PHOTO_DIR   "~/Pictures/sensoraia"
#define USHER_SODA   "./bin/soda"

Functions

static void chdk_backend_configure (const struct camera_backend_host *host)
 Pass service cancellation to CHDKbridge supervision.
void chdk_camera_backend_set_photo_directory (const char *directory)
static int chdk_backend_init (const char *source_image)
 Prepare capture storage and initialize the CHDK controller path.
static int chdk_backend_shoot (char *filename, size_t capacity, int number)
 Capture one CHDK JPEG at the path derived from its shot number.
struct camera_backend chdk_camera_backend_get (void)

Variables

static const char * photo_directory = USHER_CHDK_PHOTO_DIR

Detailed Description

Adapt CHDKbridge capture and lens controls to USHER's backend contract.

This layer resolves the configured photo directory and owns naming; the subprocess layer owns USB/camera transactions. It advertises only the controls for which CHDKbridge can return command-specific evidence.

Definition in file chdk_camera_backend.c.

Macro Definition Documentation

◆ USHER_CHDK_PHOTO_DIR

#define USHER_CHDK_PHOTO_DIR   "~/Pictures/sensoraia"

Definition at line 36 of file chdk_camera_backend.c.

◆ USHER_SODA

#define USHER_SODA   "./bin/soda"

Definition at line 39 of file chdk_camera_backend.c.

Function Documentation

◆ chdk_backend_configure()

void chdk_backend_configure ( const struct camera_backend_host * host)
static

Pass service cancellation to CHDKbridge supervision.

Parameters
hostNullable backend host whose running flag outlives capture work.

Retain only the flag; the backend does not need the host's other callbacks.

Definition at line 46 of file chdk_camera_backend.c.

◆ chdk_backend_init()

int chdk_backend_init ( const char * source_image)
static

Prepare capture storage and initialize the CHDK controller path.

Parameters
source_imageUnused fixture argument from the shared backend interface.
Returns
Zero for successful setup, or -1 on storage/controller setup failure.

Reject unusable output storage before advertising capture readiness.

Definition at line 60 of file chdk_camera_backend.c.

◆ chdk_backend_shoot()

int chdk_backend_shoot ( char * filename,
size_t capacity,
int number )
static

Capture one CHDK JPEG at the path derived from its shot number.

Parameters
[out]filenameOutput path; cleared on failure when writable.
capacityPath buffer size including the terminator.
numberNonnegative photo number.
Returns
Zero for a completed capture, or -1 on invalid input or capture failure.

Pass the path to the controller only if it fits so truncated names cannot misassociate a saved image with another shot.

Definition at line 81 of file chdk_camera_backend.c.

◆ chdk_camera_backend_get()

struct camera_backend chdk_camera_backend_get ( void )

Return CHDK's descriptor without acquiring the camera.

Definition at line 96 of file chdk_camera_backend.c.

◆ chdk_camera_backend_set_photo_directory()

void chdk_camera_backend_set_photo_directory ( const char * directory)

Configure a borrowed photo directory before capture; used by isolated speed tests.

Definition at line 51 of file chdk_camera_backend.c.

Variable Documentation

◆ photo_directory

const char* photo_directory = USHER_CHDK_PHOTO_DIR
static

Definition at line 41 of file chdk_camera_backend.c.