nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
aws_jobs.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/types.h>
#include <zephyr/net/mqtt.h>

Go to the source code of this file.

Macros

#define AWS   "$aws/things/"
 The max JOB_ID_LEN according to AWS docs https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html.
 
#define AWS_LEN   (sizeof(AWS) - 1)
 
#define AWS_JOBS_JOB_ID_MAX_LEN   (64 + 1)
 
#define AWS_JOBS_TOPIC_STATIC_LEN   20 /* '$aws/token' etc... */
 
#define AWS_JOBS_TOPIC_MAX_LEN
 
MQTT message IDs used for identifying subscribe message ACKs
#define SUBSCRIBE_ID_BASE   (2110)
 
#define SUBSCRIBE_NOTIFY   (SUBSCRIBE_ID_BASE + 1)
 
#define SUBSCRIBE_NOTIFY_NEXT   (SUBSCRIBE_ID_BASE + 2)
 
#define SUBSCRIBE_GET   (SUBSCRIBE_ID_BASE + 3)
 
#define SUBSCRIBE_JOB_ID_GET   (SUBSCRIBE_ID_BASE + 4)
 
#define SUBSCRIBE_JOB_ID_UPDATE   (SUBSCRIBE_ID_BASE + 5)
 
#define SUBSCRIBE_EXPECTED   (SUBSCRIBE_ID_BASE + 10)
 

Enumerations

enum  execution_status {
  AWS_JOBS_QUEUED = 0 , AWS_JOBS_IN_PROGRESS , AWS_JOBS_SUCCEEDED , AWS_JOBS_FAILED ,
  AWS_JOBS_TIMED_OUT , AWS_JOBS_REJECTED , AWS_JOBS_REMOVED , AWS_JOBS_CANCELED
}
 Job Execution Status. More...
 

Functions

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_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_create_topic_notify (struct mqtt_client *const client, uint8_t *topic_buf)
 Construct the notify topic for 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_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_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_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.
 
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_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 when submitting a job execution update.
 
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 feedback from the job execution.
 
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_get_job_execution (struct mqtt_client *const client, const char *job_id, uint8_t *topic_buf)
 AWS Jobs get job execution.
 
bool aws_jobs_cmp (const char *sub, const char *pub, size_t pub_len, const uint8_t *suffix)
 Compare topics.