Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
aws_iot_jobs_interface.h File Reference
An interface for interacting with the AWS IoT Jobs system. More...
Go to the source code of this file.
Functions | |
| IoT_Error_t | aws_iot_jobs_subscribe_to_job_messages (AWS_IoT_Client *pClient, QoS qos, const char *thingName, const char *jobId, AwsIotJobExecutionTopicType topicType, AwsIotJobExecutionTopicReplyType replyType, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData, char *topicBuffer, uint16_t topicBufferSize) |
| Subscribe to jobs messages for the given thing and/or jobs. | |
| IoT_Error_t | aws_iot_jobs_subscribe_to_all_job_messages (AWS_IoT_Client *pClient, QoS qos, const char *thingName, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData, char *topicBuffer, uint16_t topicBufferSize) |
| Subscribe to all job messages. | |
| IoT_Error_t | aws_iot_jobs_unsubscribe_from_job_messages (AWS_IoT_Client *pClient, char *topicBuffer) |
| Unsubscribe from a job subscription. | |
| IoT_Error_t | aws_iot_jobs_send_query (AWS_IoT_Client *pClient, QoS qos, const char *thingName, const char *jobId, const char *clientToken, char *topicBuffer, uint16_t topicBufferSize, char *messageBuffer, size_t messageBufferSize, AwsIotJobExecutionTopicType topicType) |
| Send a query to one of the job query APIs. | |
| IoT_Error_t | aws_iot_jobs_start_next (AWS_IoT_Client *pClient, QoS qos, const char *thingName, const AwsIotStartNextPendingJobExecutionRequest *startNextRequest, char *topicBuffer, uint16_t topicBufferSize, char *messageBuffer, size_t messageBufferSize) |
| Send a start next command to the job start-next API. | |
| IoT_Error_t | aws_iot_jobs_describe (AWS_IoT_Client *pClient, QoS qos, const char *thingName, const char *jobId, const AwsIotDescribeJobExecutionRequest *describeRequest, char *topicBuffer, uint16_t topicBufferSize, char *messageBuffer, size_t messageBufferSize) |
| Send a describe job query to the job query API. | |
| IoT_Error_t | aws_iot_jobs_send_update (AWS_IoT_Client *pClient, QoS qos, const char *thingName, const char *jobId, const AwsIotJobExecutionUpdateRequest *updateRequest, char *topicBuffer, uint16_t topicBufferSize, char *messageBuffer, size_t messageBufferSize) |
| Send an update about a job execution. | |
Detailed Description
An interface for interacting with the AWS IoT Jobs system.
Functions for interacting with the AWS IoT Jobs system.
This file defines utility functions for interacting with the AWS IoT jobs APIs over MQTT. It provides functions for managing subscriptions to job related topics and for sending queries and updates requests for jobs. Callers are responsible for managing the subscriptions and associating responses with the queries and update messages.
Definition in file aws_iot_jobs_interface.h.
Function Documentation
| IoT_Error_t aws_iot_jobs_describe | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| const char * | jobId, | ||
| const AwsIotDescribeJobExecutionRequest * | describeRequest, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize, | ||
| char * | messageBuffer, | ||
| size_t | messageBufferSize | ||
| ) |
Send a describe job query to the job query API.
Send a describe job query to the job query API. If jobId is null this requests a list of pending jobs for the thing. If jobId is not null then it sends a query for the details of that job.
- Parameters:
-
pClient the client to use qos the qos to use thingName the thing name to query for jobId the id of the job to query for. If null a list of all pending jobs for the thing is requested. describeRequest the describe request to send topicBuffer the topic buffer to use. This may be discarded as soon as this function returns topicBufferSize the size of topicBuffer messageBuffer the message buffer to use. May be NULL if clientToken is NULL messageBufferSize the size of messageBuffer
- Returns:
- LIMIT_EXCEEDED_ERROR if the topic buffer or message buffer is too small, NULL_VALUE_ERROR if the any of the required inputs are NULL, otherwise the result of the mqtt publish
Definition at line 141 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_send_query | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| const char * | jobId, | ||
| const char * | clientToken, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize, | ||
| char * | messageBuffer, | ||
| size_t | messageBufferSize, | ||
| AwsIotJobExecutionTopicType | topicType | ||
| ) |
Send a query to one of the job query APIs.
Send a query to one of the job query APIs. If jobId is null this requests a list of pending jobs for the thing. If jobId is not null then it sends a query for the details of that job. If jobId is $next then it sends a query for the details for the next pending job.
- Parameters:
-
pClient the client to use qos the qos to use thingName the thing name to query for jobId the id of the job to query for. If null a list of all pending jobs for the thing is requested. clientToken the client token to use for the query. If null no clientToken is sent resulting in an empty message. topicBuffer the topic buffer to use. This may be discarded as soon as this function returns topicBufferSize the size of topicBuffer messageBuffer the message buffer to use. May be NULL if clientToken is NULL messageBufferSize the size of messageBuffer topicType the topic type to publish query to
- Returns:
- LIMIT_EXCEEDED_ERROR if the topic buffer or message buffer is too small, NULL_VALUE_ERROR if the any of the required inputs are NULL, otherwise the result of the mqtt publish
Definition at line 69 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_send_update | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| const char * | jobId, | ||
| const AwsIotJobExecutionUpdateRequest * | updateRequest, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize, | ||
| char * | messageBuffer, | ||
| size_t | messageBufferSize | ||
| ) |
Send an update about a job execution.
Send an update about a job execution.
- Parameters:
-
pClient the client to use qos the qos to use thingName the thing name to send the update for jobId the id of the job to send the update for updateRequest the update request to send topicBuffer the topic buffer to use. This may be discarded as soon as this function returns topicBufferSize the size of topicBuffer messageBuffer the message buffer to use. messageBufferSize the size of messageBuffer
- Returns:
- LIMIT_EXCEEDED_ERROR if the topic buffer or message buffer is too small, NULL_VALUE_ERROR if the any of the required inputs are NULL, otherwise the result of the mqtt publish
Definition at line 181 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_start_next | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| const AwsIotStartNextPendingJobExecutionRequest * | startNextRequest, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize, | ||
| char * | messageBuffer, | ||
| size_t | messageBufferSize | ||
| ) |
Send a start next command to the job start-next API.
Send a start next command to the job start-next API.
- Parameters:
-
pClient the client to use qos the qos to use thingName the thing name to query for startNextRequest the start-next request to send topicBuffer the topic buffer to use. This may be discarded as soon as this function returns topicBufferSize the size of topicBuffer messageBuffer the message buffer to use. May be NULL if clientToken is NULL messageBufferSize the size of messageBuffer
- Returns:
- LIMIT_EXCEEDED_ERROR if the topic buffer or message buffer is too small, NULL_VALUE_ERROR if the any of the required inputs are NULL, otherwise the result of the mqtt publish
Definition at line 110 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_subscribe_to_all_job_messages | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| pApplicationHandler_t | pApplicationHandler, | ||
| void * | pApplicationHandlerData, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize | ||
| ) |
Subscribe to all job messages.
Subscribe to all job messages for the given thing.
- Note:
- Subscribing with the same thing more than once is undefined.
- Parameters:
-
pClient the client to use qos the qos to use thingName the name of the thing to subscribe to pApplicationHandler the callback handler pApplicationHandlerData the callback context data. This must remain valid at least until aws_iot_jobs_unsubscribe_from_job_messages is called. topicBuffer. A buffer to use to hold the topic name for the subscription. This buffer must remain valid at least until aws_iot_jobs_unsubscribe_from_job_messages is called. topicBufferSize the size of the topic buffer. The function will fail with LIMIT_EXCEEDED_ERROR if this is too small.
- Returns:
- the result of subscribing to the topic (see aws_iot_mqtt_subscribe)
Definition at line 50 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_subscribe_to_job_messages | ( | AWS_IoT_Client * | pClient, |
| QoS | qos, | ||
| const char * | thingName, | ||
| const char * | jobId, | ||
| AwsIotJobExecutionTopicType | topicType, | ||
| AwsIotJobExecutionTopicReplyType | replyType, | ||
| pApplicationHandler_t | pApplicationHandler, | ||
| void * | pApplicationHandlerData, | ||
| char * | topicBuffer, | ||
| uint16_t | topicBufferSize | ||
| ) |
Subscribe to jobs messages for the given thing and/or jobs.
The function can be used to subscribe to all job related messages. To subscribe to messages not related to a job the jobId passed should be null. The jobId can also be "+" to subscribe to messages related to any job, or "$next" to indicate the next pending job.
See also aws_iot_jobs_subscribe_to_all_job_messages to subscribe to all possible messages in one operation.
- Note:
- Subscribing with the same thing, job and topic type more than once is undefined.
- Parameters:
-
pClient the client to use qos the qos to use thingName the name of the thing to subscribe to jobId the job id to subscribe to. To subscribe to messages not related to a job the jobId passed should be null. The jobId can also be "+" to subscribe to messages related to any job, or "$next" to indicate the next pending job. topicType the topic type to subscribe to replyType the reply topic type to subscribe to pApplicationHandler the callback handler pApplicationHandlerData the callback context data. This must remain valid at least until aws_iot_jobs_unsubscribe_from_job_messages is called. topicBuffer. A buffer to use to hold the topic name for the subscription. This buffer must remain valid at least until aws_iot_jobs_unsubscribe_from_job_messages is called. topicBufferSize the size of the topic buffer. The function will fail with LIMIT_EXCEEDED_ERROR if this is too small.
- Returns:
- the result of subscribing to the topic (see aws_iot_mqtt_subscribe)
Definition at line 33 of file aws_iot_jobs_interface.c.
| IoT_Error_t aws_iot_jobs_unsubscribe_from_job_messages | ( | AWS_IoT_Client * | pClient, |
| char * | topicBuffer | ||
| ) |
Unsubscribe from a job subscription.
Remove the subscription created using aws_iot_jobs_subscribe_to_job_messages or aws_iot_jobs_subscribe_to_all_job_messages.
- Parameters:
-
pClient the client to use topicBuffer the topic buffer passed to aws_iot_jobs_subscribe_to_job_messages or aws_iot_jobs_subscribe_to_all_job_messages when the subscription was created.
- Returns:
- AWS_SUCCESS or the first error encountered.
Definition at line 62 of file aws_iot_jobs_interface.c.
Generated on Tue Jul 12 2022 19:02:38 by
1.7.2