anjay
|
Go to the source code of this file.
Anjay library configuration.
The preferred way to compile Anjay is to use CMake, in which case this file will be generated automatically by CMake.
However, to provide compatibility with various build systems used especially by embedded platforms, it is alternatively supported to compile Anjay by other means, in which case this file will need to be provided manually.
NOTE: To compile this library without using CMake, you need to configure avs_commons and avs_coap first. Please refer to documentation in the avs_commons_config.h
and avs_coap_config.h
files (provided in the repositories as avs_commons_config.h.in
and avs_coap_config.h.in
, respectively) for details.
Anjay requires the following avs_coap options to be enabled:
WITH_AVS_COAP_UDP
WITH_AVS_COAP_STREAMING_API
WITH_AVS_COAP_BLOCK
is highly recommendedWITH_AVS_COAP_OBSERVE
(if ANJAY_WITH_OBSERVE
is enabled)WITH_AVS_COAP_OSCORE
(if ANJAY_WITH_COAP_OSCORE
is enabled, available only as a commercial feature)Anjay requires the following avs_commons components to be enabled:
avs_coap_config.h
avs_algorithm
avs_stream
avs_url
avs_persistence
is highly recommendedavs_http
(if ANJAY_WITH_HTTP_DOWNLOAD
is enabled)avs_rbtree
(if ANJAY_WITH_OBSERVE
or ANJAY_WITH_MODULE_ACCESS_CONTROL
is enabled)In the repository, this file is provided as anjay_config.h.in
, intended to be processed by CMake. If editing this file manually, please copy or rename it to anjay_config.h
and for each of the #cmakedefine
directives, please either replace it with regular #define
to enable it, or comment it out to disable. You may also need to replace variables wrapped in @
signs with concrete values. Please refer to the comments above each of the specific definition for details.
If you are editing a file previously generated by CMake, these #cmakedefine
s will be already replaced by either #define
or commented out #undef
directives.
#define ANJAY_DEFAULT_SEND_FORMAT AVS_COAP_FORMAT_NONE |
Value of Content-Format used in Send messages. Only a few specific values are supported:
AVS_COAP_FORMAT_NONE
means no default value is used and Anjay will decide the format based on the what is available.AVS_COAP_FORMAT_OMA_LWM2M_CBOR
Anjay will generate a Send message in LwM2M CBOR format.AVS_COAP_FORMAT_SENML_CBOR
Anjay will generate a Send message in SenML CBOR format.AVS_COAP_FORMAT_SENML_JSON
Anjay will generate a Send message in SenML JSON format.Note that to use a specific format it must be available during compilation.
The default value defined in CMake build scripts is AVS_COAP_FORMAT_NONE
.
#define ANJAY_DTLS_SESSION_BUFFER_SIZE 1024 |
Size of buffer allocated for storing DTLS session state when connection is not in use (e.g. during queue mode operation).
If editing this file manually, 1024
shall be replaced with a positive integer literal. The default value defined in CMake build scripts is 1024.
#define ANJAY_MAX_DOUBLE_STRING_SIZE 512 |
Maximum length supported for stringified floating-point values.
Used when parsing plaintext and SenML JSON content formats - when parsing a floating-point value, any string of length equal or greater than this setting will automatically be considered invalid, even if it could in theory be parsed as a valid number.
If editing this file manually, 512
shall be replaced with a positive integer literal.
The default value defined in CMake build scripts is 512. Minimal suggested setting for low-resource builds is 64.
#define ANJAY_MAX_OBSERVATION_SERVERS_REPORTED_NUMBER 0 |
Maximum number of servers observing a given Resource listed by anjay_resource_observation_status()
function.
Only meaningful if ANJAY_WITH_OBSERVATION_STATUS
is enabled.
#define ANJAY_MAX_PK_OR_IDENTITY_SIZE 2048 |
Maximum size in bytes supported for the "Public Key or Identity" resource in the LwM2M Security object.
If editing this file manually, 2048
shall be replaced with a positive integer literal.
The default value defined in CMake build scripts is 2048. Minimal suggested setting for low-resource builds is 256.
#define ANJAY_MAX_SECRET_KEY_SIZE 256 |
Maximum size in bytes supported for the "Secret Key" resource in the LwM2M Security Object.
If editing this file manually, 256
shall be replaced with a positive integer literal.
The default value defined in CMake build scripts is 256. Minimal suggested setting for low-resource builds is 128.
#define ANJAY_MAX_URI_QUERY_SEGMENT_SIZE 256 |
Maximum length supported for a single Uri-Query segment.
When handling incoming CoAP messages, any Uri-Query option of length equal or greater than this setting will be considered invalid.
If editing this file manually, 256
shall be replaced with a positive integer literal.
The default value defined in CMake build scripts is 256. Minimal suggested setting for low-resource builds is 64.
#define ANJAY_MAX_URI_SEGMENT_SIZE 256 |
Maximum length supported for a single Uri-Path or Location-Path segment.
When handling incoming CoAP messages, any Uri-Path or Location-Path option of length equal or greater than this setting will be considered invalid.
If editing this file manually, 256
shall be replaced with a positive integer literal.
The default value defined in CMake build scripts is 256. Minimal suggested setting for low-resource builds is 64.
#define ANJAY_WITH_ACCESS_CONTROL |
Enable core support for Access Control mechanisms.
Requires separate implementation of the Access Control object itself. Either the implementation available as part of ANJAY_WITH_MODULE_ACCESS_CONTROL
, or a custom application-provided one may be used.
#define ANJAY_WITH_ATTR_STORAGE |
Enable automatic attribute storage.
Requires AVS_COMMONS_WITH_AVS_PERSISTENCE
to be enabled in avs_commons configuration.
#define ANJAY_WITH_BOOTSTRAP |
Enable support for the LwM2M Bootstrap Interface.
#define ANJAY_WITH_CBOR |
Enable support for CBOR and SenML CBOR formats, as specified in LwM2M TS 1.1.
Requires ANJAY_WITH_LWM2M11
to be enabled.
#define ANJAY_WITH_COAP_DOWNLOAD |
Enable support for CoAP(S) downloads.
Only meaningful if ANJAY_WITH_DOWNLOADER
is enabled.
#define ANJAY_WITH_COMMUNICATION_TIMESTAMP_API |
Enable support for communication timestamp (anjay_get_server_last_registration_time()
anjay_get_server_next_update_time()
and anjay_get_server_last_communication_time()
) APIs.
#define ANJAY_WITH_CON_ATTR |
Enable support for the Confirmable Notification attribute, as specified in LwM2M TS 1.2.
Before TS 1.2, this has been supported in Anjay as a custom extension, and thus it is available independently from TS 1.2 support itself, including in the open source version.
Requires ANJAY_WITH_OBSERVE
to be enabled.
#define ANJAY_WITH_CONN_STATUS_API |
Enable oscore module (implementation of the OSCORE object).
IMPORTANT: Only available as part of the OSCORE commercial feature. Ignored in the open source version. If enable Anjay doesn't handle composite operation (read, observe and write). Its use makes sense for LWM2M v1.1 upwards.
This flag can be used to reduce the size of the resulting code.
If active, anjay will respond with message code 5.01 Not Implemented to any composite type request. Enable support for the experimental anjay_get_server_connection_status()
API and related anjay_server_connection_status_cb_t
callback.
#define ANJAY_WITH_CORE_PERSISTENCE |
Enable support for core state persistence (anjay_new_from_core_persistence()
and anjay_delete_with_core_persistence()
APIs).
Requires ANJAY_WITH_OBSERVE
to be enabled, AVS_COMMONS_WITH_AVS_PERSISTENCE
to be enabled in avs_commons, and WITH_AVS_COAP_OBSERVE_PERSISTENCE
to be enabled in avs_coap configuration.
IMPORTANT: Only available as a commercial feature. Ignored in the open source version.
#define ANJAY_WITH_DISCOVER |
Enable support for the LwM2M Discover operation.
Note that it is required for full compliance with the LwM2M protocol.
#define ANJAY_WITH_DOWNLOADER |
Enable support for the anjay_download()
API.
#define ANJAY_WITH_EST |
Enable support for Enrollment over Secure Transport.
Requires ANJAY_WITH_BOOTSTRAP
to be enabled.
IMPORTANT: Only available as part of the EST commercial feature. Ignored in the open source version.
#define ANJAY_WITH_EST_ENGINE_SUPPORT |
Enable support for hardware security engine in the EST subsystem.
Requires ANJAY_WITH_EST
to be enabled in Anjay configuration and AVS_COMMONS_WITH_AVS_CRYPTO_PKI_ENGINE
to be enabled in avs_commons configuration.
IMPORTANT: Only available in commercial versions that include both the EST and HSM features. Ignored in versions distributed without these features.
#define ANJAY_WITH_EVENT_LOOP |
Enable standard implementation of an event loop.
Requires C11 stdatomic.h
header to be available, and either a platform that provides a BSD-compatible socket API, or a compatibility layer file (see AVS_COMMONS_POSIX_COMPAT_HEADER
in avs_commons_config.h
). This is designed to best work with the defalt implementation of avs_net sockets (see AVS_COMMONS_NET_WITH_POSIX_AVS_SOCKET
), but alternative socket implementations can also be used.
The event loop is most useful when thread safety features (ANJAY_WITH_THREAD_SAFETY and AVS_COMMONS_SCHED_THREAD_SAFE
) are enabled as well, but this is not a hard requirement. See the documentation for anjay_event_loop_run()
for details.
#define ANJAY_WITH_HTTP_DOWNLOAD |
Enable support for HTTP(S) downloads.
Only meaningful if ANJAY_WITH_DOWNLOADER
is enabled.
#define ANJAY_WITH_LOGS |
Enable logging in Anjay.
If this flag is disabled, no logging is compiled into the binary at all.
#define ANJAY_WITH_LWM2M11 |
Enable support for features new to LwM2M protocol version 1.1.
#define ANJAY_WITH_LWM2M_JSON |
Disable automatic closing of server connection sockets after MAX_TRANSMIT_WAIT of inactivity. Enable support for CoAP Content-Format numerical values 1541-1544 that have been used before final LwM2M TS 1.0. Enable support for JSON format as specified in LwM2M TS 1.0.
NOTE: Anjay is only capable of generating this format, there is no parsing support regardless of the state of this option.
#define ANJAY_WITH_MODULE_ACCESS_CONTROL |
Optional Anjay modules. Enable access_control module (implementation of the Access Control object).
Requires ANJAY_WITH_ACCESS_CONTROL
to be enabled.
#define ANJAY_WITH_MODULE_ADVANCED_FW_UPDATE |
Enable advanced_fw_update module (implementation of the 33629 custom Advanced Firmware Update object).
#define ANJAY_WITH_MODULE_AT_SMS |
Enable at_sms module (implementation of an SMS driver for AT modem devices).
Requires ANJAY_WITH_SMS
to be enabled and the operating system to support the POSIX poll()
function.
IMPORTANT: Only available as part of the SMS commercial feature. Ignored in the open source version.
#define ANJAY_WITH_MODULE_BG96_NIDD |
Enable bg96_nidd module (implementation of NB-IoT-based NIDD driver for Quectel BG96).
Requires ANJAY_WITH_NIDD
to be enabled.
IMPORTANT: Only available as part of the NIDD commercial feature. Ignored in the open source version.
#define ANJAY_WITH_MODULE_BOOTSTRAPPER |
Enable bootstrapper module (loader for bootstrap information formatted as per the "Storage of LwM2M Bootstrap Information on the Smartcard" appendix to the LwM2M TS).
Requires ANJAY_WITH_BOOTSTRAP
to be enabled and AVS_COMMONS_WITH_AVS_PERSISTENCE
to be enabled in avs_commons configuration.
IMPORTANT: Only available with the bootstrapper feature. Ignored in the open source version.
#define ANJAY_WITH_MODULE_FACTORY_PROVISIONING |
Forced ID of the file to read the SIM bootstrap information from.
If not defined (default), the bootstrap information file will be discovered through the ODF file, as mandated by the specification.
Requires ANJAY_WITH_MODULE_BOOTSTRAPPER
to be enabled. At most one of ANJAY_MODULE_SIM_BOOTSTRAP_HARDCODED_FILE_ID
and ANJAY_MODULE_SIM_BOOTSTRAP_DATA_OID_OVERRIDE_HEX
may be defined at the same time.
IMPORTANT: Only available with the bootstrapper feature. Ignored in the open source version. Overridden OID of the SIM bootstrap information to look for in the DODF file, expressed as a hexlified DER representation (without the header).
This is the hexlified expected value of the 'id' field within the 'OidDO' sequence in the DODF file (please refer to the PKCS #15 document for more information).
If not defined, the default value of "672b0901"
, which corresponds to OID 2.23.43.9.1 {joint-iso-itu-t(2) international-organizations(23) wap(43) oma-lwm2m(9) lwm2m-bootstrap(1)}, will be used.
No other values than the default are valid according to the specification, but some SIM cards are known to use other non-standard values, e.g. "0604672b0901"
- including a superfluous nested BER-TLV header, as erroneously illustrated in the EF(DODF-bootstrap) file coding example in LwM2M TS 1.2 and earlier (fixed in LwM2M TS 1.2.1) - which is interpreted as OID 0.6.4.103.43.9.1 (note that it is invalid as the 0.6 tree does not exist in the repository as of writing this note).
Requires ANJAY_WITH_MODULE_BOOTSTRAPPER
to be enabled. At most one of ANJAY_MODULE_SIM_BOOTSTRAP_HARDCODED_FILE_ID
and ANJAY_MODULE_SIM_BOOTSTRAP_DATA_OID_OVERRIDE_HEX
may be defined at the same time.
IMPORTANT: Only available with the bootstrapper feature. Ignored in the open source version. Enable factory provisioning module. Data provided during provisioning uses SenML CBOR format.
#define ANJAY_WITH_MODULE_FW_UPDATE |
Enable fw_update module (implementation of the Firmware Update object).
#define ANJAY_WITH_MODULE_IPSO_OBJECTS |
Enables ipso_objects module (generic implementation of basic sensor, three axis sensor and Push Button IPSO objects).
#define ANJAY_WITH_MODULE_IPSO_OBJECTS_V2 |
Enables experimental ipso_objects_v2 module (generic implementation of basic sensor and three axis sensor IPSO objects).
#define ANJAY_WITH_MODULE_SECURITY |
Enable security module (implementation of the LwM2M Security object).
#define ANJAY_WITH_MODULE_SECURITY_ENGINE_SUPPORT |
Enable support for hardware security engine in the security module.
This feature allows security credentials provisioned into the LwM2M Security object to be automatically moved into a hardware security module.
Requires ANJAY_WITH_MODULE_SECURITY
to be enabled in Anjay configuration, and at least one of AVS_COMMONS_WITH_AVS_CRYPTO_PKI_ENGINE
or AVS_COMMONS_WITH_AVS_CRYPTO_PSK_ENGINE
to be enabled in avs_commons configuration.
IMPORTANT: Only available as part of the HSM support commercial feature. Ignored in versions distributed without this feature.
#define ANJAY_WITH_MODULE_SERVER |
Enable server module (implementation of the LwM2M Server object).
#define ANJAY_WITH_MODULE_SIM_BOOTSTRAP |
Enable the SIM bootstrap module, which enables reading the SIM bootstrap information from a smartcard, which can then be passed through to the bootstrapper module.
Requires ANJAY_WITH_MODULE_BOOTSTRAPPER
to be enabled.
IMPORTANT: Only available with the bootstrapper feature. Ignored in the open source version.
#define ANJAY_WITH_MODULE_SW_MGMT |
Disable support for PUSH mode Firmware Update.
Only meaningful if ANJAY_WITH_MODULE_FW_UPDATE
is enabled. Requires ANJAY_WITH_DOWNLOADER
to be enabled. Enable sw_mgmt module (implementation of the Software Management object).
#define ANJAY_WITH_NET_STATS |
Enable support for measuring amount of LwM2M traffic (anjay_get_tx_bytes()
, anjay_get_rx_bytes()
, anjay_get_num_incoming_retransmissions()
and anjay_get_num_outgoing_retransmissions()
APIs.
#define ANJAY_WITH_NIDD |
Enable support for Non-IP Data Delivery.
Requires ANJAY_WITH_LWM2M11
to be enabled, and WITH_AVS_COAP_UDP
to be enabled in avs_coap configuration.
IMPORTANT: Only available as a commercial feature. Ignored in the open source version.
#define ANJAY_WITH_OBSERVATION_STATUS |
Enable support for the anjay_resource_observation_status()
API.
#define ANJAY_WITH_OBSERVE |
Enable support for the LwM2M Information Reporting interface (Observe and Notify operations).
Requires WITH_AVS_COAP_OBSERVE
to be enabled in avs_coap configuration.
Note that it is required for full compliance with the LwM2M protocol.
#define ANJAY_WITH_SECURITY_STRUCTURED |
Enable support for handling security credentials in the data model using structured avs_crypto
types.
If the security
module is also enabled (see ANJAY_WITH_MODULE_SECURITY), it also enables support for passing these credentials through such structured types when adding Security object instances via the anjay_security_instance_t structure.
#define ANJAY_WITH_SEND |
Enable support for OSCORE-based security for LwM2M connections.
Requires ANJAY_WITH_LWM2M11
to be enabled, and WITH_AVS_COAP_OSCORE
to be enabled in avs_coap configuration.
IMPORTANT: Only available as part of the OSCORE commercial feature. Ignored in the open source version. Enable support for the LwM2M Send operation.
Requires ANJAY_WITH_LWM2M11
and either ANJAY_WITH_SENML_JSON
or ANJAY_WITH_CBOR
to be enabled.
#define ANJAY_WITH_SENML_JSON |
Disable support for TLV format as specified in LwM2M TS 1.0.
NOTE: LwM2M Client using LwM2M 1.0 MUST support this format. It may be disabled if LwM2M 1.1 is used and SenML JSON or SenML CBOR is enabled. Disable support for Plain Text format as specified in LwM2M TS 1.0 and 1.1.
NOTE: LwM2M Client SHOULD support this format. It may be disabled to reduce library size if LwM2M Server is configured to not use it in requests. Disable use of the Deregister message. Disable support for "IP stickiness", i.e. preference of the same IP address when reconnecting to a server using a domain name. Enable support for SenML JSON format, as specified in LwM2M TS 1.1.
NOTE: As opposed to ANJAY_WITH_LWM2M_JSON
, both generating and parsing is supported.
Requires ANJAY_WITH_LWM2M11
to be enabled.
#define ANJAY_WITH_SMS |
Enable support for the SMS binding and the SMS trigger mechanism.
Requires WITH_AVS_COAP_UDP
to be enabled in avs_coap configuration.
IMPORTANT: Only available as part of the SMS commercial feature. Ignored in the open source version.
#define ANJAY_WITH_SMS_MULTIPART |
Enable support for sending and receiving multipart SMS messages.
Requires ANJAY_WITH_SMS
to be enabled.
IMPORTANT: Only available as part of the SMS commercial feature. Ignored in the open source version.
#define ANJAY_WITH_THREAD_SAFETY |
Enable guarding of all accesses to anjay_t
with a mutex.
#define ANJAY_WITH_TRACE_LOGS |
Enable TRACE-level logs in Anjay.
Only meaningful if ANJAY_WITH_LOGS
is enabled.