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
inference_settings.h File Reference

Shared application_settings.ini discovery with module-owned extra keys. More...

#include "bounded_ini.h"
#include <stddef.h>
#include <stdint.h>
Include dependency graph for inference_settings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  inference_settings
 Per-application configuration; all resolved paths belong to this caller-owned value. More...

Macros

#define INFERENCE_PATH_CAPACITY   4096U

Enumerations

enum  inference_backend { INFERENCE_NATIVE , INFERENCE_ONNX , INFERENCE_IMX500 , INFERENCE_AUTO }
 Backend selection; AUTO resolves the model suffix, never an execution error. More...
enum  inference_source { INFERENCE_LIVE , INFERENCE_IMAGE , INFERENCE_FAKE }
 Acquisition choice, deliberately independent of the inference backend. More...

Functions

void inference_settings_init (struct inference_settings *settings, enum inference_backend backend)
 Reset storage and select conservative thread/timeout defaults.
int inference_settings_field (struct inference_settings *settings, const char *key, const char *value)
 Parse one common key without consuming module-specific keys.
bool inference_settings_read (struct inference_settings *settings, const char *filename, ini_field_handler extra, void *context, char *error, size_t capacity)
 Parse one flat INI, delegate application keys and resolve paths against the selected file.
bool inference_settings_find (const char *application, const char *module, char *filename, size_t capacity)
 Discover application_settings.ini in adjacent, development-module, then installed-share order.
bool inference_resolve_path (const char *base_file, const char *value, char *destination, size_t capacity)
 Resolve an INI-relative path without requiring its destination to exist yet.

Detailed Description

Shared application_settings.ini discovery with module-owned extra keys.

Definition in file inference_settings.h.

Macro Definition Documentation

◆ INFERENCE_PATH_CAPACITY

#define INFERENCE_PATH_CAPACITY   4096U

Definition at line 31 of file inference_settings.h.

Enumeration Type Documentation

◆ inference_backend

Backend selection; AUTO resolves the model suffix, never an execution error.

Enumerator
INFERENCE_NATIVE 
INFERENCE_ONNX 
INFERENCE_IMX500 
INFERENCE_AUTO 

Definition at line 34 of file inference_settings.h.

◆ inference_source

Acquisition choice, deliberately independent of the inference backend.

Enumerator
INFERENCE_LIVE 
INFERENCE_IMAGE 
INFERENCE_FAKE 

Definition at line 36 of file inference_settings.h.

Function Documentation

◆ inference_resolve_path()

bool inference_resolve_path ( const char * base_file,
const char * value,
char * destination,
size_t capacity )

Resolve an INI-relative path without requiring its destination to exist yet.

Parameters
base_fileSettings filename whose parent supplies the relative base.
valueAbsolute or relative path; control characters are rejected.
destinationWritable normalized absolute path, distinct from the inputs.
capacityDestination capacity including its terminator.
Returns
True for a complete, nontruncated path. This is lexical normalization, not symlink resolution.

Definition at line 93 of file inference_settings.c.

◆ inference_settings_field()

int inference_settings_field ( struct inference_settings * settings,
const char * key,
const char * value )

Parse one common key without consuming module-specific keys.

Parameters
settingsInitialized destination; its seen mask rejects duplicates.
keyFlat key emitted by the bounded INI parser.
valueNonempty parsed value; no pointer into it is retained.
Returns
One if accepted, zero if unknown, minus one if invalid/duplicate.

Definition at line 53 of file inference_settings.c.

◆ inference_settings_find()

bool inference_settings_find ( const char * application,
const char * module,
char * filename,
size_t capacity )

Discover application_settings.ini in adjacent, development-module, then installed-share order.

Supports both bin/ application executables and the root-level USHER owner, without consulting the caller's current directory.

Parameters
applicationLowercase executable name without an architecture suffix.
moduleLowercase module directory name, such as spotter_cam.
filenameDestination path; meaningful only on success.
capacityAvailable bytes in filename.
Returns
True after finding a regular file, never a current-directory fallback.

Definition at line 202 of file inference_settings.c.

◆ inference_settings_init()

void inference_settings_init ( struct inference_settings * settings,
enum inference_backend backend )

Reset storage and select conservative thread/timeout defaults.

Parameters
settingsWritable owner, or NULL to do nothing.
backendApplication default used when the INI omits the backend.

Definition at line 28 of file inference_settings.c.

◆ inference_settings_read()

bool inference_settings_read ( struct inference_settings * settings,
const char * filename,
ini_field_handler extra,
void * context,
char * error,
size_t capacity )

Parse one flat INI, delegate application keys and resolve paths against the selected file.

Parameters
settingsInitialized destination; discard partially parsed values on failure.
filenameSelected settings file, independent of the caller's current directory.
extraOptional handler for application-specific fields.
contextBorrowed extra-handler state, used only during this call.
errorWritable failure diagnostic, cleared on success.
capacityAvailable bytes in error.
Returns
True for valid bounded syntax, accepted fields and resolvable lexical paths.

AUTO resolves .onnx/.rpk suffixes and an omitted ONNX descriptor to the same-name .ini. It does not test availability or fall back after errors.

Definition at line 158 of file inference_settings.c.