Implement missing data types for calendar and schedule (#474)

* Added the SpecialEvent struct for the Exception_Schedule property of Schedule, encode/decode/same functions, unit tests, and integrated into bacapp functions.

* Added the CalendarEntry struct for the Date_List property of Calendar and the SpecialEvent struct, encode/decode functions, unit tests, and integrated into bacapp functions.

* Added the DateRange struct for the Effective_Period property of Schedule, encode/decode functions, unit tests, and integrated into bacapp functions.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Ondřej Hruška
2024-02-01 17:57:46 +01:00
committed by GitHub
parent 7ad82f19a0
commit 340bd09561
120 changed files with 2003 additions and 124 deletions
+29 -25
View File
@@ -1,28 +1,17 @@
/**************************************************************************
/**
* @file
* @brief API for BACnetDate, BACnetTime, BACnetDateTime, BACnetDateRange
* complex data type encode and decode
* @author Steve Karg <skarg@users.sourceforge.net>
* @author Greg Shue <greg.shue@outlook.com>
* @author Ondřej Hruška <ondra@ondrovo.com>
* @date 2012
* @section LICENSE
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef DATE_TIME_H
#define DATE_TIME_H
* SPDX-License-Identifier: MIT
*/
#ifndef BACNET_DATE_TIME_H
#define BACNET_DATE_TIME_H
#include <stdint.h>
#include <stdbool.h>
@@ -288,6 +277,21 @@ int bacapp_decode_context_datetime(uint8_t *apdu,
uint8_t tag_number,
BACNET_DATE_TIME *value);
BACNET_STACK_EXPORT
int bacnet_daterange_encode(uint8_t *apdu, BACNET_DATE_RANGE *value);
BACNET_STACK_EXPORT
int bacnet_daterange_decode(uint8_t *apdu,
uint32_t apdu_size,
BACNET_DATE_RANGE *value);
BACNET_STACK_EXPORT
int bacnet_daterange_context_encode(
uint8_t *apdu, uint8_t tag_number, BACNET_DATE_RANGE *value);
BACNET_STACK_EXPORT
int bacnet_daterange_context_decode(uint8_t *apdu,
uint32_t apdu_size,
uint8_t tag_number,
BACNET_DATE_RANGE *value);
/* implementation agnostic functions - create your own! */
BACNET_STACK_EXPORT
bool datetime_local(BACNET_DATE *bdate,
@@ -300,4 +304,4 @@ void datetime_init(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* DATE_TIME_H */
#endif