MQTTReasonCodes.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*******************************************************************************
  2. * Copyright (c) 2017, 2020 IBM Corp. and others
  3. *
  4. * All rights reserved. This program and the accompanying materials
  5. * are made available under the terms of the Eclipse Public License v2.0
  6. * and Eclipse Distribution License v1.0 which accompany this distribution.
  7. *
  8. * The Eclipse Public License is available at
  9. * https://www.eclipse.org/legal/epl-2.0/
  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. #if !defined(MQTTREASONCODES_H)
  17. #define MQTTREASONCODES_H
  18. #include "MQTTExportDeclarations.h"
  19. /** The MQTT V5 one byte reason code */
  20. enum MQTTReasonCodes {
  21. MQTTREASONCODE_SUCCESS = 0,
  22. MQTTREASONCODE_NORMAL_DISCONNECTION = 0,
  23. MQTTREASONCODE_GRANTED_QOS_0 = 0,
  24. MQTTREASONCODE_GRANTED_QOS_1 = 1,
  25. MQTTREASONCODE_GRANTED_QOS_2 = 2,
  26. MQTTREASONCODE_DISCONNECT_WITH_WILL_MESSAGE = 4,
  27. MQTTREASONCODE_NO_MATCHING_SUBSCRIBERS = 16,
  28. MQTTREASONCODE_NO_SUBSCRIPTION_FOUND = 17,
  29. MQTTREASONCODE_CONTINUE_AUTHENTICATION = 24,
  30. MQTTREASONCODE_RE_AUTHENTICATE = 25,
  31. MQTTREASONCODE_UNSPECIFIED_ERROR = 128,
  32. MQTTREASONCODE_MALFORMED_PACKET = 129,
  33. MQTTREASONCODE_PROTOCOL_ERROR = 130,
  34. MQTTREASONCODE_IMPLEMENTATION_SPECIFIC_ERROR = 131,
  35. MQTTREASONCODE_UNSUPPORTED_PROTOCOL_VERSION = 132,
  36. MQTTREASONCODE_CLIENT_IDENTIFIER_NOT_VALID = 133,
  37. MQTTREASONCODE_BAD_USER_NAME_OR_PASSWORD = 134,
  38. MQTTREASONCODE_NOT_AUTHORIZED = 135,
  39. MQTTREASONCODE_SERVER_UNAVAILABLE = 136,
  40. MQTTREASONCODE_SERVER_BUSY = 137,
  41. MQTTREASONCODE_BANNED = 138,
  42. MQTTREASONCODE_SERVER_SHUTTING_DOWN = 139,
  43. MQTTREASONCODE_BAD_AUTHENTICATION_METHOD = 140,
  44. MQTTREASONCODE_KEEP_ALIVE_TIMEOUT = 141,
  45. MQTTREASONCODE_SESSION_TAKEN_OVER = 142,
  46. MQTTREASONCODE_TOPIC_FILTER_INVALID = 143,
  47. MQTTREASONCODE_TOPIC_NAME_INVALID = 144,
  48. MQTTREASONCODE_PACKET_IDENTIFIER_IN_USE = 145,
  49. MQTTREASONCODE_PACKET_IDENTIFIER_NOT_FOUND = 146,
  50. MQTTREASONCODE_RECEIVE_MAXIMUM_EXCEEDED = 147,
  51. MQTTREASONCODE_TOPIC_ALIAS_INVALID = 148,
  52. MQTTREASONCODE_PACKET_TOO_LARGE = 149,
  53. MQTTREASONCODE_MESSAGE_RATE_TOO_HIGH = 150,
  54. MQTTREASONCODE_QUOTA_EXCEEDED = 151,
  55. MQTTREASONCODE_ADMINISTRATIVE_ACTION = 152,
  56. MQTTREASONCODE_PAYLOAD_FORMAT_INVALID = 153,
  57. MQTTREASONCODE_RETAIN_NOT_SUPPORTED = 154,
  58. MQTTREASONCODE_QOS_NOT_SUPPORTED = 155,
  59. MQTTREASONCODE_USE_ANOTHER_SERVER = 156,
  60. MQTTREASONCODE_SERVER_MOVED = 157,
  61. MQTTREASONCODE_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED = 158,
  62. MQTTREASONCODE_CONNECTION_RATE_EXCEEDED = 159,
  63. MQTTREASONCODE_MAXIMUM_CONNECT_TIME = 160,
  64. MQTTREASONCODE_SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED = 161,
  65. MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED = 162
  66. };
  67. /**
  68. * Returns a printable string description of an MQTT V5 reason code.
  69. * @param value an MQTT V5 reason code.
  70. * @return the printable string description of the input reason code.
  71. * NULL if the code was not found.
  72. */
  73. LIBMQTT_API const char* MQTTReasonCode_toString(enum MQTTReasonCodes value);
  74. #endif