Skip to content

Configuration#

libaes70 provides a series of compile-time options which can be used to customize the behavior of the library. They are intended either to configure the library itself (e.g. log levels, etc.) or to enable or disable optimizations.

Configuration options#

AES70_NO_EXCEPTIONS#

When defined, libaes70 will neither use nor support exception handling. Enable this when writing software for embedded platforms or other environments where code must be compiled without exceptions.

AES70_ALLOW_TRAILING_GARBAGE#

When defined, libaes70 ignores unused trailing bytes after OCP.1 message payloads and after decoded method parameters / return values. This exists for interoperability with rare legacy devices that append garbage.

By default (option off), such trailing bytes are treated as errors: leftover message payload closes the connection as a protocol error; leftover parameter bytes yield OcaStatus::ParameterError (or a local parameter failure on the controller side).

AES70_BUFFER_USE_MALLOC#

Use malloc(), realloc() and free() for managing AES70 network buffers. This is generally recommended and may be required on platforms where std::allocator will terminate when exceptions are disabled and an allocation fails.

AES70_LOG_LEVEL#

Can be used to configure the log level for log messages generated by libaes70. See Logging for more details.

AES70_DEBUG#

Enables runtime debugging and asserts. This is generally not a good idea in production builds.

AES70_DISABLE_EV1 or AES70_DISABLE_EV2#

Disables EV1 or EV2 support.

AES70_STATIC_HTTP_USE_*#

The following options can be used to determine which HTTP library is used by the static_http module. The selected parser is not included with libaes70; see Third-party libraries.

  • AES70_STATIC_HTTP_USE_PICOHTTPPARSER enables usage of picohttpparser.
  • AES70_STATIC_HTTP_USE_LLHTTP enables usage of llhttp.
  • AES70_STATIC_HTTP_USE_HTTP_PARSER is deprecated and enables usage of http-parser.

When picohttpparser is selected, STATIC_HTTP_PICOHTTP_HEADER_COUNT (default 64) caps the number of headers, and STATIC_HTTP_PICOHTTP_MAX_BUFFER_SIZE (default 8192) caps the incomplete-request buffer (not in-place parsing of complete chunks). See static_http.

AES70_MAX_INCOMING_PDU_SIZE#

Maximum accepted OCP.1 PDU size in bytes (Command, Response, Notification, …). Oversized PDUs are rejected as soon as the PDU header’s size field is known, so a peer cannot force the receive path to buffer a huge incomplete PDU.

The default is 16384, which covers typical traffic including FIR coefficient lists around 2048 taps. Raise it if your application needs larger PDUs (for example longer filters or bulk dataset transfers).

AES70_MIN_KEEPALIVE_INTERVAL and AES70_MAX_KEEPALIVE_INTERVAL#

The minimal and maximal keepalive interval in milliseconds. If defined, each connection will be configured with the maximal keepalive interval. Controllers can still configure a different keepalive interval by sending a keepalive packet, however it will always be in the range configured using this setting.

In addition, if a controller does not configure any keepalive setting, the max value will be used.

The default value for this setting is 50 and 2000 milliseconds.

Optimizations options#

AES70_ALLOW_ONLY_SIMPLE_SUBSCRIPTIONS#

Only allow simple subscriptions, i.e., subscriptions with a fixed caller method. This is usually fine when using standard controller libraries or controller software to control your device.

Enabling this can reduce the memory used by connections significantly.

AES70_OPTIMIZE_SINGLE_DEVICE#

This option assumes that the program only uses a single AES70 device. As a result, objects in the device will store the device pointer in a static variable. This setting can reduce the memory usage of device objects.

AES70_SHORT_OBJECT_NUMBERS#

This option enables the object number to be stored as a 16-bit integer. This can reduce the memory footprint of device objects. This can only be used in devices that never create more than 65535 - 4096 objects. In general, this can safely be used for devices built using the static_device support.