nRF Connect SDK API 0.1.0
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
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
25#ifdef __cplusplus
26extern "C" {
27#endif
28
36
43
53
61
68
75
81
88};
89
96
102
108
115
120
125
128
133
138
141
144
154
157
160
165
168
174
177
178 union {
184
190 };
191
193 const char *str;
194
196 size_t len;
197};
198
203
205 char *ptr;
206
208 size_t len;
209
211 enum mqtt_qos qos;
212
214 uint16_t message_id;
215
219 uint8_t dup_flag;
220
224 uint8_t retain_flag;
225};
226
231 union {
234
238 int err;
239
242
245
247 uint16_t message_id;
248
256};
257
262typedef void (*aws_iot_evt_handler_t)(const struct aws_iot_evt *evt);
263
270
275};
276
288
304int aws_iot_connect(const struct aws_iot_config *const config);
305
311
321int aws_iot_send(const struct aws_iot_data *const tx_data);
322
338int aws_iot_application_topics_set(const struct mqtt_topic *const list, size_t count);
339
340#ifdef __cplusplus
341}
342#endif
343
346#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:262
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:167
@ 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:172
@ 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:269
char * host_name
Definition: aws_iot.h:274
Structure for AWS IoT broker connection parameters.
Definition: aws_iot.h:265
struct aws_iot_topic_data topic
Definition: aws_iot.h:202
enum mqtt_qos qos
Definition: aws_iot.h:211
uint8_t retain_flag
Definition: aws_iot.h:224
uint16_t message_id
Definition: aws_iot.h:214
size_t len
Definition: aws_iot.h:208
char * ptr
Definition: aws_iot.h:205
uint8_t dup_flag
Definition: aws_iot.h:219
AWS IoT transmission data.
Definition: aws_iot.h:200
enum aws_iot_evt_type type
Definition: aws_iot.h:230
int fota_progress
Definition: aws_iot.h:241
uint16_t message_id
Definition: aws_iot.h:247
bool persistent_session
Definition: aws_iot.h:244
union aws_iot_evt::@189 data
enum dfu_target_image_type image
Definition: aws_iot.h:254
int err
Definition: aws_iot.h:238
struct aws_iot_data msg
Definition: aws_iot.h:233
Struct with data received from AWS IoT broker.
Definition: aws_iot.h:228
size_t len
Definition: aws_iot.h:196
const char * str
Definition: aws_iot.h:193
enum aws_iot_shadow_topic_received_type type_received
Definition: aws_iot.h:189
enum aws_iot_shadow_topic_type type
Definition: aws_iot.h:183
AWS IoT topic data.
Definition: aws_iot.h:176