Important Update:

- DateTimeCore:
  - Added new functions Get/SetDateTime() for combined date & time get/set
  - Added LocalTime param to ReadDate/Time() and BuildDate/TimeStr()
    - Allow input time to interpretted as ether UTC or local time
- DeviceCore:
  - Added SourceRef to HandleCommand()
This commit is contained in:
Charl Wentzel
2019-06-19 11:18:34 +02:00
parent 794b7e5486
commit 207caa696d
5 changed files with 129 additions and 58 deletions

View File

@@ -17,11 +17,15 @@
//---------------------------------------------------------------------------
// Get and set System Date and Time
bool SetTime( unsigned char Hours, unsigned char Minutes, unsigned char Seconds );
bool GetTime( unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool SetDate( unsigned char Day, unsigned char Month, unsigned Year );
bool GetDate( unsigned char &Day, unsigned char &Month, unsigned &Year );
bool GetDateTime( unsigned char &Day, unsigned char &Month, unsigned &Year,
unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool SetTime( unsigned char Hours, unsigned char Minutes, unsigned char Seconds );
bool SetDate( unsigned char Day, unsigned char Month, unsigned Year );
bool SetDateTime( unsigned char Day, unsigned char Month, unsigned Year,
unsigned char Hours, unsigned char Minutes, unsigned char Seconds );
char const * GetDateStr( const char * DateSeparator = "/" );
char const * GetTimeStr( const char * TimeSeparator = ":" );
@@ -29,9 +33,10 @@ char const * GetDateTimeStr( const char * DateSeparator = "/", const char * Tim
//---------------------------------------------------------------------------
bool ReadTime( const time_t EpochTime, unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool ReadDate( const time_t EpochTime, unsigned char &Day, unsigned char &Month, unsigned &Year );
bool ReadDateTime( const time_t EpochTime, unsigned char &Day, unsigned char &Month, unsigned &Year,
// Build or interpret time data
bool ReadTime( const time_t EpochTime, bool LocalTime, unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool ReadDate( const time_t EpochTime, bool LocalTime, unsigned char &Day, unsigned char &Month, unsigned &Year );
bool ReadDateTime( const time_t EpochTime, bool LocalTime, unsigned char &Day, unsigned char &Month, unsigned &Year,
unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds );
bool ReadTimeStr( const char *DateTimeStr, unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds, bool Maxtime );
@@ -39,9 +44,9 @@ bool ReadDateStr( const char *DateTimeStr, unsigned char &Day, unsigned char
bool ReadDateTimeStr( const char *DateTimeStr, unsigned char &Day, unsigned char &Month, unsigned &Year,
unsigned char &Hours, unsigned char &Minutes, unsigned char &Seconds, bool Maxtime );
char const * BuildDateStr( const time_t EpochTime, const char * DateSeparator = "/" );
char const * BuildTimeStr( const time_t EpochTime, const char * TimeSeparator = ":" );
char const * BuildDateTimeStr( const time_t EpochTime, const char * DateSeparator = "/", const char * TimeSeparator = ":" );
char const * BuildDateStr( const time_t EpochTime, bool LocalTime, const char * DateSeparator = "/" );
char const * BuildTimeStr( const time_t EpochTime, bool LocalTime, const char * TimeSeparator = ":" );
char const * BuildDateTimeStr( const time_t EpochTime, bool LocalTime, const char * DateSeparator = "/", const char * TimeSeparator = ":" );
//---------------------------------------------------------------------------