nRF Connect SDK API 2.8.0
Loading...
Searching...
No Matches
azure_iot_hub.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
11#ifndef AZURE_IOT_HUB__
12#define AZURE_IOT_HUB__
13
14#include <stdio.h>
15#include <zephyr/net/mqtt.h>
16
23#ifdef __cplusplus
24extern "C" {
25#endif
26
144
178
181 /* Pointer to buffer. */
182 char *ptr;
183
184 /* Size of buffer. */
185 size_t size;
186};
187
202
207
210
211 /* Array of property bags. */
213
214 /* Number of property bag elements in the properties array. */
216};
217
222
225
228
230 enum mqtt_qos qos;
231
233 uint16_t message_id;
234
238 uint8_t dup_flag;
239
243 uint8_t retain_flag;
244};
245
257
275
280 union {
284 int err;
286 uint16_t message_id;
288 /* Associated topic, not relevant for all events. */
290};
291
297
322
336
354
364
379int azure_iot_hub_send(const struct azure_iot_hub_msg *const tx_data);
380
393
394#ifdef __cplusplus
395}
396#endif
397
402#endif /* AZURE_IOT_HUB__ */
int azure_iot_hub_send(const struct azure_iot_hub_msg *const tx_data)
Send data to Azure IoT Hub.
void(* azure_iot_hub_evt_handler_t)(struct azure_iot_hub_evt *evt)
Azure IoT Hub library event handler.
Definition azure_iot_hub.h:296
int azure_iot_hub_init(azure_iot_hub_evt_handler_t event_handler)
Initialize the module.
azure_iot_hub_evt_type
Azure IoT Hub notification events used to notify the user.
Definition azure_iot_hub.h:28
@ AZURE_IOT_HUB_EVT_CONNECTING
Definition azure_iot_hub.h:32
@ AZURE_IOT_HUB_EVT_TWIN_RESULT_FAIL
Definition azure_iot_hub.h:96
@ AZURE_IOT_HUB_EVT_CONNECTED
Definition azure_iot_hub.h:37
@ AZURE_IOT_HUB_EVT_PINGRESP
Definition azure_iot_hub.h:70
@ AZURE_IOT_HUB_EVT_ERROR
Definition azure_iot_hub.h:142
@ AZURE_IOT_HUB_EVT_DIRECT_METHOD
Definition azure_iot_hub.h:106
@ AZURE_IOT_HUB_EVT_DATA_RECEIVED
Definition azure_iot_hub.h:60
@ AZURE_IOT_HUB_EVT_FOTA_ERASE_PENDING
Definition azure_iot_hub.h:122
@ AZURE_IOT_HUB_EVT_FOTA_DONE
Definition azure_iot_hub.h:116
@ AZURE_IOT_HUB_EVT_TWIN_RESULT_SUCCESS
Definition azure_iot_hub.h:91
@ AZURE_IOT_HUB_EVT_DISCONNECTED
Definition azure_iot_hub.h:53
@ AZURE_IOT_HUB_EVT_FOTA_START
Definition azure_iot_hub.h:111
@ AZURE_IOT_HUB_EVT_FOTA_ERROR
Definition azure_iot_hub.h:132
@ AZURE_IOT_HUB_EVT_PUBACK
Definition azure_iot_hub.h:65
@ AZURE_IOT_HUB_EVT_CONNECTION_FAILED
Definition azure_iot_hub.h:43
@ AZURE_IOT_HUB_EVT_READY
Definition azure_iot_hub.h:48
@ AZURE_IOT_HUB_EVT_TWIN_RECEIVED
Definition azure_iot_hub.h:77
@ AZURE_IOT_HUB_EVT_TWIN_DESIRED_RECEIVED
Definition azure_iot_hub.h:84
@ AZURE_IOT_HUB_EVT_FOTA_ERASE_DONE
Definition azure_iot_hub.h:127
@ AZURE_IOT_HUB_EVT_ERROR_MSG_SIZE
Definition azure_iot_hub.h:137
int azure_iot_hub_disconnect(void)
Disconnect from Azure IoT Hub. Calling this function initiates the disconnection procedure,...
int azure_iot_hub_connect(const struct azure_iot_hub_config *config)
Establish connection to Azure IoT Hub. The function blocks until a connection to the hub is establish...
azure_iot_hub_topic_type
Azure IoT Hub topic type, used to route messages to the correct destination.
Definition azure_iot_hub.h:148
@ AZURE_IOT_HUB_TOPIC_TWIN_REQUEST_RESULT
Definition azure_iot_hub.h:161
@ AZURE_IOT_HUB_TOPIC_DEVICEBOUND
Definition azure_iot_hub.h:150
@ AZURE_IOT_HUB_TOPIC_DIRECT_METHOD
Definition azure_iot_hub.h:153
@ AZURE_IOT_HUB_TOPIC_EVENT
Definition azure_iot_hub.h:167
@ AZURE_IOT_HUB_TOPIC_TWIN_REQUEST
Definition azure_iot_hub.h:173
@ AZURE_IOT_HUB_TOPIC_DPS
Definition azure_iot_hub.h:164
@ AZURE_IOT_HUB_TOPIC_TWIN_DESIRED
Definition azure_iot_hub.h:156
@ AZURE_IOT_HUB_TOPIC_UNKNOWN
Definition azure_iot_hub.h:176
@ AZURE_IOT_HUB_TOPIC_TWIN_REPORTED
Definition azure_iot_hub.h:170
int azure_iot_hub_method_respond(struct azure_iot_hub_result *result)
Send response to a direct method invoked from the cloud.
char * ptr
Definition azure_iot_hub.h:182
size_t size
Definition azure_iot_hub.h:185
Definition azure_iot_hub.h:180
struct azure_iot_hub_buf hostname
Definition azure_iot_hub.h:305
struct azure_iot_hub_buf device_id
Definition azure_iot_hub.h:309
bool use_dps
Definition azure_iot_hub.h:320
Structure for Azure IoT Hub connection parameters.
Definition azure_iot_hub.h:299
struct azure_iot_hub_method method
Definition azure_iot_hub.h:282
uint16_t message_id
Definition azure_iot_hub.h:286
struct azure_iot_hub_result result
Definition azure_iot_hub.h:283
enum azure_iot_hub_evt_type type
Definition azure_iot_hub.h:279
bool persistent_session
Definition azure_iot_hub.h:285
union azure_iot_hub_evt::@195 data
struct azure_iot_hub_msg msg
Definition azure_iot_hub.h:281
int err
Definition azure_iot_hub.h:284
struct azure_iot_hub_topic_data topic
Definition azure_iot_hub.h:289
Struct with data received from Azure IoT Hub.
Definition azure_iot_hub.h:277
struct azure_iot_hub_buf request_id
Definition azure_iot_hub.h:252
struct azure_iot_hub_buf payload
Definition azure_iot_hub.h:255
struct azure_iot_hub_buf name
Definition azure_iot_hub.h:249
Azure IoT Hub direct method data.
Definition azure_iot_hub.h:247
uint16_t message_id
Definition azure_iot_hub.h:233
struct azure_iot_hub_buf payload
Definition azure_iot_hub.h:224
struct azure_iot_hub_topic_data topic
Definition azure_iot_hub.h:221
uint8_t retain_flag
Definition azure_iot_hub.h:243
uint8_t dup_flag
Definition azure_iot_hub.h:238
enum mqtt_qos qos
Definition azure_iot_hub.h:230
struct azure_iot_hub_buf request_id
Definition azure_iot_hub.h:227
Azure IoT Hub transmission data.
Definition azure_iot_hub.h:219
struct azure_iot_hub_buf value
Definition azure_iot_hub.h:200
struct azure_iot_hub_buf key
Definition azure_iot_hub.h:197
Property bag structure for key/value string pairs. Per Azure IoT Hub documentation,...
Definition azure_iot_hub.h:195
uint32_t status
Definition azure_iot_hub.h:270
struct azure_iot_hub_buf request_id
Definition azure_iot_hub.h:267
struct azure_iot_hub_buf payload
Definition azure_iot_hub.h:273
Azure IoT Hub result structure.
Definition azure_iot_hub.h:265
struct azure_iot_hub_property * properties
Definition azure_iot_hub.h:212
size_t property_count
Definition azure_iot_hub.h:215
enum azure_iot_hub_topic_type type
Definition azure_iot_hub.h:206
struct azure_iot_hub_buf name
Definition azure_iot_hub.h:209
Azure IoT Hub topic data.
Definition azure_iot_hub.h:204