AWS IoT Device SDK C: Jobs
AWS IoT Jobs library
Return to main page ↑
Configuration

Configuration settings of the Jobs library.

Configuration settings are C pre-processor constants. They can be set with a #define in the config file (iot_config.h) or by using a compiler option such as -D in gcc. If a configuration setting is not defined, the library will use a "sensible" default value (unless otherwise noted). Because they are compile-time constants, a library must be rebuilt if a configuration setting is changed.

configpagemarker

AWS_IOT_JOBS_ENABLE_ASSERTS

Set this to 1 to perform sanity checks when using the Jobs library.

Asserts are useful for debugging, but should be disabled in production code. If this is set to 1, AwsIotJobs_Assert can be defined to set the assertion function; otherwise, the Iot_DefaultAssert will be used.

Possible values: 0 (asserts disabled) or 1 (asserts enabled)
Recommended values: 1 when debugging; 0 in production code.
Default value (if undefined): 0

AWS_IOT_JOBS_DEFAULT_MQTT_TIMEOUT_MS

Set the default timeout (in milliseconds) for MQTT library called by the Jobs library.

If the mqttTimeout argument of AwsIotJobs_Init is 0, the Jobs library uses this setting for MQTT timeouts. This timeout is passed to functions such as IotMqtt_SubscribeSync, IotMqtt_UnsubscribeSync, and IotMqtt_PublishSync to limit amount of time an MQTT function may block.

Possible values: Any positive integer.
Recommended values: This setting must be at least the network round-trip time, as an MQTT packet must be sent to the AWS IoT server and a response must be received. The recommended minimum value is 500.
Default value (if undefined): 5000

AWS_IOT_JOBS_NOTIFY_CALLBACKS

Set the maximum number of Jobs Notify callbacks of each type for each Thing.

This setting affects the behavior of AwsIotJobs_SetNotifyNextCallback and AwsIotJobs_SetNotifyPendingCallback. There is only one Job notification topic of each type for each Thing. This setting allows multiple callbacks to be registered for the single notification topic, allowing multiple applications to respond to the notifications received.

All registered callbacks will be invoked when a notification arrives. The order in which the callbacks are invoked may vary. Therefore, it is the responsibility of each callback to ignore Job notifications that are not intended for it.

Possible values: Any positive integer.
Default value (if undefined): 1

AWS_IOT_LOG_LEVEL_JOBS

Set the log level of the Jobs library.

Log messages from the Jobs library at or below this setting will be printed.

Possible values: One of the Log levels.
Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined, then IOT_LOG_NONE.

AwsIotJobs_Assert

Assertion function used when AWS_IOT_JOBS_ENABLE_ASSERTS is 1.

Possible values: Any function with the same signature as the standard library's assert function.
Default value (if undefined): Iot_DefaultAssert if AWS_IOT_JOBS_ENABLE_ASSERTS is 1; otherwise, nothing. If Iot_DefaultAssert is not defined when asserts are enabled, the Jobs library will fail to build.

Memory allocation

The following functions may be re-implemented for the Jobs library.

If a custom implementation is not set for a Jobs memory allocation function, IotDefault_Malloc and Iot_DefaultFree will be used. If IotDefault_Malloc and Iot_DefaultFree are not set, the Jobs library will fail to build.

When IOT_STATIC_MEMORY_ONLY is 1, the following settings configure the number of statically-allocated buffers for Jobs.

  • AWS_IOT_JOBS_MAX_IN_PROGRESS_OPERATIONS
    Maximum number of Jobs operations that may be in-progress at any time. Defaults to 10 if undefined.
  • AWS_IOT_JOBS_SUBSCRIPTIONS
    Maximum number of Jobs subscriptions at any time. Defaults to 2 if undefined.