diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2758f11..15f8284 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog for coreMQTT Agent Library
+## v2.0.0 (May 2026)
+
+### Changes
+
+- [#136](https://github.com/FreeRTOS/coreMQTT-Agent/pull/136) Update coreMQTT-Agent to use coreMQTT v5.0.x allowing use of MQTTv5 functionality.
+
## v1.3.1 (August 2024)
### Changes
diff --git a/docs/doxygen/config.doxyfile b/docs/doxygen/config.doxyfile
index c050b43..4612036 100644
--- a/docs/doxygen/config.doxyfile
+++ b/docs/doxygen/config.doxyfile
@@ -48,7 +48,7 @@ PROJECT_NAME = "coreMQTT Agent"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = v1.3.1+
+PROJECT_NUMBER = v1.3.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/docs/doxygen/include/size_table.md b/docs/doxygen/include/size_table.md
index 0eea2fa..7988975 100644
--- a/docs/doxygen/include/size_table.md
+++ b/docs/doxygen/include/size_table.md
@@ -19,8 +19,8 @@
| core_mqtt.c (coreMQTT) |
- 8.2K |
- 7.1K |
+ 8.3K |
+ 7.2K |
| core_mqtt_state.c (coreMQTT) |
@@ -29,12 +29,12 @@
| core_mqtt_serializer.c (coreMQTT) |
- 9.4K |
+ 9.5K |
7.3K |
| Total estimates |
- 21.4K |
- 17.5K |
+ 21.6K |
+ 17.6K |
diff --git a/manifest.yml b/manifest.yml
index a3c278b..d75269b 100644
--- a/manifest.yml
+++ b/manifest.yml
@@ -1,11 +1,11 @@
name : "coreMQTT Agent"
-version: "v1.3.1+"
+version: "v1.3.2"
description: |
"Agent for thread-safe use of coreMQTT.\n"
license: "MIT"
dependencies:
- name : "coreMQTT"
- version: "76e9d89cb8e2fb4cff965329d835594cebebf618"
+ version: "v5.0.2"
license: "MIT"
repository:
type: "git"
diff --git a/source/core_mqtt_agent.c b/source/core_mqtt_agent.c
index d751bdf..13262cf 100644
--- a/source/core_mqtt_agent.c
+++ b/source/core_mqtt_agent.c
@@ -430,7 +430,7 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
MQTTAgentCommandContext_t * pCommandCompleteCallbackContext,
MQTTAgentCommand_t * pCommand )
{
- bool isValid, isSpace = true;
+ bool isSpace = true;
MQTTStatus_t statusReturn;
const MQTTAgentPublishArgs_t * pPublishArgs = NULL;
@@ -451,8 +451,6 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
* the array contains space for another outstanding ack. */
isSpace = isSpaceInPendingAckList( pMqttAgentContext );
- isValid = isSpace;
-
break;
case PUBLISH:
@@ -469,8 +467,6 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
isSpace = isSpaceInPendingAckList( pMqttAgentContext );
}
- isValid = isSpace;
-
break;
case PROCESSLOOP:
@@ -479,11 +475,10 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
case DISCONNECT:
default:
/* Other operations don't need to store ACKs. */
- isValid = true;
break;
}
- if( isValid )
+ if( isSpace )
{
pCommand->commandType = commandType;
pCommand->pArgs = pMqttInfoParam;
@@ -491,15 +486,7 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
pCommand->pCommandCompleteCallback = commandCompleteCallback;
}
- statusReturn = ( isValid ) ? MQTTSuccess : MQTTBadParameter;
-
- if( ( statusReturn == MQTTBadParameter ) && ( isSpace == false ) )
- {
- /* The error was caused not by a bad parameter, but because there was
- * no room in the pending Ack list for the Ack response to an outgoing
- * PUBLISH or SUBSCRIBE message. */
- statusReturn = MQTTNoMemory;
- }
+ statusReturn = ( isSpace ) ? MQTTSuccess : MQTTNoMemory;
return statusReturn;
}
@@ -622,7 +609,7 @@ static void handleAcks( const MQTTAgentContext_t * pAgentContext,
assert( pAckInfo->pOriginalCommand != NULL );
/* A SUBACK's status codes start 2 bytes after the variable header. */
- pSubackCodes = ( packetType == MQTT_PACKET_TYPE_SUBACK ) ? ( pPacketInfo->pRemainingData + 2U ) : NULL;
+ pSubackCodes = ( packetType == MQTT_PACKET_TYPE_SUBACK ) ? ( &pPacketInfo->pRemainingData[ 2U ] ) : NULL;
concludeCommand( pAgentContext,
pAckInfo->pOriginalCommand,
@@ -1013,7 +1000,7 @@ MQTTStatus_t MQTTAgent_Init( MQTTAgentContext_t * pMqttAgentContext,
returnStatus = MQTT_Init( &( pMqttAgentContext->mqttContext ),
pTransportInterface,
getCurrentTimeMs,
- mqttEventCallback,
+ &mqttEventCallback,
pNetworkBuffer );
#if ( MQTT_AGENT_USE_QOS_1_2_PUBLISH != 0 )
diff --git a/source/dependency/coreMQTT b/source/dependency/coreMQTT
index 76e9d89..04845c6 160000
--- a/source/dependency/coreMQTT
+++ b/source/dependency/coreMQTT
@@ -1 +1 @@
-Subproject commit 76e9d89cb8e2fb4cff965329d835594cebebf618
+Subproject commit 04845c6a8e5f9cf2d232f1c6e80baeb81302e690
diff --git a/source/include/core_mqtt_agent_command_functions.h b/source/include/core_mqtt_agent_command_functions.h
index cc7e320..1fb31c3 100644
--- a/source/include/core_mqtt_agent_command_functions.h
+++ b/source/include/core_mqtt_agent_command_functions.h
@@ -64,17 +64,17 @@
#ifndef MQTT_AGENT_FUNCTION_TABLE
/* Designated initializers are only in C99+. */
#if defined( __STDC_VERSION__ ) && ( __STDC_VERSION__ >= 199901L )
- #define MQTT_AGENT_FUNCTION_TABLE \
- { \
- [ NONE ] = MQTTAgentCommand_ProcessLoop, \
- [ PROCESSLOOP ] = MQTTAgentCommand_ProcessLoop, \
- [ PUBLISH ] = MQTTAgentCommand_Publish, \
- [ SUBSCRIBE ] = MQTTAgentCommand_Subscribe, \
- [ UNSUBSCRIBE ] = MQTTAgentCommand_Unsubscribe, \
- [ PING ] = MQTTAgentCommand_Ping, \
- [ CONNECT ] = MQTTAgentCommand_Connect, \
- [ DISCONNECT ] = MQTTAgentCommand_Disconnect, \
- [ TERMINATE ] = MQTTAgentCommand_Terminate \
+ #define MQTT_AGENT_FUNCTION_TABLE \
+ { \
+ [ NONE ] = &MQTTAgentCommand_ProcessLoop, \
+ [ PROCESSLOOP ] = &MQTTAgentCommand_ProcessLoop, \
+ [ PUBLISH ] = &MQTTAgentCommand_Publish, \
+ [ SUBSCRIBE ] = &MQTTAgentCommand_Subscribe, \
+ [ UNSUBSCRIBE ] = &MQTTAgentCommand_Unsubscribe, \
+ [ PING ] = &MQTTAgentCommand_Ping, \
+ [ CONNECT ] = &MQTTAgentCommand_Connect, \
+ [ DISCONNECT ] = &MQTTAgentCommand_Disconnect, \
+ [ TERMINATE ] = &MQTTAgentCommand_Terminate \
}
#else /* if defined( __STDC_VERSION__ ) && ( __STDC_VERSION__ >= 199901L ) */
@@ -82,15 +82,15 @@
* to the order of MQTTAgentCommandType_t commands. */
#define MQTT_AGENT_FUNCTION_TABLE \
{ \
- MQTTAgentCommand_ProcessLoop, \
- MQTTAgentCommand_ProcessLoop, \
- MQTTAgentCommand_Publish, \
- MQTTAgentCommand_Subscribe, \
- MQTTAgentCommand_Unsubscribe, \
- MQTTAgentCommand_Ping, \
- MQTTAgentCommand_Connect, \
- MQTTAgentCommand_Disconnect, \
- MQTTAgentCommand_Terminate \
+ &MQTTAgentCommand_ProcessLoop, \
+ &MQTTAgentCommand_ProcessLoop, \
+ &MQTTAgentCommand_Publish, \
+ &MQTTAgentCommand_Subscribe, \
+ &MQTTAgentCommand_Unsubscribe, \
+ &MQTTAgentCommand_Ping, \
+ &MQTTAgentCommand_Connect, \
+ &MQTTAgentCommand_Disconnect, \
+ &MQTTAgentCommand_Terminate \
}
#endif /* if defined( __STDC_VERSION__ ) && ( __STDC_VERSION__ >= 199901L ) */
#endif /* ifndef MQTT_AGENT_FUNCTION_TABLE */
@@ -153,13 +153,13 @@ MQTTStatus_t MQTTAgentCommand_ProcessLoop( MQTTAgentContext_t * pMqttAgentContex
* - MQTTAgentCommandFuncReturns_t.addAcknowledgment (for QoS > 0)
*
* @param[in] pMqttAgentContext MQTT Agent context information.
- * @param[in] pPublishArg Publish information for MQTT_Publish().
+ * @param[in] pVoidPublishArgs Publish information for MQTT_Publish().
* @param[out] pReturnFlags Flags set to indicate actions the MQTT agent should take.
*
* @return Status code of MQTT_Publish().
*/
MQTTStatus_t MQTTAgentCommand_Publish( MQTTAgentContext_t * pMqttAgentContext,
- void * pPublishArg,
+ void * pVoidPublishArgs,
MQTTAgentCommandFuncReturns_t * pReturnFlags );
/**
@@ -218,13 +218,13 @@ MQTTStatus_t MQTTAgentCommand_Connect( MQTTAgentContext_t * pMqttAgentContext,
* - MQTTAgentCommandFuncReturns_t.endLoop
*
* @param[in] pMqttAgentContext MQTT Agent context information.
- * @param[in] pUnusedArg Unused NULL argument.
+ * @param[in] pVoidDisconnectArgs Unused NULL argument.
* @param[out] pReturnFlags Flags set to indicate actions the MQTT agent should take.
*
* @return Status code of MQTT_Disconnect().
*/
MQTTStatus_t MQTTAgentCommand_Disconnect( MQTTAgentContext_t * pMqttAgentContext,
- void * pUnusedArg,
+ void * pVoidDisconnectArgs,
MQTTAgentCommandFuncReturns_t * pReturnFlags );
/**