The Logtalk Handbook Logo
3.100.0

Contents

  • User Manual
  • Reference Manual
  • Tutorial
  • FAQ
  • Developer Tools
  • Libraries
    • Overview
    • adaptive_boosting_classifier
    • agglomerative_clusterer
    • amqp
    • anomaly_detection_protocols
    • application
    • apriori_pattern_miner
    • arbitrary
    • arrangements
    • assignvars
    • avro
    • base32
    • base58
    • base64
    • base85
    • basic_types
    • bayesian_ridge_regression
    • borda_ranker
    • bradley_terry_ranker
    • c45_classifier
    • cartesian_products
    • cbor
    • character_sets
    • ccsds_frames
    • ccsds_link_profiles
      • Representation
      • Public API
      • Parsing and generating
      • Packet helpers
      • API documentation
      • Loading
      • Testing
    • ccsds_packet_services
    • ccsds_packetization
    • ccsds_packets
    • ccsds_tc_services
    • ccsds_time_codes
    • ccsds_time_fields
    • classification_protocols
    • clo_span_pattern_miner
    • clustering_protocols
    • colley_ranker
    • combinations
    • command_line_options
    • core
    • copeland_ranker
    • coroutining
    • crs_projections
    • csv
    • cuid2
    • cusum_anomaly_detector
    • datalog
    • dates
    • dates_tz
    • dbscan_clusterer
    • dependents
    • deques
    • derangements
    • dictionaries
    • dif
    • dimension_reduction_protocols
    • eclat_pattern_miner
    • edcg
    • elastic_net_regression
    • elo_ranker
    • events
    • ewma_anomaly_detector
    • expand_library_alias_paths
    • expecteds
    • format
    • fp_growth_pattern_miner
    • frequent_pattern_mining_protocols
    • gaussian_mixture_clusterer
    • gaussian_process_regression
    • genint
    • gensym
    • geojson
    • geospatial
    • git
    • glicko2_ranker
    • glicko2_periodic_ranker
    • gradient_boosting_classifier
    • gradient_boosting_regression
    • grammars
    • graphs
    • gsp_pattern_miner
    • hashes
    • hdbscan_clusterer
    • heaps
    • hierarchical_clustering
    • hierarchies
    • hmac
    • hodge_rank
    • hook_flows
    • hook_objects
    • html
    • ica_projection
    • ids
    • ieee_754
    • intervals
    • iqr_anomaly_detector
    • iso_639
    • iso_3166
    • iso_4217
    • iso_9362
    • iso_13616
    • isolation_forest_anomaly_detector
    • java
    • json
    • json_ld
    • json_lines
    • json_pointer
    • json_rpc
    • json_schema
    • kcenters_clusterer
    • kemeny_young_ranker
    • kernel_svm_classifier
    • kernel_pca_projection
    • kmeans_clusterer
    • kmedians_clusterer
    • kmedoids_clusterer
    • kmodes_clusterer
    • knn_classifier
    • knn_distance_anomaly_detector
    • knn_regression
    • kprototypes_clusterer
    • ksuid
    • lasso_regression
    • lda_classifier
    • lda_projection
    • linda
    • linear_algebra
    • linear_regression
    • linear_svm_classifier
    • listing
    • lof_anomaly_detector
    • logging
    • logistic_regression_classifier
    • loops
    • massey_ranker
    • mcp_server
    • memcached
    • message_pack
    • meta
    • meta_compiler
    • mime_types
    • modified_z_score_anomaly_detector
    • mutations
    • multisets
    • nanoid
    • naive_bayes_classifier
    • nearest_centroid_classifier
    • nested_dictionaries
    • Raw Sentence Representation
    • Typed data/2 Results
    • Date Rule
    • Current Scope
    • nmf_projection
    • optics_clusterer
    • optionals
    • options
    • os
    • partitions
    • pattern_mining_protocols
    • pca_projection
    • permutations
    • plackett_luce_ranker
    • plackett_luce_last_ranker
    • pls_projection
    • prefix_span_pattern_miner
    • probabilistic_pca_projection
    • process
    • protobuf
    • qda_classifier
    • queues
    • random
    • random_forest_classifier
    • random_forest_regression
    • random_projection
    • rank_centrality
    • ranked_pairs
    • ranking_protocols
    • reader
    • recorded_database
    • redis
    • regression_protocols
    • regression_tree
    • regularized_bradley_terry_ranker
    • ridge_regression
    • schulze_ranker
    • sequential_pattern_mining_protocols
    • sets
    • sgd_classifier
    • snowflakeid
    • sockets
    • spade_pattern_miner
    • simulated_annealing
    • statistics
    • stemming
    • stomp
    • string_distance
    • strings
    • subsequences
    • term_io
    • thurstone_mosteller_ranker
    • time_scales
    • timeout
    • tle_orbits
    • toml
    • toon
    • truncated_svd_projection
    • tsv
    • types
    • tzif
    • ulid
    • unicode_data
    • union_find
    • url
    • uuid
    • validations
    • wkt_wkb
    • yaml
    • z_score_anomaly_detector
    • zippers
  • Ports
  • Contributions
  • Glossary
  • Bibliography
  • Index

