Skip to content

Commit 90b4a45

Browse files
feat: Add enum definition with typo to keep backwards compatibility
Added initial enum definitions with deprecated attribute. Should be removed with a new version that can introduce a breaking change.
1 parent dc775bb commit 90b4a45

File tree

1 file changed

+42
-37
lines changed

1 file changed

+42
-37
lines changed

include/mqtt5_client.h

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,46 @@ typedef struct esp_mqtt_client *esp_mqtt5_client_handle_t;
1919
* MQTT5 protocol error reason code, more details refer to MQTT5 protocol document section 2.4
2020
*/
2121
enum mqtt5_error_reason_code {
22-
MQTT5_UNSPECIFIED_ERROR = 0x80,
23-
MQTT5_MALFORMED_PACKET = 0x81,
24-
MQTT5_PROTOCOL_ERROR = 0x82,
25-
MQTT5_IMPLEMENT_SPECIFIC_ERROR = 0x83,
26-
MQTT5_UNSUPPORTED_PROTOCOL_VER = 0x84,
27-
MQTT5_INVALID_CLIENT_ID = 0x85,
28-
MQTT5_BAD_USERNAME_OR_PWD = 0x86,
29-
MQTT5_NOT_AUTHORIZED = 0x87,
30-
MQTT5_SERVER_UNAVAILABLE = 0x88,
31-
MQTT5_SERVER_BUSY = 0x89,
32-
MQTT5_BANNED = 0x8A,
33-
MQTT5_SERVER_SHUTTING_DOWN = 0x8B,
34-
MQTT5_BAD_AUTH_METHOD = 0x8C,
35-
MQTT5_KEEP_ALIVE_TIMEOUT = 0x8D,
36-
MQTT5_SESSION_TAKEN_OVER = 0x8E,
37-
MQTT5_TOPIC_FILTER_INVALID = 0x8F,
38-
MQTT5_TOPIC_NAME_INVALID = 0x90,
39-
MQTT5_PACKET_IDENTIFIER_IN_USE = 0x91,
40-
MQTT5_PACKET_IDENTIFIER_NOT_FOUND = 0x92,
41-
MQTT5_RECEIVE_MAXIMUM_EXCEEDED = 0x93,
42-
MQTT5_TOPIC_ALIAS_INVALID = 0x94,
43-
MQTT5_PACKET_TOO_LARGE = 0x95,
44-
MQTT5_MESSAGE_RATE_TOO_HIGH = 0x96,
45-
MQTT5_QUOTA_EXCEEDED = 0x97,
46-
MQTT5_ADMINISTRATIVE_ACTION = 0x98,
47-
MQTT5_PAYLOAD_FORMAT_INVALID = 0x99,
48-
MQTT5_RETAIN_NOT_SUPPORT = 0x9A,
49-
MQTT5_QOS_NOT_SUPPORT = 0x9B,
50-
MQTT5_USE_ANOTHER_SERVER = 0x9C,
51-
MQTT5_SERVER_MOVED = 0x9D,
52-
MQTT5_SHARED_SUBSCR_NOT_SUPPORTED = 0x9E,
53-
MQTT5_CONNECTION_RATE_EXCEEDED = 0x9F,
54-
MQTT5_MAXIMUM_CONNECT_TIME = 0xA0,
55-
MQTT5_SUBSCRIBE_IDENTIFIER_NOT_SUPPORT = 0xA1,
56-
MQTT5_WILDCARD_SUBSCRIBE_NOT_SUPPORT = 0xA2,
22+
MQTT5_UNSPECIFIED_ERROR = 0x80,
23+
MQTT5_MALFORMED_PACKET = 0x81,
24+
MQTT5_PROTOCOL_ERROR = 0x82,
25+
MQTT5_IMPLEMENT_SPECIFIC_ERROR = 0x83,
26+
MQTT5_UNSUPPORTED_PROTOCOL_VER = 0x84,
27+
MQTT5_INVAILD_CLIENT_ID __attribute__((deprecated)) = 0x85,
28+
MQTT5_INVALID_CLIENT_ID = 0x85,
29+
MQTT5_BAD_USERNAME_OR_PWD = 0x86,
30+
MQTT5_NOT_AUTHORIZED = 0x87,
31+
MQTT5_SERVER_UNAVAILABLE = 0x88,
32+
MQTT5_SERVER_BUSY = 0x89,
33+
MQTT5_BANNED = 0x8A,
34+
MQTT5_SERVER_SHUTTING_DOWN = 0x8B,
35+
MQTT5_BAD_AUTH_METHOD = 0x8C,
36+
MQTT5_KEEP_ALIVE_TIMEOUT = 0x8D,
37+
MQTT5_SESSION_TAKEN_OVER = 0x8E,
38+
MQTT5_TOPIC_FILTER_INVAILD __attribute__((deprecated)) = 0x8F,
39+
MQTT5_TOPIC_FILTER_INVALID = 0x8F,
40+
MQTT5_TOPIC_NAME_INVAILD __attribute__((deprecated)) = 0x90,
41+
MQTT5_TOPIC_NAME_INVALID = 0x90,
42+
MQTT5_PACKET_IDENTIFIER_IN_USE = 0x91,
43+
MQTT5_PACKET_IDENTIFIER_NOT_FOUND = 0x92,
44+
MQTT5_RECEIVE_MAXIMUM_EXCEEDED = 0x93,
45+
MQTT5_TOPIC_ALIAS_INVAILD __attribute__((deprecated)) = 0x94,
46+
MQTT5_TOPIC_ALIAS_INVALID = 0x94,
47+
MQTT5_PACKET_TOO_LARGE = 0x95,
48+
MQTT5_MESSAGE_RATE_TOO_HIGH = 0x96,
49+
MQTT5_QUOTA_EXCEEDED = 0x97,
50+
MQTT5_ADMINISTRATIVE_ACTION = 0x98,
51+
MQTT5_PAYLOAD_FORMAT_INVAILD __attribute__((deprecated)) = 0x99,
52+
MQTT5_PAYLOAD_FORMAT_INVALID = 0x99,
53+
MQTT5_RETAIN_NOT_SUPPORT = 0x9A,
54+
MQTT5_QOS_NOT_SUPPORT = 0x9B,
55+
MQTT5_USE_ANOTHER_SERVER = 0x9C,
56+
MQTT5_SERVER_MOVED = 0x9D,
57+
MQTT5_SHARED_SUBSCR_NOT_SUPPORTED = 0x9E,
58+
MQTT5_CONNECTION_RATE_EXCEEDED = 0x9F,
59+
MQTT5_MAXIMUM_CONNECT_TIME = 0xA0,
60+
MQTT5_SUBSCRIBE_IDENTIFIER_NOT_SUPPORT = 0xA1,
61+
MQTT5_WILDCARD_SUBSCRIBE_NOT_SUPPORT = 0xA2,
5762
};
5863

5964
/**
@@ -65,7 +70,7 @@ typedef struct mqtt5_user_property_list_t *mqtt5_user_property_handle_t;
6570
* MQTT5 protocol connect properties and will properties configuration, more details refer to MQTT5 protocol document section 3.1.2.11 and 3.3.2.3
6671
*/
6772
typedef struct {
68-
uint32_t session_expiry_interval; /*!< The interval time of session expiry */
73+
uint32_t session_expiry_interval; /*!< The interval time of session expiry */
6974
uint32_t maximum_packet_size; /*!< The maximum packet size that we can receive */
7075
uint16_t receive_maximum; /*!< The maximum pakcket count that we process concurrently */
7176
uint16_t topic_alias_maximum; /*!< The maximum topic alias that we support */
@@ -270,7 +275,7 @@ uint8_t esp_mqtt5_client_get_user_property_count(mqtt5_user_property_handle_t us
270275
* @brief Free the user property list
271276
*
272277
* @param user_property user_property handle
273-
*
278+
*
274279
* This API will free the memory in user property list and free user_property itself
275280
*/
276281
void esp_mqtt5_client_delete_user_property(mqtt5_user_property_handle_t user_property);

0 commit comments

Comments
 (0)