1 /******************************************************************************* 2 * Copyright (c) 2009, 2018 IBM Corp. 3 * 4 * All rights reserved. This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License v1.0 6 * and Eclipse Distribution License v1.0 which accompany this distribution. 7 * 8 * The Eclipse Public License is available at 9 * http://www.eclipse.org/legal/epl-v10.html 10 * and the Eclipse Distribution License is available at 11 * http://www.eclipse.org/org/documents/edl-v10.php. 12 * 13 * Contributors: 14 * Ian Craggs - initial API and implementation and/or initial documentation 15 * Ian Craggs, Allan Stockdill-Mander - SSL updates 16 * Ian Craggs - MQTT 3.1.1 support 17 * Ian Craggs - SNI support 18 * Ian Craggs - MQTT 5.0 support 19 *******************************************************************************/ 20 21 #if !defined(MQTTPROTOCOLOUT_H) 22 #define MQTTPROTOCOLOUT_H 23 24 #include "LinkedList.h" 25 #include "MQTTPacket.h" 26 #include "Clients.h" 27 #include "Log.h" 28 #include "Messages.h" 29 #include "MQTTProtocol.h" 30 #include "MQTTProtocolClient.h" 31 32 #define DEFAULT_PORT 1883 33 34 size_t MQTTProtocol_addressPort(const char* uri, int* port, const char **topic); 35 void MQTTProtocol_reconnect(const char* ip_address, Clients* client); 36 #if defined(OPENSSL) || defined(MBEDTLS) 37 int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int websocket, int MQTTVersion, 38 MQTTProperties* connectProperties, MQTTProperties* willProperties); 39 #else 40 int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int websocket, int MQTTVersion, 41 MQTTProperties* connectProperties, MQTTProperties* willProperties); 42 #endif 43 int MQTTProtocol_handlePingresps(void* pack, int sock); 44 int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID, 45 MQTTSubscribe_options* opts, MQTTProperties* props); 46 int MQTTProtocol_handleSubacks(void* pack, int sock); 47 int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID, MQTTProperties* props); 48 int MQTTProtocol_handleUnsubacks(void* pack, int sock); 49 50 #endif 51