External Contents

  • APIs
  • Logtalk website
  • GitHub repo
The Logtalk Handbook
  • Libraries
  • ccsds_link_profiles
  • Edit on GitHub

ccsds_link_profiles

The ccsds_link_profiles library provides an ergonomic wrapper layer over the existing parametric CCSDS frame objects.

Instead of selecting one of the raw ccsds_tm_frames(...), ccsds_tc_frames(...), or ccsds_aos_frames(...) objects directly at each call site, callers can work with explicit profile terms and generic wrapper predicates.

Representation

Link profiles are represented using the compound terms:

tm_profile(FrameLength, SecondaryHeaderLength, HasFECF)
tc_profile(FrameLength, SegmentHeaderLength, HasFECF)
aos_profile(FrameLength, InsertZoneLength, HasOCF, HasFECF)

Where:

  • FrameLength is the fixed frame length in octets

  • SecondaryHeaderLength, SegmentHeaderLength, and InsertZoneLength are the mission-profile field lengths in octets

  • HasOCF and HasFECF are the atoms true or false

Public API

The current implementation provides the predicates:

  • valid_profile/1

  • parse_frame/3

  • parse_frames/3

  • generate_frame/3

  • generate_frames/3

  • valid_reassembly_state/1

  • initial_reassembly_state/1

  • pending_fragments/2

  • valid_discontinuity_policy/1

  • extract_packets/4

  • insert_packets/5

  • reassemble_packets/6-8

  • reassemble_frames/6-8

Parsing and generating

To parse exactly one telemetry transfer frame using a profile term:

| ?- ccsds_link_profiles::parse_frame(bytes([0x02, 0xA7, 0x10, 0x20, 0x18, 0x00, 1, 2, 3, 4, 5, 6, 0xDE, 0xAD, 0xBE, 0xEF]), tm_profile(16, 0, false), Frame).

To generate a telecommand transfer frame using a profile term:

| ?- ccsds_link_profiles::generate_frame(bytes(Bytes), tc_profile(10, 0, true), tc_transfer_frame(0, 1, 0, 42, 3, 7, none, [1,2,3], fecf([0x44,0x6D]))).

parse_frame/3 expects the source to contain exactly one frame. If the source contains zero frames or more than one frame, the predicate throws a domain_error(ccsds_single_frame_source, Source) exception.

Parsing and generation inherit FECF verification and regeneration from the underlying TM, TC, and AOS frame objects selected by the profile.

To parse or generate multi-frame sources and sinks, use parse_frames/3 and generate_frames/3.

Packet helpers

Packet extraction and insertion are provided for TM and AOS profiles using the high-level packet-zone semantics from ccsds_packet_services:

| ?- ccsds_link_profiles::extract_packets(tm_profile(18, 0, false), 0, tm_transfer_frame(0, 42, 3, 0, 16, 32, 0, 0, 0, 3, 2, none, [0xAA,0xBB,0x08,0x01,0xC0,0x00,0x00,0x03,0xDE,0xAD,0xBE,0xEF], none, none), PacketZone).

| ?- ccsds_link_profiles::insert_packets(aos_profile(20, 0, false, false), 0, packet_zone([0xAA,0xBB], [ccsds_packet(0, 0, 1, 1, 3, 0, none, [0xDE,0xAD,0xBE,0xEF])], []), aos_transfer_frame(1, 42, 3, 0x123456, signaling_field(1, 0, 0, 0), none, [0,0,0,0,0,0,0,0,0,0,0,0,0,0], none, none), UpdatedFrame).

For cross-frame TM and AOS packet reconstruction, initialize a reassembly state and call the generic profile wrapper predicates:

| ?- ccsds_link_profiles::initial_reassembly_state(State), ccsds_link_profiles::reassemble_frames(tm_profile(16, 0, false), 0, Frames, resynchronize, State, Packets, UpdatedState).

Telecommand profiles are intentionally rejected by extract_packets/4 and insert_packets/5, reassemble_packets/6-8, and reassemble_frames/6-8, which throw a domain_error(ccsds_packet_link_profile, tc_profile(...)) exception.

API documentation

Open the ../../apis/library_index.html#ccsds_link_profiles link in a web browser.

Loading

To load all entities in this library, load the loader.lgt file:

| ?- logtalk_load(ccsds_link_profiles(loader)).

Testing

To test this library predicates, load the tester.lgt file:

| ?- logtalk_load(ccsds_link_profiles(tester)).
Previous Next

© Copyright 1998-2026, Paulo Moura.

Built with Sphinx using a theme provided by Read the Docs.