MQTTProtocolOut.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*******************************************************************************
  2. * Copyright (c) 2009, 2017 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. *******************************************************************************/
  19. #if !defined(MQTTPROTOCOLOUT_H)
  20. #define MQTTPROTOCOLOUT_H
  21. #include "LinkedList.h"
  22. #include "MQTTPacket.h"
  23. #include "Clients.h"
  24. #include "Log.h"
  25. #include "Messages.h"
  26. #include "MQTTProtocol.h"
  27. #include "MQTTProtocolClient.h"
  28. #define DEFAULT_PORT 1883
  29. char* MQTTProtocol_addressPort(const char* uri, int* port);
  30. void MQTTProtocol_reconnect(const char* ip_address, Clients* client);
  31. #if defined(OPENSSL)
  32. int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion);
  33. #else
  34. int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion);
  35. #endif
  36. int MQTTProtocol_handlePingresps(void* pack, int sock);
  37. int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID);
  38. int MQTTProtocol_handleSubacks(void* pack, int sock);
  39. int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID);
  40. int MQTTProtocol_handleUnsubacks(void* pack, int sock);
  41. #endif