Types#
ABR SDK ABI type definitions.
These are kept separately from function declarations because this header is part of the user-facing C SDK API.
- Author
Andreas Stöckel (Applied Brain Research)
Typedefs
-
typedef struct abr_app abr_app_t#
Opaque structure used for handles to an application instance.
-
typedef struct abr_buf abr_buf_t#
Opaque structure used for handles to an application I/O FIFO buffer.
-
typedef struct abr_evset abr_evset_t#
Opaque structure used for handles to a ABR event set (“evset”).
-
typedef struct abr_event abr_event_t#
Opaque structure representing a handle to an individual event within the event set.
-
typedef int8_t abr_status_t#
Typedef for abr_status, giving the enum a concrete representation.
See abr_status for more information. This typedef is required to establish a well-defined ABI; different compilers have different opinions about the type they should use for enums.
-
typedef uint8_t abr_variant_type_t#
Concrete typedef for the abr_variant_type enum.
See abr_variant_type for more information. This typedef is required to establish a well-defined ABI; different compilers have different opinions about the type they should use for enums.
-
typedef uint8_t abr_event_flags_t#
Concrete typedef for the abr_event_flags type and bit-wise combinations of those enum values.
-
typedef union abr_variant_value abr_variant_value_t#
Union holding the actual value of a variant.
The active member is determined by the
typefield in abr_variant_t.
-
typedef struct abr_variant abr_variant_t#
A variant type that can hold values of different types at runtime.
Variants are used for configuration options and object properties where the type is determined at runtime rather than compile time.
-
typedef struct abr_config abr_config_t#
A key-value pair for configuration options.
Arrays of this structure are passed to abr_app_create() to configure the application instance.
-
typedef struct abr_fingerprint abr_fingerprint_t#
The fingerprint that licenses for a device are bound to.
Filled in by abr_get_fingerprint().
-
typedef uint8_t abr_asr_text_chunk_type_t#
Concrete typedef for the abr_asr_text_chunk_type enum.
See abr_asr_text_chunk_type for more information. This typedef is required to establish a well-defined ABI; different compilers have different opinions about the type they should use for enums.
-
typedef struct abr_asr_text_chunk abr_asr_text_chunk_t#
Structure representing a text chunk produced by the ABR.
The ASR output buffer emits arrays of these structures.
-
typedef int32_t abr_log_level_t#
Typedef for abr_log_level, giving the enum a concrete representation.
This typedef is required to establish a well-defined ABI; different compilers have different opinions about the type they should use for enums.
-
typedef void (*abr_log_cb_t)(void *user_data, abr_log_level_t level, const char *msg)#
Log callback function type.
This function type is used to link log messages produced by the ABR library to the logging system of the host application.
- Param user_data:
Arbitrary pointer with user-defined meaning, initially passed to abr_app_create(). This pointer may, for example, point at the instance of a class of which the callback function is a member function.
- Param level:
The log level. The ABR library filters log messages depending on a minimum log level that may be configured while creating the ABR.
- Param msg:
The null-terminated log message string.
Enums
-
enum abr_status#
Possible status codes returned by the various ABR functions.
Values:
-
enumerator ABR_OK#
The operation was successful.
-
enumerator ABR_ERR_INVALID_ARGS#
The API was used incorrectly; values may be out-of-range, or the given handles may point at the wrong object type.
-
enumerator ABR_ERR_INVALID_CONFIG#
Error in the
cfgdictionary passed toabr_app_createorabr_activate_license.Either a required key is missing, a key has an incorrect value, or a given key is unknown. See the log output for more information.
-
enumerator ABR_ERR_TIMEOUT#
The specified timeout expired while waiting for events.
-
enumerator ABR_ERR_INTERRUPT#
The process received a signal from the operating system while waiting for events, or a user called abr_evset_interrupt() from another thread.
-
enumerator ABR_ERR_PLATFORM_UNSUPPORTED#
The current platform is not supported by this ABR library.
You may be attempting to load a ABR library that was compiled for a specific accelerator, but that accelerator is not available.
-
enumerator ABR_ERR_BUSY#
Another ABR library instance (may be in a separate process) is already using the current accelerator.
-
enumerator ABR_ERR_SYSTEM#
A system call failed.
See the log for more information.
-
enumerator ABR_ERR_PERMISSION#
There was a permission error while attempting to access a resource, such as a neural network accelerator or a file with model weights.
-
enumerator ABR_ERR_NOT_IMPLEMENTED#
This function is not implemented yet.
-
enumerator ABR_ERR_INCOMPATIBLE_APP#
The attempted operation is incompatible with this application.
-
enumerator ABR_ERR_INCOMPATIBLE_LIBRARY#
The shared library is incompatible with this version of the ABR SDK.
-
enumerator ABR_ERR_NOT_STATICALLY_LINKED#
Attempting to open the ABR SDK in “statically linked” mode, but the library has not been linked at compile time.
-
enumerator ABR_ERR_LICENSE#
The license check failed.
See the log messages for information on what precisely caused this error and how and it can be solved.
-
enumerator ABR_OK#
-
enum abr_log_level#
Levels used for log messages.
Values:
-
enumerator ABR_LOG_DEFAULT#
Use the default log level.
-
enumerator ABR_LOG_TRACE#
Trace-level logging for detailed debugging.
-
enumerator ABR_LOG_DEBUG#
Debug-level logging for development purposes.
-
enumerator ABR_LOG_INFO#
Informational messages about normal operation.
-
enumerator ABR_LOG_WARNING#
Warning messages for potentially problematic situations.
-
enumerator ABR_LOG_ERROR#
Error messages for recoverable failures.
-
enumerator ABR_LOG_CRITICAL#
Critical messages for severe failures.
-
enumerator ABR_LOG_DISABLE#
Disable all logging.
-
enumerator ABR_LOG_DEFAULT#
-
enum abr_variant_type#
Possible types for variant values.
Variants are used for runtime-typed values in configuration and properties.
Values:
-
enumerator ABR_VAR_UNDEFINED#
The variant has no defined value.
-
enumerator ABR_VAR_NULL#
The variant represents a null value.
-
enumerator ABR_VAR_BOOLEAN#
The variant contains a boolean value.
-
enumerator ABR_VAR_UINT#
The variant contains an unsigned integer.
-
enumerator ABR_VAR_SINT#
The variant contains a signed integer.
-
enumerator ABR_VAR_PTR#
The variant contains a pointer.
-
enumerator ABR_VAR_STR#
The variant contains a string.
-
enumerator ABR_VAR_UNDEFINED#
-
enum abr_event_flags#
Possible flags for event creation.
These can be combined via bitwise
or.Values:
-
enumerator ABR_EVENT_FLAGS_NONE#
No special event flags set.
-
enumerator ABR_EVENT_FLAGS_AUTO_DISABLE#
Automatically disables events that are triggered during a call to
pollor while waiting for the platform event handle.This is useful if the calling code needs to wait for multiple events to be triggered before some action can be performed. Without auto-disabling, events must be manually disabled to avoid
pollconstantly returning, which complicates the code.
-
enumerator ABR_EVENT_FLAGS_DISABLED#
Create the event in a “disabled” state.
Using this flag avoids the event becoming triggered in between event creation and the call to
abr_event_disable().
-
enumerator ABR_EVENT_FLAGS_NONE#
-
enum abr_asr_text_chunk_type#
Enumeration defining different ASR text chunk types.
End-users may filter chunks depending on their latency and quality requirements.
Values:
-
enumerator ABR_ASR_TEXT_CHUNK_NONE#
Not used in valid text chunks.
Chunks with this type should be ignored.
-
enumerator ABR_ASR_TEXT_CHUNK_CAUSAL#
The text was produced by the low-latency but less accurate “causal” branch of the model.
-
enumerator ABR_ASR_TEXT_CHUNK_NONCAUSAL#
The text was produced by the higher latency but high-quality “non-causal” branch of the model.
-
enumerator ABR_ASR_TEXT_CHUNK_POSTPROC#
The text was produced as the result of a post-processing operation, such as a language model or a punctuation model.
At this level, the produced text has the highest quality, but also the highest inserted latency.
-
enumerator ABR_ASR_TEXT_CHUNK_NONE#
-
union abr_variant_value#
Union holding the actual value of a variant.
The active member is determined by the
typefield in abr_variant_t.Public Members
-
bool boolean#
Boolean value, valid when type is ABR_VAR_BOOLEAN.
-
uint64_t uint#
Unsigned integer value, valid when type is ABR_VAR_UINT.
-
int64_t sint#
Signed integer value, valid when type is ABR_VAR_SINT.
-
void *ptr#
Pointer value, valid when type is ABR_VAR_PTR.
-
const char *str#
String value, valid when type is ABR_VAR_STR.
-
bool boolean#
-
struct abr_variant#
A variant type that can hold values of different types at runtime.
Variants are used for configuration options and object properties where the type is determined at runtime rather than compile time.
Public Members
-
abr_variant_type_t type#
The type of value stored in this variant.
-
abr_variant_value_t value#
The actual value.
The active union member is determined by type.
-
abr_variant_type_t type#
-
struct abr_config#
A key-value pair for configuration options.
Arrays of this structure are passed to abr_app_create() to configure the application instance.
Public Members
-
const char *key#
The configuration key (null-terminated string).
-
abr_variant_t value#
The configuration value.
-
const char *key#
-
struct abr_fingerprint#
The fingerprint that licenses for a device are bound to.
Filled in by abr_get_fingerprint().
Public Members
-
char hex[65]#
The fingerprint as 64 lowercase hexadecimal characters (null-terminated string).
-
char hex[65]#
-
struct abr_asr_text_chunk#
Structure representing a text chunk produced by the ABR.
The ASR output buffer emits arrays of these structures.
Public Members
-
abr_asr_text_chunk_type_t type#
Type of this chunk.
-
uint8_t pad0_#
Reserved for future use.
-
int16_t replace_byte_offs_begin#
Relative backwards offset into the already produced byte stream.
Determines the beginning of the span that should be replaced.
Together with replace_byte_offs_end describes a span of bytes that should be replaced by data.
This is used for causal/non-causal stream merging and post-hoc editing stemming from language models such as spell checkers and punctuation insertion.
Note that this value is always negative or zero. Positive values are an error. The maximum replacement span is -1024; applications never need to keep more than 1 kiB of text in a buffer.
-
int16_t replace_byte_offs_end#
Relative backwards offset into the already produced byte stream.
Determines the end of the span (non-inclusive) that should be replaced.
Note that this value is always negative or zero. Positive values are an error. The maximum replacement span is -1024; applications never need to keep more than 1 kiB of text in a buffer.
See also
-
uint8_t pad1_#
Unused padding byte.
Reserved for future use.
-
uint8_t data[32]#
Small buffer containing the actual character data.
-
abr_asr_text_chunk_type_t type#