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
lwir_cam_pipe.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef USHER_LWIR_CAM_PIPE_H
19#define USHER_LWIR_CAM_PIPE_H
20
21/**
22 * @file lwir_cam_pipe.h
23 * @brief Parent-side protocol for USHER's persistent Tiny1-C LWIR capture server.
24 * @details USHER uses this interface to keep the thermal stream warmed between shots.
25 * A line protocol carries capture and geolocation requests; the implementation handles
26 * bounded server lifecycle, response validation, and capture timing evidence. USHER's
27 * recovery worker owns retry policy.
28 */
29
30#include <stddef.h>
31#include <signal.h>
32#include "capture_timing.h"
33
35/** @brief Bind the owner's long-lived shutdown flag before starting workers.
36 * @param host Only its running flag is retained; NULL clears the binding. */
37void lwir_cam_pipe_configure(const struct camera_backend_host *host);
38
39/** @brief Start and qualify the persistent LWIR capture server.
40 * @param unused Reserved common backend argument.
41 * @return 0 after the server reports ready, otherwise -1. */
42int lwir_cam_pipe_init(const char *unused);
43/** @brief Start the server but abort promptly when USHER begins shutdown.
44 * @param unused Reserved common backend argument.
45 * @param keep_running Signal-safe flag that remains nonzero while startup may continue.
46 * @return 0 after the server reports ready, otherwise -1 after cleanup. */
47int lwir_cam_pipe_init_cancelable(const char *unused,
48 const volatile sig_atomic_t *keep_running);
49/** @brief Override the output directory for an isolated standalone benchmark. */
50void lwir_cam_pipe_set_photo_directory(const char *directory);
51/** @brief Open, stabilize, and close the sensor without writing an image.
52 * @return 0 after a stable warmup frame, otherwise -1. */
53int lwir_cam_pipe_warmup(void);
54/** @brief Select whether successful captures keep an explicit .raw companion.
55 * @param enabled Nonzero to request native raw output. */
57/** @brief Apply a bounded worker configuration before starting the capture server.
58 * @param[in] path Configuration file path.
59 * @return 0 when accepted, otherwise -1; live reconfiguration is not implied. */
60int lwir_cam_pipe_set_config(const char *path);
61/** @brief Set the optional calibration file used by server-side geolocation.
62 * @param path Nonempty calibration YAML path.
63 * @return 0 on acceptance or -1 for an invalid path. */
64int lwir_cam_pipe_set_calibration(const char *path);
65/**
66 * @brief Process a mock thermal image for hardware-free local testing.
67 * @param[in,out] filename Input/output image path.
68 * @return 0 on success or -1 on processing failure.
69 */
70int lwir_cam_pipe_process_mock(char *filename);
71
72/**
73 * @brief Add thermal hotspot/geolocation metadata through the running server.
74 * @param[in] filename JPEG to update.
75 * @return 0 on success or -1 if the operation cannot be completed.
76 */
77int lwir_cam_pipe_geolocate(char *filename);
78/** @brief Return the delay of the last successful capture request in seconds.
79 * @return Nonnegative delay, or a negative value when no timing is available. */
81/** @brief Return detailed callback or polling timing evidence for the last capture.
82 * @return Timing structure; use capture_timing_valid() before consuming it. */
84/** @brief Request one thermal JPEG from an initialized capture server.
85 * @param filename Output path buffer, cleared on failure.
86 * @param filename_size Output path capacity.
87 * @param image_number USHER shot sequence.
88 * @return 0 only for a verified nonempty output image, otherwise -1; USHER owns retry policy. */
89int lwir_cam_pipe_shoot(char *filename, size_t filename_size, int image_number);
90/** @brief Stop, reap, and forget the persistent LWIR capture server. */
91void lwir_cam_pipe_deinit(void);
92
93#endif
Sensor observation times, aligned poses, and optional frame-arrival evidence.
static bool enabled(void)
Report explicit opt-in independently of process or model readiness.
static volatile sig_atomic_t keep_running
Definition earcam.c:181
struct capture_timing lwir_cam_pipe_capture_timing(void)
Return detailed callback or polling timing evidence for the last capture.
int lwir_cam_pipe_shoot(char *filename, size_t filename_size, int image_number)
Request one thermal JPEG from an initialized capture server.
int lwir_cam_pipe_process_mock(char *filename)
Process a mock thermal image for hardware-free local testing.
int lwir_cam_pipe_warmup(void)
Open, stabilize, and close the sensor without writing an image.
int lwir_cam_pipe_init_cancelable(const char *unused, const volatile sig_atomic_t *keep_running)
Start the server but abort promptly when USHER begins shutdown.
void lwir_cam_pipe_set_native_raw(int enabled)
Select whether successful captures keep an explicit .raw companion.
void lwir_cam_pipe_set_photo_directory(const char *directory)
Override the output directory for an isolated standalone benchmark.
double lwir_cam_pipe_capture_delay(void)
Return the delay of the last successful capture request in seconds.
void lwir_cam_pipe_deinit(void)
Stop, reap, and forget the persistent LWIR capture server.
int lwir_cam_pipe_set_calibration(const char *path)
Set the optional calibration file used by server-side geolocation.
int lwir_cam_pipe_init(const char *unused)
Start and qualify the persistent LWIR capture server.
void lwir_cam_pipe_configure(const struct camera_backend_host *host)
Bind the owner's long-lived shutdown flag before starting workers.
int lwir_cam_pipe_geolocate(char *filename)
Add thermal hotspot/geolocation metadata through the running server.
int lwir_cam_pipe_set_config(const char *path)
Apply a bounded worker configuration before starting the capture server.
Shared observation evidence with optional LWIR request/frame-delivery timing.