AWS IoT Jobs
v1.0.0
Client library for AWS IoT Jobs
|
|
Go to the documentation of this file.
40 #define JOBS_THINGNAME_MAX_LENGTH 128U
46 #define JOBS_JOBID_MAX_LENGTH 64U
48 #ifndef THINGNAME_MAX_LENGTH
55 #define THINGNAME_MAX_LENGTH JOBS_THINGNAME_MAX_LENGTH
58 #ifndef JOBID_MAX_LENGTH
65 #define JOBID_MAX_LENGTH JOBS_JOBID_MAX_LENGTH
68 #if ( THINGNAME_MAX_LENGTH > JOBS_THINGNAME_MAX_LENGTH )
69 #error "The value of THINGNAME_MAX_LENGTH exceeds the AWS IoT Jobs Service limit."
72 #if ( JOBID_MAX_LENGTH > JOBS_JOBID_MAX_LENGTH )
73 #error "The value of JOBID_MAX_LENGTH exceeds the AWS IoT Jobs Service limit."
78 #define JOBS_API_PREFIX "$aws/things/"
79 #define JOBS_API_PREFIX_LENGTH ( sizeof( JOBS_API_PREFIX ) - 1U )
81 #define JOBS_API_BRIDGE "/jobs/"
82 #define JOBS_API_BRIDGE_LENGTH ( sizeof( JOBS_API_BRIDGE ) - 1U )
84 #define JOBS_API_SUCCESS "/accepted"
85 #define JOBS_API_SUCCESS_LENGTH ( sizeof( JOBS_API_SUCCESS ) - 1U )
87 #define JOBS_API_FAILURE "/rejected"
88 #define JOBS_API_FAILURE_LENGTH ( sizeof( JOBS_API_FAILURE ) - 1U )
90 #define JOBS_API_JOBSCHANGED "notify"
91 #define JOBS_API_JOBSCHANGED_LENGTH ( sizeof( JOBS_API_JOBSCHANGED ) - 1U )
93 #define JOBS_API_NEXTJOBCHANGED "notify-next"
94 #define JOBS_API_NEXTJOBCHANGED_LENGTH ( sizeof( JOBS_API_NEXTJOBCHANGED ) - 1U )
96 #define JOBS_API_GETPENDING "get"
97 #define JOBS_API_GETPENDING_LENGTH ( sizeof( JOBS_API_GETPENDING ) - 1U )
99 #define JOBS_API_STARTNEXT "start-next"
100 #define JOBS_API_STARTNEXT_LENGTH ( sizeof( JOBS_API_STARTNEXT ) - 1U )
102 #define JOBS_API_DESCRIBE "get"
103 #define JOBS_API_DESCRIBE_LENGTH ( sizeof( JOBS_API_DESCRIBE ) - 1U )
105 #define JOBS_API_UPDATE "update"
106 #define JOBS_API_UPDATE_LENGTH ( sizeof( JOBS_API_UPDATE ) - 1U )
108 #define JOBS_API_COMMON_LENGTH( thingNameLength ) \
109 ( JOBS_API_PREFIX_LENGTH + ( thingNameLength ) + JOBS_API_BRIDGE_LENGTH )
118 #define JOBS_API_MAX_LENGTH( thingNameLength ) \
119 ( JOBS_API_COMMON_LENGTH( thingNameLength ) + \
120 JOBID_MAX_LENGTH + sizeof( '/' ) + JOBS_API_UPDATE_LENGTH + \
121 JOBS_API_SUCCESS_LENGTH + 1U )
154 JobsInvalidTopic = -1,
157 JobsGetPendingSuccess,
158 JobsGetPendingFailed,
159 JobsStartNextSuccess,
192 const char * thingName,
193 uint16_t thingNameLength,
195 size_t * outLength );
225 const char * thingName,
226 uint16_t thingNameLength,
229 uint16_t * outJobIdLength );
254 const char * thingName,
255 uint16_t thingNameLength,
256 size_t * outLength );
281 const char * thingName,
282 uint16_t thingNameLength,
283 size_t * outLength );
310 const char * thingName,
311 uint16_t thingNameLength,
313 uint16_t jobIdLength,
314 size_t * outLength );
341 const char * thingName,
342 uint16_t thingNameLength,
344 uint16_t jobIdLength,
345 size_t * outLength );
JobsTopic_t
Topic values for subscription requests.
Definition: jobs.h:153
@ JobsSuccess
The buffer was properly written or a match was found.
Definition: jobs.h:130
@ JobsBufferTooSmall
The buffer write was truncated.
Definition: jobs.h:133
@ JobsNoMatch
The buffer does not contain a jobs topic.
Definition: jobs.h:131
JobsStatus_t Jobs_GetTopic(char *buffer, size_t length, const char *thingName, uint16_t thingNameLength, JobsTopic_t api, size_t *outLength)
Populate a topic string for a subscription request.
Definition: jobs.c:264
JobsStatus_t Jobs_Update(char *buffer, size_t length, const char *thingName, uint16_t thingNameLength, const char *jobId, uint16_t jobIdLength, size_t *outLength)
Populate a topic string for an UpdateJobExecution request.
Definition: jobs.c:648
JobsStatus_t
Return codes from jobs functions.
Definition: jobs.h:128
@ JobsBadParameter
A function parameter was NULL or has an illegal value.
Definition: jobs.h:132
JobsStatus_t Jobs_Describe(char *buffer, size_t length, const char *thingName, uint16_t thingNameLength, const char *jobId, uint16_t jobIdLength, size_t *outLength)
Populate a topic string for a DescribeJobExecution request.
Definition: jobs.c:608
JobsStatus_t Jobs_GetPending(char *buffer, size_t length, const char *thingName, uint16_t thingNameLength, size_t *outLength)
Populate a topic string for a GetPendingJobExecutions request.
Definition: jobs.c:542
JobsStatus_t Jobs_MatchTopic(char *topic, size_t length, const char *thingName, uint16_t thingNameLength, JobsTopic_t *outApi, char **outJobId, uint16_t *outJobIdLength)
Output a topic value if a Jobs API topic string is present. Optionally, output a pointer to a jobID w...
Definition: jobs.c:484
JobsStatus_t Jobs_StartNext(char *buffer, size_t length, const char *thingName, uint16_t thingNameLength, size_t *outLength)
Populate a topic string for a StartNextPendingJobExecution request.
Definition: jobs.c:575