protocol
ccsds_time_code_protocol
CCSDS time code parser and generator protocol.
Availability:
logtalk_load(ccsds_time_codes(loader))Author: Paulo Moura
Version: 1:0:0
Date: 2026-05-08
Compilation flags:
staticDependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)
Public predicates
parse/2
Parses a CCSDS time code from a source term. Supported source terms are file(File), stream(Stream), and bytes(Bytes).
Compilation flags:
staticTemplate:
parse(Source,TimeCode)Mode and number of proofs:
parse(+compound,-compound) - one_or_errorExceptions:
Source is a variable:instantiation_errorSource is neither a variable nor a valid source:domain_error(ccsds_time_code_source,Source)Source contents are not a valid encoding for the selected time code object:domain_error(ccsds_time_code_byte_sequence,Bytes)generate/2
Generates a CCSDS time code to a sink term. Supported sink terms are file(File), stream(Stream), and bytes(Bytes).
Compilation flags:
staticTemplate:
generate(Sink,TimeCode)Mode and number of proofs:
generate(+compound,+compound) - one_or_errorExceptions:
Sink is a variable:instantiation_errorSink is neither a variable nor a valid sink:domain_error(ccsds_time_code_sink,Sink)TimeCode is neither a variable nor a valid time code term for the selected object:domain_error(ccsds_time_code_term,TimeCode)generate/3
Generates a list of bytes from a CCSDS time code term with an open tail. Mainly used when generating arbitrary values.
Compilation flags:
staticTemplate:
generate(TimeCode,Bytes,Tail)Mode and number of proofs:
generate(+compound,-list(byte),--variable) - one_or_errorExceptions:
TimeCode is a variable:instantiation_errorTimeCode is neither a variable nor a valid time code term for the selected object:domain_error(ccsds_time_code_term,TimeCode)valid/1
True if the argument is a valid time code term for the selected object.
Compilation flags:
staticTemplate:
valid(TimeCode)Mode and number of proofs:
valid(@compound) - zero_or_oneformat/1
Returns the CCSDS time code format handled by the object.
Compilation flags:
staticTemplate:
format(Format)Mode and number of proofs:
format(-atom) - oneepoch/1
Returns the epoch used by the object.
Compilation flags:
staticTemplate:
epoch(Epoch)Mode and number of proofs:
epoch(-atom) - oneunix_seconds/2
Converts a time code term into a Unix timestamp in seconds.
Compilation flags:
staticTemplate:
unix_seconds(TimeCode,Seconds)Mode and number of proofs:
unix_seconds(+compound,-number) - one_or_errorExceptions:
TimeCode is a variable:instantiation_errorTimeCode is neither a variable nor a valid time code term for the selected object:domain_error(ccsds_time_code_term,TimeCode)from_unix_seconds/2
Converts a Unix timestamp in seconds into a time code term for the selected object.
Compilation flags:
staticTemplate:
from_unix_seconds(Seconds,TimeCode)Mode and number of proofs:
from_unix_seconds(+number,-compound) - one_or_errorExceptions:
Seconds is a variable:instantiation_errorSeconds cannot be represented using the selected object:domain_error(ccsds_time_code_unix_seconds,Seconds)Protected predicates
(none)
Private predicates
(none)
Operators
(none)