AWS IoT Jobs v1.5.1
Client library for AWS IoT Jobs
 
Loading...
Searching...
No Matches
Jobs_StartNextMsg
size_t Jobs_StartNextMsg( const char * clientToken,
size_t clientTokenLength,
char * buffer,
size_t bufferSize );
size_t Jobs_StartNextMsg(const char *clientToken, size_t clientTokenLength, char *buffer, size_t bufferSize)
Populate a message string for a StartNextPendingJobExecution request.
Definition: jobs.c:718

Populate a message string for a StartNextPendingJobExecution request.

Parameters
clientTokenThe device's token
clientTokenLengthThe expected length of the clientToken
bufferThe buffer to be written to
bufferSizeThe size of the buffer
Returns
0 if write to buffer fails
The message length if the write is successful

Example

// The Following Example shows usage of the Jobs_StartNextMsg API
// to generate a message string for a StartNextPendingJobExecution request.
const char * clientToken = "test";
size_t clientTokenLength = ( sizeof( clientToken ) - 1U );
char messageBuffer[ START_JOB_MSG_LENGTH ] = {0};
size_t messageLength = 0U;
messageLength = Jobs_StartNextMsg( clientToken,
clientTokenLength,
messageBuffer,
if ( messageLength > 0 )
{
// The message string of the clientToken has been generated in
// the buffer, messageBuffer, for the StartNextPendingJobExecution request
// Publish to the topic string generated by Jobs_StartNext() using an
// MQTT client of your choice.
}
#define START_JOB_MSG_LENGTH
Size of Jobs Start Next Message Buffer.
Definition: jobs.h:55