Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
14035190
Commit
14035190
authored
Mar 08, 2018
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix windows enum name clash
parent
6a1f39f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
MQTTProperties.c
src/MQTTProperties.c
+13
-13
MQTTProperties.h
src/MQTTProperties.h
+1
-1
test15.c
test/test15.c
+1
-1
No files found.
src/MQTTProperties.c
View file @
14035190
...
...
@@ -27,7 +27,7 @@ struct nameToType
enum
PropertyTypes
type
;
}
namesToTypes
[]
=
{
{
PAYLOAD_FORMAT_INDICATOR
,
BYTE
},
{
PAYLOAD_FORMAT_INDICATOR
,
PROPERTY_TYPE_
BYTE
},
{
MESSAGE_EXPIRY_INTERVAL
,
FOUR_BYTE_INTEGER
},
{
CONTENT_TYPE
,
UTF_8_ENCODED_STRING
},
{
RESPONSE_TOPIC
,
UTF_8_ENCODED_STRING
},
...
...
@@ -38,22 +38,22 @@ struct nameToType
{
SERVER_KEEP_ALIVE
,
TWO_BYTE_INTEGER
},
{
AUTHENTICATION_METHOD
,
UTF_8_ENCODED_STRING
},
{
AUTHENTICATION_DATA
,
BINARY_DATA
},
{
REQUEST_PROBLEM_INFORMATION
,
BYTE
},
{
REQUEST_PROBLEM_INFORMATION
,
PROPERTY_TYPE_
BYTE
},
{
WILL_DELAY_INTERVAL
,
FOUR_BYTE_INTEGER
},
{
REQUEST_RESPONSE_INFORMATION
,
BYTE
},
{
REQUEST_RESPONSE_INFORMATION
,
PROPERTY_TYPE_
BYTE
},
{
RESPONSE_INFORMATION
,
UTF_8_ENCODED_STRING
},
{
SERVER_REFERENCE
,
UTF_8_ENCODED_STRING
},
{
REASON_STRING
,
UTF_8_ENCODED_STRING
},
{
RECEIVE_MAXIMUM
,
TWO_BYTE_INTEGER
},
{
TOPIC_ALIAS_MAXIMUM
,
TWO_BYTE_INTEGER
},
{
TOPIC_ALIAS
,
TWO_BYTE_INTEGER
},
{
MAXIMUM_QOS
,
BYTE
},
{
RETAIN_AVAILABLE
,
BYTE
},
{
MAXIMUM_QOS
,
PROPERTY_TYPE_
BYTE
},
{
RETAIN_AVAILABLE
,
PROPERTY_TYPE_
BYTE
},
{
USER_PROPERTY
,
UTF_8_STRING_PAIR
},
{
MAXIMUM_PACKET_SIZE
,
FOUR_BYTE_INTEGER
},
{
WILDCARD_SUBSCRIPTION_AVAILABLE
,
BYTE
},
{
SUBSCRIPTION_IDENTIFIER_AVAILABLE
,
BYTE
},
{
SHARED_SUBSCRIPTION_AVAILABLE
,
BYTE
}
{
WILDCARD_SUBSCRIPTION_AVAILABLE
,
PROPERTY_TYPE_
BYTE
},
{
SUBSCRIPTION_IDENTIFIER_AVAILABLE
,
PROPERTY_TYPE_
BYTE
},
{
SHARED_SUBSCRIPTION_AVAILABLE
,
PROPERTY_TYPE_
BYTE
}
};
...
...
@@ -96,7 +96,7 @@ int MQTTProperties_add(MQTTProperties* props, MQTTProperty* prop)
/* calculate length */
switch
(
type
)
{
case
BYTE
:
case
PROPERTY_TYPE_
BYTE
:
len
=
1
;
break
;
case
TWO_BYTE_INTEGER
:
...
...
@@ -130,12 +130,12 @@ int MQTTProperty_write(char** pptr, MQTTProperty* prop)
type
=
-
1
;
type
=
MQTTProperty_getType
(
prop
->
identifier
);
if
(
type
>=
BYTE
&&
type
<=
UTF_8_STRING_PAIR
)
if
(
type
>=
PROPERTY_TYPE_
BYTE
&&
type
<=
UTF_8_STRING_PAIR
)
{
writeChar
(
pptr
,
prop
->
identifier
);
switch
(
type
)
{
case
BYTE
:
case
PROPERTY_TYPE_
BYTE
:
writeChar
(
pptr
,
prop
->
value
.
byte
);
rc
=
1
;
break
;
...
...
@@ -202,11 +202,11 @@ int MQTTProperty_read(MQTTProperty* prop, char** pptr, char* enddata)
prop
->
identifier
=
readChar
(
pptr
);
type
=
MQTTProperty_getType
(
prop
->
identifier
);
if
(
type
>=
BYTE
&&
type
<=
UTF_8_STRING_PAIR
)
if
(
type
>=
PROPERTY_TYPE_
BYTE
&&
type
<=
UTF_8_STRING_PAIR
)
{
switch
(
type
)
{
case
BYTE
:
case
PROPERTY_TYPE_
BYTE
:
prop
->
value
.
byte
=
readChar
(
pptr
);
len
=
1
;
break
;
...
...
src/MQTTProperties.h
View file @
14035190
...
...
@@ -64,7 +64,7 @@ enum PropertyNames {
DLLExport
const
char
*
MQTTPropertyName
(
enum
PropertyNames
);
enum
PropertyTypes
{
BYTE
,
PROPERTY_TYPE_
BYTE
,
TWO_BYTE_INTEGER
,
FOUR_BYTE_INTEGER
,
VARIABLE_BYTE_INTEGER
,
...
...
test/test15.c
View file @
14035190
...
...
@@ -362,7 +362,7 @@ void logProperties(MQTTProperties *props)
switch
(
MQTTProperty_getType
(
id
))
{
case
BYTE
:
case
PROPERTY_TYPE_
BYTE
:
MyLog
(
LOGA_INFO
,
intformat
,
name
,
props
->
array
[
i
].
value
.
byte
);
break
;
case
TWO_BYTE_INTEGER
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment