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