mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-04-11 03:02:20 +02: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);
|
UAVTalkRxState UAVTalkProcessInputStreamQuiet(UAVTalkConnection connection, uint8_t rxbyte);
|
||||||
void UAVTalkGetStats(UAVTalkConnection connection, UAVTalkStats *stats);
|
void UAVTalkGetStats(UAVTalkConnection connection, UAVTalkStats *stats);
|
||||||
void UAVTalkResetStats(UAVTalkConnection connection);
|
void UAVTalkResetStats(UAVTalkConnection connection);
|
||||||
|
void UAVTalkGetLastTimestamp(UAVTalkConnection connection, uint16_t *timestamp);
|
||||||
|
|
||||||
#endif // UAVTALK_H
|
#endif // UAVTALK_H
|
||||||
/**
|
/**
|
||||||
|
@ -147,6 +147,19 @@ void UAVTalkResetStats(UAVTalkConnection connectionHandle)
|
|||||||
xSemaphoreGiveRecursive(connection->lock);
|
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
|
* Request an update for the specified object, on success the object data would have been
|
||||||
* updated by the GCS.
|
* updated by the GCS.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user