25#ifndef IOTMI_JOBS_HANDLER_H_
26#define IOTMI_JOBS_HANDLER_H_
39#define JOBS_HANDLER_JOBID_MAX_LENGTH 64U
293 const char* statusDetails,
size_t statusDetailsLength);
iotmi_JobCurrentStatus_t
Enumeration of possible job statuses.
Definition iotmi_jobs_handler.h:117
@ kJobCurrentStatusMax
The maximum value for job status.
Definition iotmi_jobs_handler.h:151
@ kJobInProgress
The job is currently being processed.
Definition iotmi_jobs_handler.h:131
@ kJobRejected
The job was rejected, possibly due to an error or invalid request.
Definition iotmi_jobs_handler.h:146
@ kJobFailed
The job processing failed.
Definition iotmi_jobs_handler.h:136
@ kJobCurrentStatusMin
The minimum value for job status.
Definition iotmi_jobs_handler.h:121
@ kJobSucceeded
The job processing succeeded.
Definition iotmi_jobs_handler.h:141
@ kJobQueued
The job is in the queue, waiting to be processed.
Definition iotmi_jobs_handler.h:126
JobsHandlerStatus_t iotmiJobsHandler_destroyJobDocument(iotmi_JobData_t *pJobDocument)
Destroy a job document.
JobsHandlerStatus_t iotmiJobsHandler_updateJobStatus(const char *pJobId, size_t jobIdLength, iotmi_JobCurrentStatus_t status, const char *statusDetails, size_t statusDetailsLength)
Update the status of a specific job with optional details.
JobsHandlerStatus_t iotmiJobsHandler_getJobDocument(iotmi_JobData_t *pJobDocument, uint32_t timeoutMs)
Retrieve a job document from the internal queue.
JobsHandlerStatus_t
Return codes from jobs functions.
Definition iotmi_jobs_handler.h:77
@ kJobsHandlerTimeout
The function timed out.
Definition iotmi_jobs_handler.h:101
@ kJobsHandlerError
An unspecified error occurred in the function.
Definition iotmi_jobs_handler.h:86
@ kJobsHandlerBadParameter
A function parameter was NULL or has an illegal value.
Definition iotmi_jobs_handler.h:91
@ kJobsHandlerSyncQueueError
An error occurred while using the PAL Sync Queue.
Definition iotmi_jobs_handler.h:111
@ kJobsHandlerOutOfMemory
The function ran out of memory.
Definition iotmi_jobs_handler.h:96
@ kJobsHandlerMqttAdapterError
An error occurred while using the MQTT adapter.
Definition iotmi_jobs_handler.h:106
@ kJobsHandlerSuccess
The function completed successfully.
Definition iotmi_jobs_handler.h:81
struct iotmi_JobDocument iotmi_JobData_t
Structure representing a job document.
struct iotmiJobsHandler_config iotmiJobsHandler_config_t
Configuration structure for initializing the Jobs Handler.
bool iotmiJobsHandler_isInitialized()
Check if the Jobs Handler is initialized.
JobsHandlerStatus_t iotmiJobsHandler_start(const iotmiJobsHandler_config_t *pConfig)
Initialize the Jobs Handler.
void iotmiJobsHandler_stop(void)
Stop the Jobs Handler and release all resources.
#define JOBS_HANDLER_JOBID_MAX_LENGTH
Maximum length of a job ID for the AWS IoT Jobs Service.
Definition iotmi_jobs_handler.h:39
JobsHandlerStatus_t iotmiJobsHandler_pollJobDocument()
Poll for a job document from the IoT Jobs service.
Structure representing a job document.
Definition iotmi_jobs_handler.h:157
size_t jobDocumentLength
Length of the job document content.
Definition iotmi_jobs_handler.h:179
size_t jobIdLength
Length of the job ID string.
Definition iotmi_jobs_handler.h:166
char pJobId[JOBS_HANDLER_JOBID_MAX_LENGTH+1]
job ID string.
Definition iotmi_jobs_handler.h:161
const char * pJobDocument
Pointer to the job document content in JSON format.
Definition iotmi_jobs_handler.h:174
Configuration structure for initializing the Jobs Handler.
Definition iotmi_jobs_handler.h:44
uint32_t mqttSubscribeTimeoutMs
The timeout for MQTT subscribe operations in milliseconds.
Definition iotmi_jobs_handler.h:71
const char * pThingName
The Thing Name for the jobs operations.
Definition iotmi_jobs_handler.h:50
size_t jobsQueueSize
The queue size for holding pending job documents.
Definition iotmi_jobs_handler.h:57
uint32_t mqttPublishTimeoutMs
The timeout for MQTT publish operations in milliseconds.
Definition iotmi_jobs_handler.h:64