f806c5829b
* pre-commit: Update and enable clang-format check There is newer version from clang-format so use that. We do not yet want 18 as that is little bit too new. * Format some thing by hand which clang-format "breaks" Clang-format will format some things little bit off in some cases. Format some things by hand so we get cleaner end result. * Run clang-format with ``` pre-commit run --all-files clang-format ``` We have already in previously checked places where clang-format does not make good format and ignored those (hopefully most of the things). --------- Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
44 lines
900 B
C
44 lines
900 B
C
/**
|
|
* @file
|
|
* @brief Stub functions for unit test of a BACnet object
|
|
* @author Steve Karg <skarg@users.sourceforge.net>
|
|
* @date December 2022
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "bacnet/datetime.h"
|
|
|
|
static BACNET_DATE BACnet_Date;
|
|
static BACNET_TIME BACnet_Time;
|
|
|
|
bool datetime_local(
|
|
BACNET_DATE *bdate,
|
|
BACNET_TIME *btime,
|
|
int16_t *utc_offset_minutes,
|
|
bool *dst_active)
|
|
{
|
|
if (bdate) {
|
|
datetime_copy_date(bdate, &BACnet_Date);
|
|
}
|
|
if (btime) {
|
|
datetime_copy_time(btime, &BACnet_Time);
|
|
}
|
|
(void)utc_offset_minutes;
|
|
(void)dst_active;
|
|
|
|
return true;
|
|
}
|
|
|
|
void datetime_timesync(BACNET_DATE *bdate, BACNET_TIME *btime, bool utc)
|
|
{
|
|
if (bdate) {
|
|
datetime_copy_date(&BACnet_Date, bdate);
|
|
}
|
|
if (btime) {
|
|
datetime_copy_time(&BACnet_Time, btime);
|
|
}
|
|
(void)utc;
|
|
}
|