Skip to content

Commit

Permalink
Uncrustify: triggered by comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 22, 2024
1 parent 4905c90 commit 7808d02
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
25 changes: 15 additions & 10 deletions source/core_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3732,30 +3732,35 @@ const char * MQTT_Status_strerror( MQTTStatus_t status )

/*-----------------------------------------------------------*/

size_t MQTT_GetBytesInMQTTVec( MQTTVec_t *pVec, size_t len )
size_t MQTT_GetBytesInMQTTVec( MQTTVec_t * pVec,
size_t len )
{
size_t memoryRequired = 0;
size_t i;
TransportOutVector_t * pTransportVec = (TransportOutVector_t*)pVec;

for (i = 0; i < len; i++) {
memoryRequired += pTransportVec[i].iov_len;
TransportOutVector_t * pTransportVec = ( TransportOutVector_t * ) pVec;

for( i = 0; i < len; i++ )
{
memoryRequired += pTransportVec[ i ].iov_len;
}

return memoryRequired;
}

/*-----------------------------------------------------------*/

void MQTT_SerializeMQTTVec( uint8_t * pAllocatedMem, MQTTVec_t *pVec, size_t len )
void MQTT_SerializeMQTTVec( uint8_t * pAllocatedMem,
MQTTVec_t * pVec,
size_t len )
{
TransportOutVector_t * pTransportVec = (TransportOutVector_t*)pVec;
TransportOutVector_t * pTransportVec = ( TransportOutVector_t * ) pVec;
size_t index = 0;
size_t i = 0;

for (i = 0; i < len; i++) {
memcpy(&pAllocatedMem[index], pTransportVec[i].iov_base, pTransportVec[i].iov_len);
index += pTransportVec[i].iov_len;
for( i = 0; i < len; i++ )
{
memcpy( &pAllocatedMem[ index ], pTransportVec[ i ].iov_base, pTransportVec[ i ].iov_len );
index += pTransportVec[ i ].iov_len;
}
}

Expand Down
19 changes: 11 additions & 8 deletions source/include/core_mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ MQTTStatus_t MQTT_CheckConnectStatus( MQTTContext_t * pContext );
* #MQTTNoDataAvailable if no data available to receive in transport until
* the @p timeoutMs for CONNACK;
* #MQTTStatusConnected if the connection is already established
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* MQTTPublishClearAllFailed if on a clean session connection, clearing all the
* previously copied publishes fails
Expand Down Expand Up @@ -750,7 +750,7 @@ MQTTStatus_t MQTT_Connect( MQTTContext_t * pContext,
* #MQTTBadParameter if invalid parameters are passed;
* #MQTTSendFailed if transport write failed;
* #MQTTStatusNotConnected if the connection is not established yet
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* #MQTTSuccess otherwise.
*
Expand Down Expand Up @@ -806,7 +806,7 @@ MQTTStatus_t MQTT_Subscribe( MQTTContext_t * pContext,
* #MQTTBadParameter if invalid parameters are passed;
* #MQTTSendFailed if transport write failed;
* #MQTTStatusNotConnected if the connection is not established yet
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* #MQTTPublishStoreFailed if the user provided callback to copy and store the
* outgoing publish packet fails
Expand Down Expand Up @@ -878,7 +878,7 @@ MQTTStatus_t MQTT_CancelCallback( const MQTTContext_t * pContext,
* #MQTTBadParameter if invalid parameters are passed;
* #MQTTSendFailed if transport write failed;
* #MQTTStatusNotConnected if the connection is not established yet
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* #MQTTSuccess otherwise.
*/
Expand All @@ -900,7 +900,7 @@ MQTTStatus_t MQTT_Ping( MQTTContext_t * pContext );
* #MQTTBadParameter if invalid parameters are passed;
* #MQTTSendFailed if transport write failed;
* #MQTTStatusNotConnected if the connection is not established yet
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* #MQTTSuccess otherwise.
*
Expand Down Expand Up @@ -990,7 +990,7 @@ MQTTStatus_t MQTT_Disconnect( MQTTContext_t * pContext );
* incomplete data; it should be called again (probably after a delay);
* #MQTTStatusNotConnected if the connection is not established yet and a PING
* or an ACK is being sent.
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* #MQTTStatusDisconnectPending if the user is expected to call MQTT_Disconnect
* before calling any other API
* #MQTTSuccess on success.
*
Expand Down Expand Up @@ -1255,7 +1255,8 @@ const char * MQTT_Status_strerror( MQTTStatus_t status );
* @return The bytes in the provided MQTTVec_t array which can then be used to set aside memory to be used with MQTT_SerializeMQTTVec( void * pAllocatedMem, MQTTVec_t *pVec, size_t len ) function.
*/
/* @[declare_mqtt_getbytesinmqttvec] */
size_t MQTT_GetBytesInMQTTVec( MQTTVec_t *pVec, size_t len );
size_t MQTT_GetBytesInMQTTVec( MQTTVec_t * pVec,
size_t len );
/* @[declare_mqtt_getbytesinmqttvec] */

/**
Expand All @@ -1266,7 +1267,9 @@ size_t MQTT_GetBytesInMQTTVec( MQTTVec_t *pVec, size_t len );
* @param[in] len The length of the #MQTTVec_t array.
*/
/* @[declare_mqtt_serializemqttvec] */
void MQTT_SerializeMQTTVec( uint8_t * pAllocatedMem, MQTTVec_t *pVec, size_t len );
void MQTT_SerializeMQTTVec( uint8_t * pAllocatedMem,
MQTTVec_t * pVec,
size_t len );
/* @[declare_mqtt_serializemqttvec] */

/* *INDENT-OFF* */
Expand Down

0 comments on commit 7808d02

Please sign in to comment.