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:
parent
3137d5288b
commit
13ff0dbb36
@ -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
|
||||
/**
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user