|
51 | 51 |
|
52 | 52 | /*-----------------------------------------------------------*/
|
53 | 53 |
|
54 |
| -#if ( MQTT_AGENT_USE_QOS_1_2_PUBLISH != 0 ) |
55 |
| - |
56 |
| -/** |
57 |
| - * @brief Array used to maintain the outgoing publish records and their |
58 |
| - * state by the coreMQTT library. |
59 |
| - */ |
60 |
| - static MQTTPubAckInfo_t pOutgoingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; |
61 |
| - |
62 |
| -/** |
63 |
| - * @brief Array used to maintain the incoming publish records and their |
64 |
| - * state by the coreMQTT library. |
65 |
| - */ |
66 |
| - static MQTTPubAckInfo_t pIncomingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; |
67 |
| -#endif |
68 |
| - |
69 | 54 | /**
|
70 | 55 | * @brief Track an operation by adding it to a list, indicating it is anticipating
|
71 | 56 | * an acknowledgment.
|
@@ -562,9 +547,9 @@ static MQTTStatus_t processCommand( MQTTAgentContext_t * pMqttAgentContext,
|
562 | 547 |
|
563 | 548 | if( pCommand != NULL )
|
564 | 549 | {
|
565 |
| - assert( ( unsigned int ) pCommand->commandType < ( unsigned int ) NUM_COMMANDS ); |
| 550 | + assert( ( uint32_t ) pCommand->commandType < ( uint32_t ) NUM_COMMANDS ); |
566 | 551 |
|
567 |
| - if( ( unsigned int ) pCommand->commandType < ( unsigned int ) NUM_COMMANDS ) |
| 552 | + if( ( uint32_t ) pCommand->commandType < ( uint32_t ) NUM_COMMANDS ) |
568 | 553 | {
|
569 | 554 | commandFunction = pCommandFunctionTable[ pCommand->commandType ];
|
570 | 555 | pCommandArgs = pCommand->pArgs;
|
@@ -657,6 +642,9 @@ static MQTTAgentContext_t * getAgentFromMQTTContext( MQTTContext_t * pMQTTContex
|
657 | 642 | MQTTAgentContext_t ctx = { 0 };
|
658 | 643 | ptrdiff_t offset = ( ( uint8_t * ) &( ctx.mqttContext ) ) - ( ( uint8_t * ) &ctx );
|
659 | 644 |
|
| 645 | + /* MISRA Ref 11.3.1 [Misaligned access] */ |
| 646 | + /* More details at: https://github.com/FreeRTOS/coreMQTT-Agent/blob/main/MISRA.md#rule-113 */ |
| 647 | + /* coverity[misra_c_2012_rule_11_3_violation] */ |
660 | 648 | return ( MQTTAgentContext_t * ) &( ( ( uint8_t * ) pMQTTContext )[ 0 - offset ] );
|
661 | 649 | }
|
662 | 650 |
|
@@ -987,6 +975,18 @@ MQTTStatus_t MQTTAgent_Init( MQTTAgentContext_t * pMqttAgentContext,
|
987 | 975 | {
|
988 | 976 | MQTTStatus_t returnStatus;
|
989 | 977 |
|
| 978 | + /** |
| 979 | + * @brief Array used to maintain the outgoing publish records and their |
| 980 | + * state by the coreMQTT library. |
| 981 | + */ |
| 982 | + static MQTTPubAckInfo_t pIncomingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; |
| 983 | + |
| 984 | + /** |
| 985 | + * @brief Array used to maintain the outgoing publish records and their |
| 986 | + * state by the coreMQTT library. |
| 987 | + */ |
| 988 | + static MQTTPubAckInfo_t pOutgoingPublishRecords[ MQTT_AGENT_MAX_OUTSTANDING_ACKS ]; |
| 989 | + |
990 | 990 | if( ( pMqttAgentContext == NULL ) ||
|
991 | 991 | ( pMsgInterface == NULL ) ||
|
992 | 992 | ( pTransportInterface == NULL ) ||
|
|
0 commit comments