nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches
aws_iot.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
11
12#ifndef AWS_IOT_H__
13#define AWS_IOT_H__
14
15#include <stdio.h>
16#include <zephyr/net/mqtt.h>
17#include <dfu/dfu_target.h>
18
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
89
115
182
185
186 union {
192
198 };
199
201 const char *str;
202
204 size_t len;
205};
206
211
213 char *ptr;
214
216 size_t len;
217
219 enum mqtt_qos qos;
220
222 uint16_t message_id;
223
227 uint8_t dup_flag;
228
232 uint8_t retain_flag;
233};
234
239 union {
242
249 int err;
250
253
256
258 uint16_t message_id;
259
267};
268
273typedef void (*aws_iot_evt_handler_t)(const struct aws_iot_evt *evt);
274
281
286
291 const char *if_name;
292};
293
305
321int aws_iot_connect(const struct aws_iot_config *const config);
322
328
338int aws_iot_send(const struct aws_iot_data *const tx_data);
339
355int aws_iot_application_topics_set(const struct mqtt_topic *const list, size_t count);
356
357#ifdef __cplusplus
358}
359#endif
360
362
363#endif /* AWS_IOT_H__ */
int aws_iot_application_topics_set(const struct mqtt_topic *const list, size_t count)
Pass in a list of application specific topics that will be subscribed to upon connection to the AWS I...
int aws_iot_connect(const struct aws_iot_config *const config)
Connect to the AWS IoT broker.
int aws_iot_send(const struct aws_iot_data *const tx_data)
Send data to AWS IoT broker.
int aws_iot_disconnect(void)
Disconnect from the AWS IoT broker.
aws_iot_shadow_topic_received_type
AWS IoT shadow received topic types. If a message is received on a subscribed shadow topic,...
Definition aws_iot.h:33
@ AWS_IOT_SHADOW_TOPIC_DELETE_ACCEPTED
Definition aws_iot.h:80
@ AWS_IOT_SHADOW_TOPIC_UPDATE_DELTA
Definition aws_iot.h:60
@ AWS_IOT_SHADOW_TOPIC_GET_REJECTED
Definition aws_iot.h:52
@ AWS_IOT_SHADOW_TOPIC_GET_ACCEPTED
Definition aws_iot.h:42
@ AWS_IOT_SHADOW_TOPIC_DELETE_REJECTED
Definition aws_iot.h:87
@ AWS_IOT_SHADOW_TOPIC_UPDATE_REJECTED
Definition aws_iot.h:74
@ AWS_IOT_SHADOW_TOPIC_APPLICATION_SPECIFIC
Definition aws_iot.h:35
@ AWS_IOT_SHADOW_TOPIC_UPDATE_ACCEPTED
Definition aws_iot.h:67
aws_iot_shadow_topic_type
AWS IoT shadow topic types. Used to address messages to the AWS IoT shadow service.
Definition aws_iot.h:93
@ AWS_IOT_SHADOW_TOPIC_UPDATE
Definition aws_iot.h:107
@ AWS_IOT_SHADOW_TOPIC_NONE
Definition aws_iot.h:95
@ AWS_IOT_SHADOW_TOPIC_GET
Definition aws_iot.h:101
@ AWS_IOT_SHADOW_TOPIC_DELETE
Definition aws_iot.h:113
int aws_iot_init(aws_iot_evt_handler_t event_handler)
Initialize the library.
void(* aws_iot_evt_handler_t)(const struct aws_iot_evt *evt)
AWS IoT library asynchronous event handler.
Definition aws_iot.h:273
aws_iot_evt_type
AWS IoT notification event types, used to signal the application.
Definition aws_iot.h:117
@ AWS_IOT_EVT_CONNECTING
Definition aws_iot.h:119
@ AWS_IOT_EVT_FOTA_ERASE_DONE
Definition aws_iot.h:159
@ AWS_IOT_EVT_PUBACK
Definition aws_iot.h:137
@ AWS_IOT_EVT_FOTA_ERROR
Definition aws_iot.h:175
@ AWS_IOT_EVT_CONNECTED
Definition aws_iot.h:124
@ AWS_IOT_EVT_PINGRESP
Definition aws_iot.h:140
@ AWS_IOT_EVT_FOTA_START
Definition aws_iot.h:143
@ AWS_IOT_EVT_ERROR
Definition aws_iot.h:180
@ AWS_IOT_EVT_DATA_RECEIVED
Definition aws_iot.h:132
@ AWS_IOT_EVT_FOTA_DONE
Definition aws_iot.h:153
@ AWS_IOT_EVT_FOTA_ERASE_PENDING
Definition aws_iot.h:156
@ AWS_IOT_EVT_DISCONNECTED
Definition aws_iot.h:127
@ AWS_IOT_EVT_FOTA_DL_PROGRESS
Definition aws_iot.h:164
dfu_target_image_type
DFU image type.
Definition dfu_target.h:28
char * client_id
Definition aws_iot.h:280
char * host_name
Definition aws_iot.h:285
const char * if_name
Definition aws_iot.h:291
Structure for AWS IoT broker connection parameters.
Definition aws_iot.h:276
struct aws_iot_topic_data topic
Definition aws_iot.h:210
enum mqtt_qos qos
Definition aws_iot.h:219
uint8_t retain_flag
Definition aws_iot.h:232
uint16_t message_id
Definition aws_iot.h:222
size_t len
Definition aws_iot.h:216
char * ptr
Definition aws_iot.h:213
uint8_t dup_flag
Definition aws_iot.h:227
AWS IoT transmission data.
Definition aws_iot.h:208
enum aws_iot_evt_type type
Definition aws_iot.h:238
int fota_progress
Definition aws_iot.h:252
union aws_iot_evt::@204247047104332227255341254030310012326261012273 data
uint16_t message_id
Definition aws_iot.h:258
bool persistent_session
Definition aws_iot.h:255
enum dfu_target_image_type image
Definition aws_iot.h:265
int err
Definition aws_iot.h:249
struct aws_iot_data msg
Definition aws_iot.h:241
Struct with data received from AWS IoT broker.
Definition aws_iot.h:236
size_t len
Definition aws_iot.h:204
const char * str
Definition aws_iot.h:201
enum aws_iot_shadow_topic_received_type type_received
Definition aws_iot.h:197
enum aws_iot_shadow_topic_type type
Definition aws_iot.h:191
AWS IoT topic data.
Definition aws_iot.h:184