AWS IoT Over-the-air Update  v3.1.0
Client library for AWS IoT OTA
OTA_GetStatistics

Get the statistics of OTA message packets.

Packet statistics are:

  • Received: The number of OTA packets that have been received but not necessarily queued for processing by the OTA agent.
  • Queued: The number of OTA packets that have been queued for processing. This implies there was a free message queue entry so it can be passed to the agent for processing.
  • Processed: The number of OTA packets that have actually been processed.
  • Dropped: The number of OTA packets that have been dropped because of either no queue or at shutdown cleanup.
Note
Calling OTA_Init will reset this statistic.
Returns
OtaErrNone if the statistics can be received successfully.

Example

// OTA library packet statistics per job.
OtaAgentStatistics_t otaStatistics = { 0 };
// Get the current statistics from the agent.
otaErr = OTA_GetStatistics( &otaStatistics );
if( otaErr != OtaErrNone )
{
printf( " Received: %u Queued: %u Processed: %u Dropped: %u",
otaStatistics.otaPacketsReceived,
otaStatistics.otaPacketsQueued,
otaStatistics.otaPacketsProcessed,
otaStatistics.otaPacketsDropped );
}
OtaAgentStatistics_t
This is the OTA statistics structure to hold useful info.
Definition: ota_private.h:291
OtaErr_t
OtaErr_t
The OTA API return status. OTA agent error codes are in the upper 8 bits of the 32 bit OTA error word...
Definition: ota.h:79
OtaAgentStatistics_t::otaPacketsDropped
uint32_t otaPacketsDropped
Definition: ota_private.h:295
OtaAgentStatistics_t::otaPacketsReceived
uint32_t otaPacketsReceived
Definition: ota_private.h:292
OtaAgentStatistics_t::otaPacketsQueued
uint32_t otaPacketsQueued
Definition: ota_private.h:293
OtaAgentStatistics_t::otaPacketsProcessed
uint32_t otaPacketsProcessed
Definition: ota_private.h:294
OtaErrNone
@ OtaErrNone
No error occurred during the operation.
Definition: ota.h:80
OTA_GetStatistics
OtaErr_t OTA_GetStatistics(OtaAgentStatistics_t *pStatistics)
Get the statistics of OTA message packets.
Definition: ota.c:3223