Feature/refactor datetime os dependency (#63)

* remove dependency on OS for time functions.

* add datetime epoch to and from seconds (yikes! 64-bit!). Add symmetric midnight seconds for unit test. Add unit tests.

* clean up BACnet date time warnings

* fix BACnet datetime warnings

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-04-04 11:23:26 -05:00
committed by GitHub
parent b159402647
commit 0ce6368b43
7 changed files with 142 additions and 108 deletions
+13
View File
@@ -149,6 +149,11 @@ extern "C" {
uint16_t year,
uint8_t month,
uint8_t day);
BACNET_STACK_EXPORT
void datetime_seconds_since_midnight_into_time(
uint32_t seconds,
BACNET_TIME *btime);
BACNET_STACK_EXPORT
uint32_t datetime_seconds_since_midnight(
BACNET_TIME * btime);
@@ -208,6 +213,14 @@ extern "C" {
BACNET_DATE_TIME * bdatetime,
int32_t minutes);
BACNET_STACK_EXPORT
uint64_t datetime_seconds_since_epoch(
BACNET_DATE_TIME * bdatetime);
BACNET_STACK_EXPORT
void datetime_since_epoch_seconds(
BACNET_DATE_TIME * bdatetime,
uint64_t seconds);
/* date and time wildcards */
BACNET_STACK_EXPORT
bool datetime_wildcard_year(