|
SBB Host
Host communication with the self balancing bike.
|
A class to get system time. More...
#include <Timepp.h>
Public Member Functions | |
| Time () | |
| Constructor. More... | |
| void | update_time () |
| Update the time. More... | |
| int | getYear (bool update=true) |
| Get the current year. More... | |
| int | getMonth (bool update=true) |
| Get the current month. More... | |
| int | getDay (bool update=true) |
| Get the current month day. More... | |
| int | getHour (bool update=true) |
| Get the current hour. More... | |
| int | getMin (bool update=true) |
| Get the current minute. More... | |
| int | getSec (bool update=true) |
| Get the current second. More... | |
| int | getData (char *str, size_t len, bool update=true) |
| Get the current date-time. More... | |
| std::string | getData (bool update=true) |
| Get the current data-time. More... | |
Private Attributes | |
| struct tm | tm |
| Variable to store the current time. More... | |
Static Private Attributes | |
| static constexpr int | STR_LEN = 256 |
| String length to use as buffer. More... | |
A class to get system time.
Class to get the system time in Windows and Linux. Actually this is just a wrapper for the localtime function of the time library.
|
inline |
Constructor.
Constructor for Time object. It automatically updates the time
|
inline |
Get the current data-time.
Function to get the current data-time with format YYYY-MM-DD hh::mm::ss.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current date-time.
Function to get the current date-time with format YYYY-MM-DD hh::mm::ss.
| str | A pointer to char to store the string. |
| len | The length of the char buffer. |
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current month day.
Function to get the current month day (from 1).
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current hour.
Function to get the current hour.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current minute.
Function to get the current minute.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current month.
Function to get the current month.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current second.
Function to get the current second.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Get the current year.
Function to get the current year.
| update | A flag to update the time before getting the value (default is true). |
|
inline |
Update the time.
Function to update the time stored in tm (to be called every time).
|
staticconstexprprivate |
String length to use as buffer.
|
private |
Variable to store the current time.