AWS IoT Device SDK C: MQTT
MQTT 3.1.1 client library
Return to main page ↑
aws_iot_mqtt_client_interface.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 
16 // Based on Eclipse Paho.
17 /*******************************************************************************
18  * Copyright (c) 2014 IBM Corp.
19  *
20  * All rights reserved. This program and the accompanying materials
21  * are made available under the terms of the Eclipse Public License v1.0
22  * and Eclipse Distribution License v1.0 which accompany this distribution.
23  *
24  * The Eclipse Public License is available at
25  * http://www.eclipse.org/legal/epl-v10.html
26  * and the Eclipse Distribution License is available at
27  * http://www.eclipse.org/org/documents/edl-v10.php.
28  *
29  * Contributors:
30  * Ian Craggs - initial API and implementation and/or initial documentation
31  * Xiang Rong - 442039 Add makefile to Embedded C client
32  *******************************************************************************/
33 
39 #ifndef AWS_IOT_SDK_SRC_IOT_MQTT_INTERFACE_H
40 #define AWS_IOT_SDK_SRC_IOT_MQTT_INTERFACE_H
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /* Library Header files */
47 #include "stdio.h"
48 #include "stdbool.h"
49 #include "stdint.h"
50 #include "stddef.h"
51 
52 /* AWS Specific header files */
53 #include "aws_iot_error.h"
54 #include "aws_iot_config.h"
55 #include "aws_iot_mqtt_client.h"
56 
57 /* Platform specific implementation header files */
58 #include "network_interface.h"
59 #include "timer_interface.h"
60 
61 
70  IoT_Error_t aws_iot_mqtt_free( AWS_IoT_Client *pClient );
71 
82 IoT_Error_t aws_iot_mqtt_init(AWS_IoT_Client *pClient, IoT_Client_Init_Params *pInitParams);
83 
94 IoT_Error_t aws_iot_mqtt_connect(AWS_IoT_Client *pClient, IoT_Client_Connect_Params *pConnectParams);
95 
111 IoT_Error_t aws_iot_mqtt_publish(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen,
112  IoT_Publish_Message_Params *pParams);
113 
133 IoT_Error_t aws_iot_mqtt_subscribe(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen,
134  QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData);
135 
148 IoT_Error_t aws_iot_mqtt_resubscribe(AWS_IoT_Client *pClient);
149 
163 IoT_Error_t aws_iot_mqtt_unsubscribe(AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen);
164 
174 IoT_Error_t aws_iot_mqtt_disconnect(AWS_IoT_Client *pClient);
175 
193 IoT_Error_t aws_iot_mqtt_yield(AWS_IoT_Client *pClient, uint32_t timeout_ms);
194 
208 IoT_Error_t aws_iot_mqtt_attempt_reconnect(AWS_IoT_Client *pClient);
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif
IoT_Error_t aws_iot_mqtt_disconnect(AWS_IoT_Client *pClient)
Disconnect an MQTT Connection.
Definition: aws_iot_mqtt_client_connect.c:543
IoT_Error_t aws_iot_mqtt_yield(AWS_IoT_Client *pClient, uint32_t timeout_ms)
Yield to the MQTT client.
Definition: aws_iot_mqtt_client_yield.c:273
IoT_Error_t aws_iot_mqtt_free(AWS_IoT_Client *pClient)
Clean mqtt client from all dynamic memory allocate.
Definition: aws_iot_mqtt_client.c:201
void(* pApplicationHandler_t)(AWS_IoT_Client *pClient, char *pTopicName, uint16_t topicNameLen, IoT_Publish_Message_Params *pParams, void *pClientData)
Application Callback Handler Type.
Definition: aws_iot_mqtt_client.h:227
MQTT Connection Parameters.
Definition: aws_iot_mqtt_client.h:134
IoT_Error_t aws_iot_mqtt_publish(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, IoT_Publish_Message_Params *pParams)
Publish an MQTT message on a topic.
Definition: aws_iot_mqtt_client_publish.c:245
Publish Message Parameters Type.
Definition: aws_iot_mqtt_client.h:87
IoT_Error_t aws_iot_mqtt_attempt_reconnect(AWS_IoT_Client *pClient)
MQTT Manual Re-Connection Function.
Definition: aws_iot_mqtt_client_connect.c:589
IoT_Error_t aws_iot_mqtt_unsubscribe(AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen)
Unsubscribe to an MQTT topic.
Definition: aws_iot_mqtt_client_unsubscribe.c:199
IoT_Error_t aws_iot_mqtt_connect(AWS_IoT_Client *pClient, IoT_Client_Connect_Params *pConnectParams)
MQTT Connection Function.
Definition: aws_iot_mqtt_client_connect.c:452
Client definition for MQTT.
MQTT Initialization Parameters.
Definition: aws_iot_mqtt_client.h:170
IoT_Error_t aws_iot_mqtt_subscribe(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData)
Subscribe to an MQTT topic.
Definition: aws_iot_mqtt_client_subscribe.c:276
IoT_Error_t aws_iot_mqtt_resubscribe(AWS_IoT_Client *pClient)
Subscribe to an MQTT topic.
Definition: aws_iot_mqtt_client_subscribe.c:389
IoT_Error_t aws_iot_mqtt_init(AWS_IoT_Client *pClient, IoT_Client_Init_Params *pInitParams)
MQTT Client Initialization Function.
Definition: aws_iot_mqtt_client.c:234
QoS
Quality of Service Type.
Definition: aws_iot_mqtt_client.h:76