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_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:
AES70_STATIC_HTTP_USE_PICOHTTPPARSERenables usage of picohttpparser.AES70_STATIC_HTTP_USE_LLHTTPenables usage of llhttp.AES70_STATIC_HTTP_USE_HTTP_PARSERis deprecated and enables usage of http-parser.
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.