Skip to content

Commit

Permalink
Fix: update the lastPacketRxTime field when packets are received
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Bartell <[email protected]>
  • Loading branch information
onkwon and paulbartell authored Dec 15, 2022
1 parent 19d198c commit d7a478a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/doxygen/include/size_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<tr>
<td>core_mqtt.c</td>
<td><center>4.1K</center></td>
<td><center>3.4K</center></td>
<td><center>3.5K</center></td>
</tr>
<tr>
<td>core_mqtt_state.c</td>
Expand All @@ -25,6 +25,6 @@
<tr>
<td><b>Total estimates</b></td>
<td><b><center>8.6K</center></b></td>
<td><b><center>6.9K</center></b></td>
<td><b><center>7.0K</center></b></td>
</tr>
</table>
5 changes: 5 additions & 0 deletions source/core_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,11 @@ static MQTTStatus_t receiveSingleIteration( MQTTContext_t * pContext,
( void ) memmove( pContext->networkBuffer.pBuffer,
&( pContext->networkBuffer.pBuffer[ totalMQTTPacketLength ] ),
pContext->index );

if( status == MQTTSuccess )
{
pContext->lastPacketRxTime = pContext->getTime();
}
}

if( status == MQTTNoDataAvailable )
Expand Down

0 comments on commit d7a478a

Please sign in to comment.