AWS IoT Over-the-air Update v3.2.0
Client library for AWS IoT OTA
ota_mqtt_interface.h
Go to the documentation of this file.
1/*
2 * AWS IoT Over-the-air Update v3.2.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
28#ifndef OTA_MQTT_INTERFACE_H
29#define OTA_MQTT_INTERFACE_H
30
31/* *INDENT-OFF* */
32#ifdef __cplusplus
33 extern "C" {
34#endif
35/* *INDENT-ON* */
36
37/* Standard library includes. */
38#include <stddef.h>
39#include <stdint.h>
40
87typedef enum OtaMqttStatus
88{
94
111typedef OtaMqttStatus_t ( * OtaMqttSubscribe_t ) ( const char * pTopicFilter,
112 uint16_t topicFilterLength,
113 uint8_t ucQoS );
114
130typedef OtaMqttStatus_t ( * OtaMqttUnsubscribe_t ) ( const char * pTopicFilter,
131 uint16_t topicFilterLength,
132 uint8_t ucQoS );
133
151typedef OtaMqttStatus_t ( * OtaMqttPublish_t )( const char * const pacTopic,
152 uint16_t usTopicLen,
153 const char * pcMsg,
154 uint32_t ulMsgSize,
155 uint8_t ucQoS );
156
161typedef struct OtaMqttInterface
162{
167
168/* *INDENT-OFF* */
169#ifdef __cplusplus
170 }
171#endif
172/* *INDENT-ON* */
173
174#endif /* ifndef OTA_MQTT_INTERFACE_H */
OtaMqttStatus_t
The OTA MQTT interface return status.
Definition: ota_mqtt_interface.h:88
@ OtaMqttSuccess
OTA MQTT interface success.
Definition: ota_mqtt_interface.h:89
@ OtaMqttUnsubscribeFailed
Failed to unsubscribe from a topic.
Definition: ota_mqtt_interface.h:92
@ OtaMqttPublishFailed
Attempt to publish a MQTT message failed.
Definition: ota_mqtt_interface.h:90
@ OtaMqttSubscribeFailed
Failed to subscribe to a topic.
Definition: ota_mqtt_interface.h:91
OtaMqttStatus_t(* OtaMqttSubscribe_t)(const char *pTopicFilter, uint16_t topicFilterLength, uint8_t ucQoS)
Subscribe to the Mqtt topics.
Definition: ota_mqtt_interface.h:111
OtaMqttStatus_t(* OtaMqttPublish_t)(const char *const pacTopic, uint16_t usTopicLen, const char *pcMsg, uint32_t ulMsgSize, uint8_t ucQoS)
Publish message to a topic.
Definition: ota_mqtt_interface.h:151
OtaMqttStatus_t(* OtaMqttUnsubscribe_t)(const char *pTopicFilter, uint16_t topicFilterLength, uint8_t ucQoS)
Unsubscribe to the Mqtt topics.
Definition: ota_mqtt_interface.h:130
OTA Event Interface structure.
Definition: ota_mqtt_interface.h:162
OtaMqttPublish_t publish
Interface for publishing MQTT messages.
Definition: ota_mqtt_interface.h:165
OtaMqttSubscribe_t subscribe
Interface for subscribing to Mqtt topics.
Definition: ota_mqtt_interface.h:163
OtaMqttUnsubscribe_t unsubscribe
interface for unsubscribing to MQTT topics.
Definition: ota_mqtt_interface.h:164