AWS IoT Over-the-air Update  v3.1.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.1.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 
87 typedef enum OtaMqttStatus
88 {
94 
111 typedef OtaMqttStatus_t ( * OtaMqttSubscribe_t ) ( const char * pTopicFilter,
112  uint16_t topicFilterLength,
113  uint8_t ucQoS );
114 
130 typedef OtaMqttStatus_t ( * OtaMqttUnsubscribe_t ) ( const char * pTopicFilter,
131  uint16_t topicFilterLength,
132  uint8_t ucQoS );
133 
151 typedef 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 
161 typedef struct OtaMqttInterface
162 {
167 
168 /* *INDENT-OFF* */
169 #ifdef __cplusplus
170  }
171 #endif
172 /* *INDENT-ON* */
173 
174 #endif /* ifndef OTA_MQTT_INTERFACE_H */
OtaMqttInterface_t::publish
OtaMqttPublish_t publish
Interface for publishing MQTT messages.
Definition: ota_mqtt_interface.h:165
OtaMqttUnsubscribe_t
OtaMqttStatus_t(* OtaMqttUnsubscribe_t)(const char *pTopicFilter, uint16_t topicFilterLength, uint8_t ucQoS)
Unsubscribe to the Mqtt topics.
Definition: ota_mqtt_interface.h:130
OtaMqttSubscribe_t
OtaMqttStatus_t(* OtaMqttSubscribe_t)(const char *pTopicFilter, uint16_t topicFilterLength, uint8_t ucQoS)
Subscribe to the Mqtt topics.
Definition: ota_mqtt_interface.h:111
OtaMqttInterface_t::unsubscribe
OtaMqttUnsubscribe_t unsubscribe
interface for unsubscribing to MQTT topics.
Definition: ota_mqtt_interface.h:164
OtaMqttStatus_t
OtaMqttStatus_t
The OTA MQTT interface return status.
Definition: ota_mqtt_interface.h:88
OtaMqttInterface_t::subscribe
OtaMqttSubscribe_t subscribe
Interface for subscribing to Mqtt topics.
Definition: ota_mqtt_interface.h:163
OtaMqttPublish_t
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
OtaMqttInterface_t
OTA Event Interface structure.
Definition: ota_mqtt_interface.h:162
OtaMqttPublishFailed
@ OtaMqttPublishFailed
Attempt to publish a MQTT message failed.
Definition: ota_mqtt_interface.h:90
OtaMqttUnsubscribeFailed
@ OtaMqttUnsubscribeFailed
Failed to unsubscribe from a topic.
Definition: ota_mqtt_interface.h:92
OtaMqttSubscribeFailed
@ OtaMqttSubscribeFailed
Failed to subscribe to a topic.
Definition: ota_mqtt_interface.h:91
OtaMqttSuccess
@ OtaMqttSuccess
OTA MQTT interface success.
Definition: ota_mqtt_interface.h:89