MQTTProtocolOut.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #if !defined(MQTTPROTOCOLOUT_H)
  21. #define MQTTPROTOCOLOUT_H
  22. #include "LinkedList.h"
  23. #include "MQTTPacket.h"
  24. #include "Clients.h"
  25. #include "Log.h"
  26. #include "Messages.h"
  27. #include "MQTTProtocol.h"
  28. #include "MQTTProtocolClient.h"
  29. #define DEFAULT_PORT 1883
  30. size_t MQTTProtocol_addressPort(const char* uri, int* port, const char **topic);
  31. void MQTTProtocol_reconnect(const char* ip_address, Clients* client);
  32. #if defined(OPENSSL)
  33. int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int websocket, int MQTTVersion,
  34. MQTTProperties* connectProperties, MQTTProperties* willProperties);
  35. #else
  36. int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int websocket, int MQTTVersion,
  37. MQTTProperties* connectProperties, MQTTProperties* willProperties);
  38. #endif
  39. int MQTTProtocol_handlePingresps(void* pack, int sock);
  40. int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID,
  41. MQTTSubscribe_options* opts, MQTTProperties* props);
  42. int MQTTProtocol_handleSubacks(void* pack, int sock);
  43. int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID, MQTTProperties* props);
  44. int MQTTProtocol_handleUnsubacks(void* pack, int sock);
  45. #endif