MQTTFormat.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*******************************************************************************
  2. * Copyright (c) 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
  15. *documentation
  16. *******************************************************************************/
  17. #if !defined(MQTTFORMAT_H)
  18. #define MQTTFORMAT_H
  19. #include "MQTTPacket.h"
  20. #include "StackTrace.h"
  21. const char* MQTTPacket_getName(unsigned short packetid);
  22. int MQTTStringFormat_connect(char* strbuf,
  23. int strbuflen,
  24. MQTTPacket_connectData* data);
  25. int MQTTStringFormat_connack(char* strbuf,
  26. int strbuflen,
  27. unsigned char connack_rc,
  28. unsigned char sessionPresent);
  29. int MQTTStringFormat_publish(char* strbuf,
  30. int strbuflen,
  31. unsigned char dup,
  32. int qos,
  33. unsigned char retained,
  34. unsigned short packetid,
  35. MQTTString topicName,
  36. unsigned char* payload,
  37. int payloadlen);
  38. int MQTTStringFormat_ack(char* strbuf,
  39. int strbuflen,
  40. unsigned char packettype,
  41. unsigned char dup,
  42. unsigned short packetid);
  43. int MQTTStringFormat_subscribe(char* strbuf,
  44. int strbuflen,
  45. unsigned char dup,
  46. unsigned short packetid,
  47. int count,
  48. MQTTString topicFilters[],
  49. int requestedQoSs[]);
  50. int MQTTStringFormat_suback(char* strbuf,
  51. int strbuflen,
  52. unsigned short packetid,
  53. int count,
  54. int* grantedQoSs);
  55. int MQTTStringFormat_unsubscribe(char* strbuf,
  56. int strbuflen,
  57. unsigned char dup,
  58. unsigned short packetid,
  59. int count,
  60. MQTTString topicFilters[]);
  61. char* MQTTFormat_toClientString(char* strbuf,
  62. int strbuflen,
  63. unsigned char* buf,
  64. int buflen);
  65. char* MQTTFormat_toServerString(char* strbuf,
  66. int strbuflen,
  67. unsigned char* buf,
  68. int buflen);
  69. #endif