|
AWS IoT Device SDK C:
Jobs
AWS IoT Jobs library
|
| Return to main page ↑ |
Set a callback to be invoked when the next pending Job changes.
The Jobs service publishes a NextJobExecutionChanged message to the jobs/notify-next topic whenever the next Job execution in the list of pending Job executions changes for a Thing. The message sent is useful for being notified of changes to the next Job.
A NOTIFY NEXT callback may be invoked whenever a message is published to jobs/notify-next. Each Thing may have up to AWS_IOT_JOBS_NOTIFY_CALLBACKS NOTIFY NEXT callbacks set. This function modifies the NOTIFY NEXT callback for a specific Thing depending on the pNotifyNextCallback parameter and the presence of any existing NOTIFY NEXT callback.
pNotifyNextCallback is not NULL, then the existing callback function and parameter are replaced with pNotifyNextCallback.pNotifyNextCallback is NULL, then the callback is removed.The member AwsIotJobsCallbackInfo_t::oldFunction must be used to select an already-registered callback function for replacement or removal when AWS_IOT_JOBS_NOTIFY_CALLBACKS is greater than 1. When multiple callbacks are set, all of them will be invoked when a message is received.
| [in] | mqttConnection | The MQTT connection to use for the subscription to jobs/notify-next. |
| [in] | pThingName | The subscription to jobs/notify-next will be added for this Thing Name. |
| [in] | thingNameLength | The length of pThingName. |
| [in] | flags | This parameter is for future-compatibility. Currently, flags are not supported for this function and this parameter is ignored. |
| [in] | pNotifyNextCallback | Callback function to invoke for incoming messages. |
Example: