public static int Decode_Time(ref Byte[] apdu, ref BACNET_TIME btime, int pos) { btime.hour = apdu[pos + 0]; btime.min = apdu[pos + 1]; btime.sec = apdu[pos + 2]; btime.hundredths = apdu[pos + 3]; return(4); }
public static int Decode_Application_Time(ref Byte[] apdu, ref BACNET_TIME btime, int pos) { int len = 0; Byte tag_number = 0; Decode_Tag_Number(ref apdu, ref tag_number, pos + len); tag_number = (Byte)BACNET_APPLICATION_TAG.BACNET_APPLICATION_TAG_TIME; len++; len += Decode_Time(ref apdu, ref btime, pos + len); return(len); }
public static int Encode_Application_Time(ref Byte[] apdu, ref BACNET_TIME btime, int pos) { int len = 0; apdu[pos + 1] = btime.hour; apdu[pos + 2] = btime.min; apdu[pos + 3] = btime.sec; apdu[pos + 4] = btime.hundredths; len = 4; len += Encode_Tag(ref apdu, (Byte)BACNET_APPLICATION_TAG.BACNET_APPLICATION_TAG_TIME, false, (UInt32)len, pos + 0); return(len); }