Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
3rdparty
paho.mqtt.c
src
MQTTReasonCodes.c
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (c) 2017, 2018 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 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
17
#include "
MQTTReasonCodes.h
"
18
19
#include "
MQTTPacket.h
"
20
#include "
Heap.h
"
21
#include "
StackTrace.h
"
22
23
#include <memory.h>
24
25
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
26
27
static
struct
{
28
enum
MQTTReasonCodes
value
;
29
const
char
*
name
;
30
}
nameToString
[] =
31
{
32
{
MQTTREASONCODE_SUCCESS
,
"SUCCESS"
},
33
{
MQTTREASONCODE_NORMAL_DISCONNECTION
,
"Normal disconnection"
},
34
{
MQTTREASONCODE_GRANTED_QOS_0
,
"Granted QoS 0"
},
35
{
MQTTREASONCODE_GRANTED_QOS_1
,
"Granted QoS 1"
},
36
{
MQTTREASONCODE_GRANTED_QOS_2
,
"Granted QoS 2"
},
37
{
MQTTREASONCODE_DISCONNECT_WITH_WILL_MESSAGE
,
"Disconnect with Will Message"
},
38
{
MQTTREASONCODE_NO_MATCHING_SUBSCRIBERS
,
"No matching subscribers"
},
39
{
MQTTREASONCODE_NO_SUBSCRIPTION_FOUND
,
"No subscription found"
},
40
{
MQTTREASONCODE_CONTINUE_AUTHENTICATION
,
"Continue authentication"
},
41
{
MQTTREASONCODE_RE_AUTHENTICATE
,
"Re-authenticate"
},
42
{
MQTTREASONCODE_UNSPECIFIED_ERROR
,
"Unspecified error"
},
43
{
MQTTREASONCODE_MALFORMED_PACKET
,
"Malformed Packet"
},
44
{
MQTTREASONCODE_PROTOCOL_ERROR
,
"Protocol error"
},
45
{
MQTTREASONCODE_IMPLEMENTATION_SPECIFIC_ERROR
,
"Implementation specific error"
},
46
{
MQTTREASONCODE_UNSUPPORTED_PROTOCOL_VERSION
,
"Unsupported Protocol Version"
},
47
{
MQTTREASONCODE_CLIENT_IDENTIFIER_NOT_VALID
,
"Client Identifier not valid"
},
48
{
MQTTREASONCODE_BAD_USER_NAME_OR_PASSWORD
,
"Bad User Name or Password"
},
49
{
MQTTREASONCODE_NOT_AUTHORIZED
,
"Not authorized"
},
50
{
MQTTREASONCODE_SERVER_UNAVAILABLE
,
"Server unavailable"
},
51
{
MQTTREASONCODE_SERVER_BUSY
,
"Server busy"
},
52
{
MQTTREASONCODE_BANNED
,
"Banned"
},
53
{
MQTTREASONCODE_SERVER_SHUTTING_DOWN
,
"Server shutting down"
},
54
{
MQTTREASONCODE_BAD_AUTHENTICATION_METHOD
,
"Bad authentication method"
},
55
{
MQTTREASONCODE_KEEP_ALIVE_TIMEOUT
,
"Keep Alive timeout"
},
56
{
MQTTREASONCODE_SESSION_TAKEN_OVER
,
"Session taken over"
},
57
{
MQTTREASONCODE_TOPIC_FILTER_INVALID
,
"Topic filter invalid"
},
58
{
MQTTREASONCODE_TOPIC_NAME_INVALID
,
"Topic name invalid"
},
59
{
MQTTREASONCODE_PACKET_IDENTIFIER_IN_USE
,
"Packet Identifier in use"
},
60
{
MQTTREASONCODE_PACKET_IDENTIFIER_NOT_FOUND
,
"Packet Identifier not found"
},
61
{
MQTTREASONCODE_RECEIVE_MAXIMUM_EXCEEDED
,
"Receive Maximum exceeded"
},
62
{
MQTTREASONCODE_TOPIC_ALIAS_INVALID
,
"Topic Alias invalid"
},
63
{
MQTTREASONCODE_PACKET_TOO_LARGE
,
"Packet too large"
},
64
{
MQTTREASONCODE_MESSAGE_RATE_TOO_HIGH
,
"Message rate too high"
},
65
{
MQTTREASONCODE_QUOTA_EXCEEDED
,
"Quota exceeded"
},
66
{
MQTTREASONCODE_ADMINISTRATIVE_ACTION
,
"Administrative action"
},
67
{
MQTTREASONCODE_PAYLOAD_FORMAT_INVALID
,
"Payload format invalid"
},
68
{
MQTTREASONCODE_RETAIN_NOT_SUPPORTED
,
"Retain not supported"
},
69
{
MQTTREASONCODE_QOS_NOT_SUPPORTED
,
"QoS not supported"
},
70
{
MQTTREASONCODE_USE_ANOTHER_SERVER
,
"Use another server"
},
71
{
MQTTREASONCODE_SERVER_MOVED
,
"Server moved"
},
72
{
MQTTREASONCODE_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED
,
"Shared subscriptions not supported"
},
73
{
MQTTREASONCODE_CONNECTION_RATE_EXCEEDED
,
"Connection rate exceeded"
},
74
{
MQTTREASONCODE_MAXIMUM_CONNECT_TIME
,
"Maximum connect time"
},
75
{
MQTTREASONCODE_SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED
,
"Subscription Identifiers not supported"
},
76
{
MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED
,
"Wildcard Subscriptions not supported"
}
77
};
78
79
const
char
*
MQTTReasonCode_toString
(
enum
MQTTReasonCodes
value
)
80
{
81
int
i = 0;
82
const
char
*
result
= NULL;
83
84
for
(i = 0; i <
ARRAY_SIZE
(
nameToString
); ++i)
85
{
86
if
(
nameToString
[i].value == value)
87
{
88
result =
nameToString
[i].name;
89
break
;
90
}
91
}
92
return
result
;
93
}
94
95
96
97
98
99
100
101
MQTTREASONCODE_DISCONNECT_WITH_WILL_MESSAGE
Definition:
MQTTReasonCodes.h:29
MQTTREASONCODE_IMPLEMENTATION_SPECIFIC_ERROR
Definition:
MQTTReasonCodes.h:37
MQTTREASONCODE_TOPIC_FILTER_INVALID
Definition:
MQTTReasonCodes.h:49
MQTTREASONCODE_MESSAGE_RATE_TOO_HIGH
Definition:
MQTTReasonCodes.h:56
MQTTREASONCODE_UNSPECIFIED_ERROR
Definition:
MQTTReasonCodes.h:34
MQTTREASONCODE_SERVER_BUSY
Definition:
MQTTReasonCodes.h:43
MQTTREASONCODE_KEEP_ALIVE_TIMEOUT
Definition:
MQTTReasonCodes.h:47
MQTTReasonCodes
MQTTReasonCodes
Definition:
MQTTReasonCodes.h:23
MQTTREASONCODE_SUBSCRIPTION_IDENTIFIERS_NOT_SUPPORTED
Definition:
MQTTReasonCodes.h:67
MQTTREASONCODE_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED
Definition:
MQTTReasonCodes.h:64
MQTTREASONCODE_CONNECTION_RATE_EXCEEDED
Definition:
MQTTReasonCodes.h:65
MQTTREASONCODE_PACKET_IDENTIFIER_IN_USE
Definition:
MQTTReasonCodes.h:51
MQTTREASONCODE_CONTINUE_AUTHENTICATION
Definition:
MQTTReasonCodes.h:32
MQTTReasonCode_toString
const char * MQTTReasonCode_toString(enum MQTTReasonCodes value)
Definition:
MQTTReasonCodes.c:79
MQTTREASONCODE_NORMAL_DISCONNECTION
Definition:
MQTTReasonCodes.h:25
MQTTREASONCODE_NO_MATCHING_SUBSCRIBERS
Definition:
MQTTReasonCodes.h:30
MQTTREASONCODE_PROTOCOL_ERROR
Definition:
MQTTReasonCodes.h:36
MQTTREASONCODE_UNSUPPORTED_PROTOCOL_VERSION
Definition:
MQTTReasonCodes.h:38
MQTTREASONCODE_TOPIC_ALIAS_INVALID
Definition:
MQTTReasonCodes.h:54
MQTTREASONCODE_MAXIMUM_CONNECT_TIME
Definition:
MQTTReasonCodes.h:66
MQTTREASONCODE_USE_ANOTHER_SERVER
Definition:
MQTTReasonCodes.h:62
MQTTREASONCODE_RE_AUTHENTICATE
Definition:
MQTTReasonCodes.h:33
MQTTREASONCODE_PACKET_IDENTIFIER_NOT_FOUND
Definition:
MQTTReasonCodes.h:52
ARRAY_SIZE
#define ARRAY_SIZE(a)
Definition:
MQTTReasonCodes.c:25
MQTTREASONCODE_PAYLOAD_FORMAT_INVALID
Definition:
MQTTReasonCodes.h:59
name
const char * name
Definition:
MQTTReasonCodes.c:29
MQTTREASONCODE_RETAIN_NOT_SUPPORTED
Definition:
MQTTReasonCodes.h:60
Heap.h
MQTTREASONCODE_SESSION_TAKEN_OVER
Definition:
MQTTReasonCodes.h:48
MQTTREASONCODE_MALFORMED_PACKET
Definition:
MQTTReasonCodes.h:35
MQTTREASONCODE_GRANTED_QOS_0
Definition:
MQTTReasonCodes.h:26
MQTTREASONCODE_GRANTED_QOS_1
Definition:
MQTTReasonCodes.h:27
MQTTREASONCODE_PACKET_TOO_LARGE
Definition:
MQTTReasonCodes.h:55
MQTTREASONCODE_BAD_USER_NAME_OR_PASSWORD
Definition:
MQTTReasonCodes.h:40
MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED
Definition:
MQTTReasonCodes.h:68
MQTTREASONCODE_TOPIC_NAME_INVALID
Definition:
MQTTReasonCodes.h:50
MQTTREASONCODE_BAD_AUTHENTICATION_METHOD
Definition:
MQTTReasonCodes.h:46
MQTTPacket.h
MQTTREASONCODE_RECEIVE_MAXIMUM_EXCEEDED
Definition:
MQTTReasonCodes.h:53
StackTrace.h
value
enum MQTTReasonCodes value
Definition:
MQTTReasonCodes.c:28
MQTTREASONCODE_QUOTA_EXCEEDED
Definition:
MQTTReasonCodes.h:57
MQTTREASONCODE_GRANTED_QOS_2
Definition:
MQTTReasonCodes.h:28
MQTTREASONCODE_CLIENT_IDENTIFIER_NOT_VALID
Definition:
MQTTReasonCodes.h:39
nameToString
static struct @68 nameToString[]
MQTTREASONCODE_SERVER_UNAVAILABLE
Definition:
MQTTReasonCodes.h:42
MQTTREASONCODE_QOS_NOT_SUPPORTED
Definition:
MQTTReasonCodes.h:61
MQTTREASONCODE_NO_SUBSCRIPTION_FOUND
Definition:
MQTTReasonCodes.h:31
detail::digits::result
result
Definition:
format-inl.h:1490
MQTTReasonCodes.h
MQTTREASONCODE_SERVER_SHUTTING_DOWN
Definition:
MQTTReasonCodes.h:45
MQTTREASONCODE_SERVER_MOVED
Definition:
MQTTReasonCodes.h:63
MQTTREASONCODE_NOT_AUTHORIZED
Definition:
MQTTReasonCodes.h:41
MQTTREASONCODE_ADMINISTRATIVE_ACTION
Definition:
MQTTReasonCodes.h:58
MQTTREASONCODE_SUCCESS
Definition:
MQTTReasonCodes.h:24
MQTTREASONCODE_BANNED
Definition:
MQTTReasonCodes.h:44
plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:09