MQTTFormat.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 documentation
  15. *******************************************************************************/
  16. #ifndef MQTTFORMAT_H
  17. #define MQTTFORMAT_H
  18. #include "StackTrace.h"
  19. #include "MQTTPacket.h"
  20. const char* MQTTPacket_getName(unsigned short packetid);
  21. int MQTTStringFormat_connect(char* strbuf, int strbuflen, MQTTPacket_connectData* data);
  22. int MQTTStringFormat_connack(char* strbuf, int strbuflen, unsigned char connack_rc, unsigned char sessionPresent);
  23. int MQTTStringFormat_publish(char* strbuf, int strbuflen, unsigned char dup, int qos, unsigned char retained,
  24. unsigned short packetid, MQTTString topicName, unsigned char* payload, int payloadlen);
  25. int MQTTStringFormat_ack(char* strbuf, int strbuflen, unsigned char packettype, unsigned char dup, unsigned short packetid);
  26. int MQTTStringFormat_subscribe(char* strbuf, int strbuflen, unsigned char dup, unsigned short packetid, int count,
  27. MQTTString topicFilters[], int requestedQoSs[]);
  28. int MQTTStringFormat_suback(char* strbuf, int strbuflen, unsigned short packetid, int count, int* grantedQoSs);
  29. int MQTTStringFormat_unsubscribe(char* strbuf, int strbuflen, unsigned char dup, unsigned short packetid,
  30. int count, MQTTString topicFilters[]);
  31. char* MQTTFormat_toClientString(char* strbuf, int strbuflen, unsigned char* buf, int buflen);
  32. char* MQTTFormat_toServerString(char* strbuf, int strbuflen, unsigned char* buf, int buflen);
  33. #endif