Skip to main content
Version: 3.1.0

Timestamp

Timestamp is a feature that enables you to track the date at which an event occurs.

For example with a button driver: each time we read the button's state, we want to timestamp this event. To do that, we have to save a time information representing our timestamp.

time_luos_t button_timestamp;

Then we can save our timestamp's date when we read the state of the button:

ll_button_read(&button.state);
button_timestamp = Luos_Timestamp();

After retrieving the timestamp's value, you can do some calculation on it. For example, you can include a constant delay before measurement, or add a specific amount of time to manage future timestamp's date.

Then you can send a message with your button's value using Luos_SendTimestampMsg:

Luos_SendTimestampMsg(button_service, button_msg, button_timestamp);

You can find examples that are using this timestamp feature:

See all timestamp functions APIs