1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Add accessor method to get the time of the last timestamp to avoid breaking the

API
This commit is contained in:
James Cotton 2012-07-23 19:44:07 -05:00
parent 3137d5288b
commit 13ff0dbb36
2 changed files with 14 additions and 0 deletions

View File

@ -60,6 +60,7 @@ UAVTalkRxState UAVTalkProcessInputStream(UAVTalkConnection connection, uint8_t r
UAVTalkRxState UAVTalkProcessInputStreamQuiet(UAVTalkConnection connection, uint8_t rxbyte);
void UAVTalkGetStats(UAVTalkConnection connection, UAVTalkStats *stats);
void UAVTalkResetStats(UAVTalkConnection connection);
void UAVTalkGetLastTimestamp(UAVTalkConnection connection, uint16_t *timestamp);
#endif // UAVTALK_H
/**

View File

@ -147,6 +147,19 @@ void UAVTalkResetStats(UAVTalkConnection connectionHandle)
xSemaphoreGiveRecursive(connection->lock);
}
/**
* Accessor method to get the timestamp from the last UAVTalk message
*/
void UAVTalkGetLastTimestamp(UAVTalkConnection connectionHandle, uint16_t *timestamp)
{
UAVTalkConnectionData *connection;
CHECKCONHANDLE(connectionHandle,connection,return);
UAVTalkInputProcessor *iproc = &connection->iproc;
*timestamp = iproc->timestamp;
}
/**
* Request an update for the specified object, on success the object data would have been
* updated by the GCS.