23#include <zephyr/kernel.h>
24#include <zephyr/types.h>
25#include <zephyr/net/mqtt.h>
42#define SUBSCRIBE_ID_BASE (2110)
43#define SUBSCRIBE_NOTIFY (SUBSCRIBE_ID_BASE + 1)
44#define SUBSCRIBE_NOTIFY_NEXT (SUBSCRIBE_ID_BASE + 2)
45#define SUBSCRIBE_GET (SUBSCRIBE_ID_BASE + 3)
46#define SUBSCRIBE_JOB_ID_GET (SUBSCRIBE_ID_BASE + 4)
47#define SUBSCRIBE_JOB_ID_UPDATE (SUBSCRIBE_ID_BASE + 5)
48#define SUBSCRIBE_EXPECTED (SUBSCRIBE_ID_BASE + 10)
55#define AWS "$aws/things/"
56#define AWS_LEN (sizeof(AWS) - 1)
57#define AWS_JOBS_JOB_ID_MAX_LEN (64 + 1)
58#define AWS_JOBS_TOPIC_STATIC_LEN 20
59#define AWS_JOBS_TOPIC_MAX_LEN (CONFIG_CLIENT_ID_MAX_LEN + \
60 AWS_JOBS_TOPIC_STATIC_LEN + AWS_JOBS_JOB_ID_MAX_LEN)
163 const uint8_t *job_id, uint8_t *topic_buf);
178 const uint8_t *job_id, uint8_t *topic_buf);
194 const uint8_t *job_id, uint8_t *topic_buf);
209 const uint8_t *job_id, uint8_t *topic_buf);
225 const uint8_t *job_id, uint8_t *topic_buf);
251 const uint8_t *job_id,
253 const uint8_t *status_details,
254 int expected_version,
255 const uint8_t *client_token,
273 const char *job_id, uint8_t *topic_buf);
289 const uint8_t *suffix);
int aws_jobs_create_topic_notify_next(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify-next topic for receiving AWS IoT jobs.
int aws_jobs_update_job_execution(struct mqtt_client *const client, const uint8_t *job_id, enum execution_status status, const uint8_t *status_details, int expected_version, const uint8_t *client_token, uint8_t *topic_buf)
AWS Jobs update job execution status function.
int aws_jobs_subscribe_topic_notify_next(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify-next topic and subscribe to it for receiving AWS IoT jobs.
int aws_jobs_unsubscribe_topic_notify_next(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify-next topic and unsubscribe from it to stop receiving AWS IoT jobs.
int aws_jobs_subscribe_topic_notify(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify topic and subscribe to it for receiving AWS IoT jobs lists.
int aws_jobs_subscribe_topic_update(struct mqtt_client *const client, const uint8_t *job_id, uint8_t *topic_buf)
Construct the update topic for a job ID and subscribe to rejected and accepted to receive feedback wh...
int aws_jobs_create_topic_get(struct mqtt_client *const client, const uint8_t *job_id, uint8_t *topic_buf)
Construct the get topic for a job ID.
int aws_jobs_unsubscribe_topic_notify(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify topic and unsubscribe to stop receiving AWS IoT jobs lists.
int aws_jobs_get_job_execution(struct mqtt_client *const client, const char *job_id, uint8_t *topic_buf)
AWS Jobs get job execution.
execution_status
Job Execution Status.
Definition aws_jobs.h:28
@ AWS_JOBS_SUCCEEDED
Definition aws_jobs.h:31
@ AWS_JOBS_IN_PROGRESS
Definition aws_jobs.h:30
@ AWS_JOBS_REJECTED
Definition aws_jobs.h:34
@ AWS_JOBS_REMOVED
Definition aws_jobs.h:35
@ AWS_JOBS_TIMED_OUT
Definition aws_jobs.h:33
@ AWS_JOBS_QUEUED
Definition aws_jobs.h:29
@ AWS_JOBS_CANCELED
Definition aws_jobs.h:36
@ AWS_JOBS_FAILED
Definition aws_jobs.h:32
int aws_jobs_unsubscribe_topic_update(struct mqtt_client *const client, const uint8_t *job_id, uint8_t *topic_buf)
Construct the update topic for a job ID and unsubscribe from rejected and accepted to stop receiving ...
int aws_jobs_unsubscribe_topic_get(struct mqtt_client *const client, const uint8_t *job_id, uint8_t *topic_buf)
Construct the get topic for a job ID and unsubscribe from it for both accepted and rejected.
int aws_jobs_create_topic_notify(struct mqtt_client *const client, uint8_t *topic_buf)
Construct the notify topic for receiving AWS IoT jobs.
bool aws_jobs_cmp(const char *sub, const char *pub, size_t pub_len, const uint8_t *suffix)
Compare topics.
int aws_jobs_subscribe_topic_get(struct mqtt_client *const client, const uint8_t *job_id, uint8_t *topic_buf)
Construct the get topic for a job ID and subscribe to it for both accepted and rejected.