Package org.yamcs.tctm.ccsds.time
Class CucTimeDecoder
- java.lang.Object
-
- org.yamcs.tctm.ccsds.time.CucTimeDecoder
-
- All Implemented Interfaces:
TimeDecoder
public class CucTimeDecoder extends Object implements TimeDecoder
Decoder for CCSDS Unsegmented time Code as specified in TIME CODE FORMATS, CCSDS 301.0-B-4, Nov 2010 The time code is composed by- P-Field (preamble field) 8 or 16 bits optional
- T-Field - up to 7+10 bytes (although it could be longer for custom codes)
-
-
Constructor Summary
Constructors Constructor Description CucTimeDecoder(int pfield1)CucTimeDecoder(int pfield1, int pfield2)Constructor for decoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdecode(ByteSupplier s)Assuming that the basic time unit is second, return the number of milliseconds.longdecodeRaw(ByteSupplier s)Decodes the time in the highest available resolution.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.tctm.TimeDecoder
decode, decodeRaw
-
-
-
-
Constructor Detail
-
CucTimeDecoder
public CucTimeDecoder(int pfield1)
-
CucTimeDecoder
public CucTimeDecoder(int pfield1, int pfield2)Constructor for decoder.- Parameters:
pfield1- first octet of the pfield -1 means is part of the packet, other values means it is pre-defined (implicit)pfield2- second octet of the pfield - used if the first bit of pfield1 (seen as one byte) is 1
-
-
Method Detail
-
decode
public long decode(ByteSupplier s)
Assuming that the basic time unit is second, return the number of milliseconds.- Specified by:
decodein interfaceTimeDecoder- Parameters:
s- - the bytes will be read from here.- Returns:
- time in milliseconds
-
decodeRaw
public long decodeRaw(ByteSupplier s)
Decodes the time in the highest available resolution.If the length of the basicTime and fractional time is greater than 8, an exception is thrown.
- Specified by:
decodeRawin interfaceTimeDecoder- Parameters:
s- - the bytes will be read from here.- Returns:
- time
-
-