-
Notifications
You must be signed in to change notification settings - Fork 638
Upgrade MQTT demos to v5 #1942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Upgrade MQTT demos to v5 #1942
Changes from all commits
2a5e674
d8a4182
d3da58c
545b1b4
db3fa64
295b5bb
ba43d5c
2332de7
d4fa9be
7fc1784
d16cfe5
f9d7ce4
634dc47
a9c031a
5332e1a
6e47639
41ffc2f
e1f718a
d7c856a
f709067
4734136
de993cd
75acbfd
50bebc3
0f6d7de
d5a65ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,7 +343,10 @@ static void cleanupOutgoingPublishWithPacketID( uint16_t packetId ); | |
*/ | ||
static void mqttCallback( MQTTContext_t * pMqttContext, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am aware that you are making these updates but just putting this here so that we do not miss it. We would need to update the event callback signature to the updated one. |
||
MQTTPacketInfo_t * pPacketInfo, | ||
MQTTDeserializedInfo_t * pDeserializedInfo ); | ||
MQTTDeserializedInfo_t * pDeserializedInfo, | ||
MQTTSuccessFailReasonCode_t * pReasonCode, | ||
MQTTPropBuilder_t * sendPropsBuffer, | ||
MQTTPropBuilder_t * getPropsBuffer ); | ||
|
||
/** | ||
* @brief Resend the publishes if a session is re-established with the broker. | ||
|
@@ -555,7 +558,10 @@ static void cleanupOutgoingPublishWithPacketID( uint16_t packetId ) | |
|
||
static void mqttCallback( MQTTContext_t * pMqttContext, | ||
MQTTPacketInfo_t * pPacketInfo, | ||
MQTTDeserializedInfo_t * pDeserializedInfo ) | ||
MQTTDeserializedInfo_t * pDeserializedInfo, | ||
MQTTSuccessFailReasonCode_t * pReasonCode, | ||
MQTTPropBuilder_t * sendPropsBuffer, | ||
MQTTPropBuilder_t * getPropsBuffer ) | ||
{ | ||
uint16_t packetIdentifier; | ||
|
||
|
@@ -659,7 +665,7 @@ static bool handlePublishResend( MQTTContext_t * pMqttContext ) | |
outgoingPublishPackets[ index ].packetId ) ); | ||
mqttStatus = MQTT_Publish( pMqttContext, | ||
&outgoingPublishPackets[ index ].pubInfo, | ||
outgoingPublishPackets[ index ].packetId ); | ||
outgoingPublishPackets[ index ].packetId , NULL); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -799,7 +805,7 @@ bool EstablishMqttSession( MQTTPublishCallback_t publishCallback ) | |
pOutgoingPublishRecords, | ||
OUTGOING_PUBLISH_RECORD_LEN, | ||
pIncomingPublishRecords, | ||
INCOMING_PUBLISH_RECORD_LEN ); | ||
INCOMING_PUBLISH_RECORD_LEN, NULL, 0 ); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -842,7 +848,7 @@ bool EstablishMqttSession( MQTTPublishCallback_t publishCallback ) | |
&connectInfo, | ||
NULL, | ||
CONNACK_RECV_TIMEOUT_MS, | ||
&sessionPresent ); | ||
&sessionPresent, NULL, NULL ); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -908,7 +914,7 @@ bool DisconnectMqttSession( void ) | |
if( mqttSessionEstablished == true ) | ||
{ | ||
/* Send DISCONNECT. */ | ||
mqttStatus = MQTT_Disconnect( pMqttContext ); | ||
mqttStatus = MQTT_Disconnect( pMqttContext , NULL, MQTT_REASON_DISCONNECT_NORMAL_DISCONNECTION); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -956,7 +962,7 @@ bool SubscribeToTopic( const char * pTopicFilter, | |
mqttStatus = MQTT_Subscribe( pMqttContext, | ||
pSubscriptionList, | ||
sizeof( pSubscriptionList ) / sizeof( MQTTSubscribeInfo_t ), | ||
globalSubscribePacketIdentifier ); | ||
globalSubscribePacketIdentifier, NULL); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -1012,7 +1018,7 @@ bool UnsubscribeFromTopic( const char * pTopicFilter, | |
mqttStatus = MQTT_Unsubscribe( pMqttContext, | ||
pSubscriptionList, | ||
sizeof( pSubscriptionList ) / sizeof( MQTTSubscribeInfo_t ), | ||
globalUnsubscribePacketIdentifier ); | ||
globalUnsubscribePacketIdentifier, NULL); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
@@ -1080,7 +1086,7 @@ bool PublishToTopic( const char * pTopicFilter, | |
/* Send PUBLISH packet. */ | ||
mqttStatus = MQTT_Publish( pMqttContext, | ||
&outgoingPublishPackets[ publishIndex ].pubInfo, | ||
outgoingPublishPackets[ publishIndex ].packetId ); | ||
outgoingPublishPackets[ publishIndex ].packetId , NULL ); | ||
|
||
if( mqttStatus != MQTTSuccess ) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ | |
* @note This path is relative from the demo binary created. Update | ||
* ROOT_CA_CERT_PATH to the absolute path if this demo is executed from elsewhere. | ||
*/ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert the changes in the demo_config.h files. |
||
#ifndef ROOT_CA_CERT_PATH | ||
#define ROOT_CA_CERT_PATH "certificates/AmazonRootCA1.crt" | ||
#endif | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ openssl x509 -req \ | |
|
||
Deploy the following components to your Greengrass core: | ||
- aws.greengrass.clientdevices.Auth | ||
- aws.greengrass.clientdevices.mqtt.Moquette | ||
- aws.greengrass.clientdevices.mqtt.EMQX | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a comment here that this update is made because the Moquette broker does not support MQTTv5. |
||
- aws.greengrass.clientdevices.mqtt.Bridge | ||
- aws.greengrass.clientdevices.IPDetector | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove any and all changes made in the demo_config.h files unless it is related to the MQTTv5 upgrade.