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
ced0d0ef
Commit
ced0d0ef
authored
May 03, 2018
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all tests in test45.c work with MQTT 5
parent
167278c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
330 additions
and
112 deletions
+330
-112
MQTTAsync.c
src/MQTTAsync.c
+139
-21
MQTTAsync.h
src/MQTTAsync.h
+8
-5
MQTTPacketOut.c
src/MQTTPacketOut.c
+1
-1
CMakeLists.txt
test/CMakeLists.txt
+42
-0
test45.c
test/test45.c
+140
-85
No files found.
src/MQTTAsync.c
View file @
ced0d0ef
This diff is collapsed.
Click to expand it.
src/MQTTAsync.h
View file @
ced0d0ef
...
...
@@ -416,11 +416,13 @@ typedef struct
enum
MQTTReasonCodes
reasonCode
;
/** The MQTT properties on the ack, if any. */
MQTTProperties
properties
;
/** A numeric code identifying the MQTT client library error. */
int
code
;
/** Optional further text explaining the error. Can be NULL. */
const
char
*
message
;
}
MQTTAsync_failureData5
;
#define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, SUCCESS, MQTTProperties_initializer, NULL}
#define MQTTAsync_failureData5_initializer {{'M', 'Q', 'F', 'D'}, 0, 0, SUCCESS, MQTTProperties_initializer,
0,
NULL}
/** The data returned on completion of a successful API call in the response callback onSuccess. */
typedef
struct
...
...
@@ -959,6 +961,10 @@ typedef struct
int
len
;
/**< binary password length */
const
void
*
data
;
/**< binary password data */
}
binarypwd
;
/*
* MQTT V5 clean start flag. Only clears state at the beginning of the session.
*/
int
cleanstart
;
/**
* MQTT V5 properties for connect
*/
...
...
@@ -983,7 +989,7 @@ typedef struct
#define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 6, 60, 1, 10, NULL, NULL, NULL, 30, 0,\
NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 1, 60, {0, NULL}, NULL, NULL, NULL, NULL}
NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 1, 60, {0, NULL},
0,
NULL, NULL, NULL, NULL}
/**
* This function attempts to connect a previously-created client (see
...
...
@@ -1179,9 +1185,6 @@ DLLExport int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const
DLLExport
int
MQTTAsync_send
(
MQTTAsync
handle
,
const
char
*
destinationName
,
int
payloadlen
,
void
*
payload
,
int
qos
,
int
retained
,
MQTTAsync_responseOptions
*
response
);
DLLExport
int
MQTTAsync_send5
(
MQTTAsync
handle
,
const
char
*
destinationName
,
int
payloadlen
,
void
*
payload
,
int
qos
,
int
retained
,
MQTTProperties
*
props
,
MQTTAsync_responseOptions
*
response
);
/**
* This function attempts to publish a message to a given topic (see also
...
...
src/MQTTPacketOut.c
View file @
ced0d0ef
...
...
@@ -66,7 +66,7 @@ int MQTTPacket_send_connect(Clients* client, int MQTTVersion,
if
(
MQTTVersion
>=
MQTTVERSION_5
)
{
len
+=
MQTTProperties_len
(
connectProperties
);
if
(
client
->
will
&&
willProperties
)
if
(
client
->
will
)
len
+=
MQTTProperties_len
(
willProperties
);
}
...
...
test/CMakeLists.txt
View file @
ced0d0ef
...
...
@@ -289,8 +289,50 @@ ADD_TEST(
COMMAND test45
"--test_no"
"1"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-2-connect-timeout
COMMAND test45
"--test_no"
"2"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-3-multiple-client-objs-simultaneous-working
COMMAND test45
"--test_no"
"3"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-4-send-receive-big-messages
COMMAND test45
"--test_no"
"4"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-5-connack-return-codes
COMMAND test45
"--test_no"
"5"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-6-ha-connections
COMMAND test45
"--test_no"
"6"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-7-pending-tokens
COMMAND test45
"--test_no"
"7"
"--connection"
${
MQTT_TEST_BROKER
}
)
ADD_TEST
(
NAME test45-8-incomplete-commands-requests
COMMAND test45
"--test_no"
"8"
"--connection"
${
MQTT_TEST_BROKER
}
)
SET_TESTS_PROPERTIES
(
test45-1-basic-connect-subscribe-receive
test45-2-connect-timeout
test45-3-multiple-client-objs-simultaneous-working
test45-4-send-receive-big-messages
test45-5-connack-return-codes
test45-6-ha-connections
test45-7-pending-tokens
test45-8-incomplete-commands-requests
PROPERTIES TIMEOUT 540
)
...
...
test/test45.c
View file @
ced0d0ef
This diff is collapsed.
Click to expand it.
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