AWS IoT Embedded C Device SDK
aws_iot_mqtt_client_interface.h
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 /* Library Header files */
43 #include "stdio.h"
44 #include "stdbool.h"
45 #include "stdint.h"
46 #include "stddef.h"
47 
48 /* AWS Specific header files */
49 #include "aws_iot_error.h"
50 #include "aws_iot_config.h"
51 #include "aws_iot_mqtt_client.h"
52 
53 /* Platform specific implementation header files */
54 #include "network_interface.h"
55 #include "timer_interface.h"
56 
68 
80 
96 IoT_Error_t aws_iot_mqtt_publish(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen,
98 
114 IoT_Error_t aws_iot_mqtt_subscribe(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen,
115  QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData);
116 
130 
144 IoT_Error_t aws_iot_mqtt_unsubscribe(AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen);
145 
156 
174 IoT_Error_t aws_iot_mqtt_yield(AWS_IoT_Client *pClient, uint32_t timeout_ms);
175 
190 
191 #endif
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:283
MQTT Client.
Definition: aws_iot_mqtt_client.h:285
Definition of error types for the SDK.
Timer interface definition for MQTT client.
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:257
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:209
MQTT Connection Parameters.
Definition: aws_iot_mqtt_client.h:127
IoT_Error_t
IoT Error enum.
Definition: aws_iot_error.h:36
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:150
IoT_Error_t aws_iot_mqtt_attempt_reconnect(AWS_IoT_Client *pClient)
MQTT Manual Re-Connection Function.
Definition: aws_iot_mqtt_client_connect.c:556
Publish Message Parameters Type.
Definition: aws_iot_mqtt_client.h:82
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:194
Client definition for MQTT.
MQTT Initialization Parameters.
Definition: aws_iot_mqtt_client.h:161
IoT_Error_t aws_iot_mqtt_disconnect(AWS_IoT_Client *pClient)
Disconnect an MQTT Connection.
Definition: aws_iot_mqtt_client_connect.c:510
IoT_Error_t aws_iot_mqtt_resubscribe(AWS_IoT_Client *pClient)
Subscribe to an MQTT topic.
Definition: aws_iot_mqtt_client_subscribe.c:395
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:248
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:419
Network interface definition for MQTT client.
QoS
Quality of Service Type.
Definition: aws_iot_mqtt_client.h:71