Added function bacapp_encode_datetime(), needed for new DateTime object's Present_Value.
This commit is contained in:
@@ -140,6 +140,10 @@ extern "C" {
|
|||||||
void datetime_time_wildcard_set(
|
void datetime_time_wildcard_set(
|
||||||
BACNET_TIME * btime);
|
BACNET_TIME * btime);
|
||||||
|
|
||||||
|
int bacapp_encode_datetime(
|
||||||
|
uint8_t * apdu,
|
||||||
|
BACNET_DATE_TIME * value);
|
||||||
|
|
||||||
int bacapp_encode_context_datetime(
|
int bacapp_encode_context_datetime(
|
||||||
uint8_t * apdu,
|
uint8_t * apdu,
|
||||||
uint8_t tag_number,
|
uint8_t tag_number,
|
||||||
|
|||||||
@@ -453,6 +453,25 @@ void datetime_wildcard_set(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int bacapp_encode_datetime(
|
||||||
|
uint8_t * apdu,
|
||||||
|
BACNET_DATE_TIME * value)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
int apdu_len = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if (apdu && value) {
|
||||||
|
len = encode_application_date(&apdu[0], &value->date);
|
||||||
|
apdu_len += len;
|
||||||
|
|
||||||
|
len = encode_application_time(&apdu[apdu_len], &value->time);
|
||||||
|
apdu_len += len;
|
||||||
|
}
|
||||||
|
return apdu_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int bacapp_encode_context_datetime(
|
int bacapp_encode_context_datetime(
|
||||||
uint8_t * apdu,
|
uint8_t * apdu,
|
||||||
uint8_t tag_number,
|
uint8_t tag_number,
|
||||||
@@ -466,10 +485,7 @@ int bacapp_encode_context_datetime(
|
|||||||
len = encode_opening_tag(&apdu[apdu_len], tag_number);
|
len = encode_opening_tag(&apdu[apdu_len], tag_number);
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
|
|
||||||
len = encode_application_date(&apdu[apdu_len], &value->date);
|
len = bacapp_encode_datetime(&apdu[apdu_len], value );
|
||||||
apdu_len += len;
|
|
||||||
|
|
||||||
len = encode_application_time(&apdu[apdu_len], &value->time);
|
|
||||||
apdu_len += len;
|
apdu_len += len;
|
||||||
|
|
||||||
len = encode_closing_tag(&apdu[apdu_len], tag_number);
|
len = encode_closing_tag(&apdu[apdu_len], tag_number);
|
||||||
|
|||||||
Reference in New Issue
Block a user