AWS IoT Device SDK C: Jobs
AWS IoT Jobs library
Return to main page ↑
aws_iot_jobs.h
Go to the documentation of this file.
1 /*
2  * AWS IoT Jobs V1.0.0
3  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
28 #ifndef AWS_IOT_JOBS_H_
29 #define AWS_IOT_JOBS_H_
30 
31 /* The config header is always included first. */
32 #include "iot_config.h"
33 
34 /* Jobs types include. */
36 
37 /*------------------------- Jobs library functions --------------------------*/
38 
98 /* @[declare_jobs_init] */
99 AwsIotJobsError_t AwsIotJobs_Init( uint32_t mqttTimeoutMs );
100 /* @[declare_jobs_init] */
101 
115 /* @[declare_jobs_cleanup] */
116 void AwsIotJobs_Cleanup( void );
117 /* @[declare_jobs_cleanup] */
118 
184 /* @[declare_jobs_getpendingasync] */
186  uint32_t flags,
187  const AwsIotJobsCallbackInfo_t * pCallbackInfo,
188  AwsIotJobsOperation_t * const pGetPendingOperation );
189 /* @[declare_jobs_getpendingasync] */
190 
217 /* @[declare_jobs_getpendingsync] */
219  uint32_t flags,
220  uint32_t timeoutMs,
221  AwsIotJobsResponse_t * const pJobsResponse );
222 /* @[declare_jobs_getpendingsync] */
223 
291 /* @[declare_jobs_startnextasync] */
293  const AwsIotJobsUpdateInfo_t * pUpdateInfo,
294  uint32_t flags,
295  const AwsIotJobsCallbackInfo_t * pCallbackInfo,
296  AwsIotJobsOperation_t * const pStartNextOperation );
297 /* @[declare_jobs_startnextasync] */
298 
326 /* @[declare_jobs_startnextsync] */
328  const AwsIotJobsUpdateInfo_t * pUpdateInfo,
329  uint32_t flags,
330  uint32_t timeoutMs,
331  AwsIotJobsResponse_t * const pJobsResponse );
332 /* @[declare_jobs_startnextsync] */
333 
408 /* @[declare_jobs_describeasync] */
410  int32_t executionNumber,
411  bool includeJobDocument,
412  uint32_t flags,
413  const AwsIotJobsCallbackInfo_t * pCallbackInfo,
414  AwsIotJobsOperation_t * const pDescribeOperation );
415 /* @[declare_jobs_describeasync] */
416 
447 /* @[declare_jobs_describesync] */
449  int32_t executionNumber,
450  bool includeJobDocument,
451  uint32_t flags,
452  uint32_t timeoutMs,
453  AwsIotJobsResponse_t * const pJobsResponse );
454 /* @[declare_jobs_describesync] */
455 
528 /* @[declare_jobs_updateasync] */
530  const AwsIotJobsUpdateInfo_t * pUpdateInfo,
531  uint32_t flags,
532  const AwsIotJobsCallbackInfo_t * pCallbackInfo,
533  AwsIotJobsOperation_t * const pUpdateOperation );
534 /* @[declare_jobs_updateasync] */
535 
563 /* @[declare_jobs_updatesync] */
565  const AwsIotJobsUpdateInfo_t * pUpdateInfo,
566  uint32_t flags,
567  uint32_t timeoutMs,
568  AwsIotJobsResponse_t * const pJobsResponse );
569 /* @[declare_jobs_updatesync] */
570 
654 /* @[declare_jobs_wait] */
656  uint32_t timeoutMs,
657  AwsIotJobsResponse_t * const pJobsResponse );
658 /* @[declare_jobs_wait] */
659 
745 /* @[declare_jobs_setnotifypendingcallback] */
747  const char * pThingName,
748  size_t thingNameLength,
749  uint32_t flags,
750  const AwsIotJobsCallbackInfo_t * pNotifyPendingCallback );
751 /* @[declare_jobs_setnotifypendingcallback] */
752 
838 /* @[declare_jobs_setnotifynextcallback] */
840  const char * pThingName,
841  size_t thingNameLength,
842  uint32_t flags,
843  const AwsIotJobsCallbackInfo_t * pNotifyNextCallback );
844 /* @[declare_jobs_setnotifynextcallback] */
845 
881 /* @[declare_jobs_removepersistentsubscriptions] */
883  uint32_t flags );
884 /* @[declare_jobs_removepersistentsubscriptions] */
885 
886 /*-------------------------- Jobs helper functions --------------------------*/
887 
904 /* @[declare_jobs_strerror] */
905 const char * AwsIotJobs_strerror( AwsIotJobsError_t status );
906 /* @[declare_jobs_strerror] */
907 
923 /* @[declare_jobs_statename] */
924 const char * AwsIotJobs_StateName( AwsIotJobState_t state );
925 /* @[declare_jobs_statename] */
926 
927 #endif /* ifndef AWS_IOT_JOBS_H_ */
struct _jobsOperation * AwsIotJobsOperation_t
Opaque handle that references an in-progress Jobs operation.
Definition: aws_iot_jobs_types.h:66
AwsIotJobsError_t AwsIotJobs_DescribeAsync(const AwsIotJobsRequestInfo_t *pRequestInfo, int32_t executionNumber, bool includeJobDocument, uint32_t flags, const AwsIotJobsCallbackInfo_t *pCallbackInfo, AwsIotJobsOperation_t *const pDescribeOperation)
Get detailed information about a job execution and receive an asynchronous notification when the resp...
Definition: aws_iot_jobs_api.c:1165
Output parameter of blocking Jobs API functions.
Definition: aws_iot_jobs_types.h:649
AwsIotJobsError_t AwsIotJobs_UpdateSync(const AwsIotJobsRequestInfo_t *pRequestInfo, const AwsIotJobsUpdateInfo_t *pUpdateInfo, uint32_t flags, uint32_t timeoutMs, AwsIotJobsResponse_t *const pJobsResponse)
Update the status of a job execution with a timeout for receiving the response.
Definition: aws_iot_jobs_api.c:1342
AwsIotJobsError_t AwsIotJobs_GetPendingSync(const AwsIotJobsRequestInfo_t *pRequestInfo, uint32_t flags, uint32_t timeoutMs, AwsIotJobsResponse_t *const pJobsResponse)
Get the list of all pending jobs for a Thing with a timeout for receiving the response.
Definition: aws_iot_jobs_api.c:1028
AwsIotJobsError_t
Return codes of Jobs functions.
Definition: aws_iot_jobs_types.h:87
Common information provided to Jobs requests.
Definition: aws_iot_jobs_types.h:569
struct _mqttConnection * IotMqttConnection_t
AwsIotJobsError_t AwsIotJobs_Wait(AwsIotJobsOperation_t operation, uint32_t timeoutMs, AwsIotJobsResponse_t *const pJobsResponse)
Wait for a Jobs operation to complete.
Definition: aws_iot_jobs_api.c:1374
AwsIotJobsError_t AwsIotJobs_SetNotifyPendingCallback(IotMqttConnection_t mqttConnection, const char *pThingName, size_t thingNameLength, uint32_t flags, const AwsIotJobsCallbackInfo_t *pNotifyPendingCallback)
Set a callback to be invoked when the list of pending Jobs changes.
Definition: aws_iot_jobs_api.c:1454
AwsIotJobState_t
Possible states of jobs.
Definition: aws_iot_jobs_types.h:358
AwsIotJobsError_t AwsIotJobs_DescribeSync(const AwsIotJobsRequestInfo_t *pRequestInfo, int32_t executionNumber, bool includeJobDocument, uint32_t flags, uint32_t timeoutMs, AwsIotJobsResponse_t *const pJobsResponse)
Get detailed information about a job execution with a timeout for receiving the response.
Definition: aws_iot_jobs_api.c:1233
Information on a user-provided Jobs callback function.
Definition: aws_iot_jobs_types.h:501
Information on a Job update for AwsIotJobs_StartNextAsync and AwsIotJobs_UpdateAsync. These functions modify a Job's state.
Definition: aws_iot_jobs_types.h:666
AwsIotJobsError_t AwsIotJobs_StartNextAsync(const AwsIotJobsRequestInfo_t *pRequestInfo, const AwsIotJobsUpdateInfo_t *pUpdateInfo, uint32_t flags, const AwsIotJobsCallbackInfo_t *pCallbackInfo, AwsIotJobsOperation_t *const pStartNextOperation)
Start the next pending job execution for a Thing and receive an asynchronous notification when the re...
Definition: aws_iot_jobs_api.c:1058
AwsIotJobsError_t AwsIotJobs_UpdateAsync(const AwsIotJobsRequestInfo_t *pRequestInfo, const AwsIotJobsUpdateInfo_t *pUpdateInfo, uint32_t flags, const AwsIotJobsCallbackInfo_t *pCallbackInfo, AwsIotJobsOperation_t *const pUpdateOperation)
Update the status of a job execution and receive an asynchronous notification when the Job update com...
Definition: aws_iot_jobs_api.c:1267
const char * AwsIotJobs_strerror(AwsIotJobsError_t status)
Returns a string that describes an AwsIotJobsError_t.
Definition: aws_iot_jobs_api.c:1490
AwsIotJobsError_t AwsIotJobs_SetNotifyNextCallback(IotMqttConnection_t mqttConnection, const char *pThingName, size_t thingNameLength, uint32_t flags, const AwsIotJobsCallbackInfo_t *pNotifyNextCallback)
Set a callback to be invoked when the next pending Job changes.
Definition: aws_iot_jobs_api.c:1472
Types of the Jobs library.
const char * AwsIotJobs_StateName(AwsIotJobState_t state)
Returns a string that describes an AwsIotJobState_t.
Definition: aws_iot_jobs_api.c:1578
void AwsIotJobs_Cleanup(void)
One-time deinitialization function for the Jobs library.
Definition: aws_iot_jobs_api.c:929
AwsIotJobsError_t AwsIotJobs_Init(uint32_t mqttTimeoutMs)
One-time initialization function for the Jobs library.
Definition: aws_iot_jobs_api.c:887
AwsIotJobsError_t AwsIotJobs_GetPendingAsync(const AwsIotJobsRequestInfo_t *pRequestInfo, uint32_t flags, const AwsIotJobsCallbackInfo_t *pCallbackInfo, AwsIotJobsOperation_t *const pGetPendingOperation)
Get the list of all pending jobs for a Thing and receive an asynchronous notification when the respon...
Definition: aws_iot_jobs_api.c:966
AwsIotJobsError_t AwsIotJobs_StartNextSync(const AwsIotJobsRequestInfo_t *pRequestInfo, const AwsIotJobsUpdateInfo_t *pUpdateInfo, uint32_t flags, uint32_t timeoutMs, AwsIotJobsResponse_t *const pJobsResponse)
Start the next pending job execution for a Thing with a timeout for receiving the response...
Definition: aws_iot_jobs_api.c:1133
AwsIotJobsError_t AwsIotJobs_RemovePersistentSubscriptions(const AwsIotJobsRequestInfo_t *pRequestInfo, uint32_t flags)
Remove persistent Jobs operation topic subscriptions.
Definition: aws_iot_jobs_subscription.c:432