Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/config.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions docs/doxygen/include/size_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</tr>
<tr>
<td>core_mqtt.c (coreMQTT)</td>
<td><center>8.2K</center></td>
<td><center>7.1K</center></td>
<td><center>8.3K</center></td>
<td><center>7.2K</center></td>
</tr>
<tr>
<td>core_mqtt_state.c (coreMQTT)</td>
Expand All @@ -29,12 +29,12 @@
</tr>
<tr>
<td>core_mqtt_serializer.c (coreMQTT)</td>
<td><center>9.4K</center></td>
<td><center>9.5K</center></td>
<td><center>7.3K</center></td>
</tr>
<tr>
<td><b>Total estimates</b></td>
<td><b><center>21.4K</center></b></td>
<td><b><center>17.5K</center></b></td>
<td><b><center>21.6K</center></b></td>
<td><b><center>17.6K</center></b></td>
</tr>
</table>
4 changes: 2 additions & 2 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
23 changes: 5 additions & 18 deletions source/core_mqtt_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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:
Expand All @@ -469,8 +467,6 @@ static MQTTStatus_t createCommand( MQTTAgentCommandType_t commandType,
isSpace = isSpaceInPendingAckList( pMqttAgentContext );
}

isValid = isSpace;

break;

case PROCESSLOOP:
Expand All @@ -479,27 +475,18 @@ 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;
pCommand->pCmdContext = pCommandCompleteCallbackContext;
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;
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 )
Expand Down
48 changes: 24 additions & 24 deletions source/include/core_mqtt_agent_command_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,33 @@
#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 ) */

/* If not using designated initializers, this must correspond
* 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 */
Expand Down Expand Up @@ -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 );

/**
Expand Down Expand Up @@ -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 );

/**
Expand Down
Loading