AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_jobs.h
Go to the documentation of this file.
1/*
2 * lib_jobs.h
3 *
4 * Created on: 27 Apr 2021
5 * Author: Saheblal Bagwan
6 */
7
13#ifndef LIB_JOBS_H_
14#define LIB_JOBS_H_
15
16#include "stdutils.h"
17
18#define LENGTH_JOB_DOCUMENT 256 // should be greaterr than LENGTH_OTA_URL
19#define LENGTH_JOB_ID 32
20#define LENGTH_JOB_CLIENT_TOKEN 32
21
26typedef enum
27{
28 JOB_STATUS_IN_PROGRESS,
29 JOB_STATUS_SUCCESSED,
30 JOB_STATUS_FAILED,
31 JOB_STATUS_REJECTED,
32 JOB_STATUS_MAX,
34
38typedef struct
39{
40 uint32_t queuedAt_u32;
42 char idStr[LENGTH_JOB_ID];
43 char documentStr[LENGTH_JOB_DOCUMENT];
44} job_st;
45
51
58bool JOBS_register(char *pJobActionStr, uint8_t timeoutMin_u8, jobCallBack_t callbackHandler);
59
66void JOBS_updateStatus(char *pJobIdStr, jobsStatus_et status_e);
67
68#endif /* LIB_JOBS_H_ */
void JOBS_updateStatus(char *pJobIdStr, jobsStatus_et status_e)
Update the status of Job to AWS IoT.
jobsStatus_et
Definition: lib_jobs.h:27
jobsStatus_et(* jobCallBack_t)(job_st *ps_job)
Job callback handler type. The application should provide this handler to perform actions based on th...
Definition: lib_jobs.h:50
bool JOBS_register(char *pJobActionStr, uint8_t timeoutMin_u8, jobCallBack_t callbackHandler)
Register an AWS IoT Job handler.
Represents the structure used to handle AWS Jobs.
Definition: lib_jobs.h:39
uint32_t queuedAt_u32
Definition: lib_jobs.h:40
uint32_t currentTimeStamp_u32
Definition: lib_jobs.h:41