MQTTProtocol.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*******************************************************************************
  2. * Copyright (c) 2009, 2014 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 - MQTT 3.1.1 updates
  16. *******************************************************************************/
  17. #if !defined(MQTTPROTOCOL_H)
  18. #define MQTTPROTOCOL_H
  19. #include "LinkedList.h"
  20. #include "MQTTPacket.h"
  21. #include "Clients.h"
  22. #define MAX_MSG_ID 65535
  23. #define MAX_CLIENTID_LEN 65535
  24. typedef struct
  25. {
  26. int socket;
  27. Publications* p;
  28. } pending_write;
  29. typedef struct
  30. {
  31. List publications;
  32. unsigned int msgs_received;
  33. unsigned int msgs_sent;
  34. List pending_writes; /* for qos 0 writes not complete */
  35. } MQTTProtocol;
  36. #include "MQTTProtocolOut.h"
  37. #endif