Code Monkey home page Code Monkey logo

ccsds-spacepacket's Introduction

CCSDS Space Packet Protocol

Crates.io Crates.io (recent)

This is a rust implementation of the CCSDS Space Packet Protocol.

About the Protocol

Space Packet Protocol is a standardized packet protocol for use in aerospace applications that was developed by a consortium of major space agencies including NASA, JAXA, ESA, and others.

Space Packet Protocol defines three major segments, a Primary Header, a Secondary Header, and a Payload.

The Primary Header is set by the standard and includes things fields for versioning, identifiers, sequence counters, flags, and the data length of the packet.

The Secondary Header is left as a space where an organisation can specify their own custom header values before passing the final spec on to contractors or projects for implementation.

The Payload is also left unspecified and can contain pretty much any data, such as files or other packets.

The Secondary Header and Payload make up the "User Data Field" and at least one of these two components must be present in all Space Packets.

What this library does

This library attempts to implement a general-purpose parser for Space Packets that can interperet both the generic aspects of the space packet protocol (i.e. the Primary Header) in addition to any custom fields supplied within the Secondary Headers.

This Secondary Header parsing is accomplished by allowing users of the library to pass in a parser that can interperet the Secondary Header as specified by their project or organisation.

Current status

Currently this library just implements Primary Header parsing, but expanding it to be able to deal with a complete, generic spacepacket (think of generics in programming) with user defined custom secondary headers is one of the projects main goals.

Usage

	// say you have some bytes you want to turn into a PrimaryHeader
	let raw = b"\x00\x00\xc0\x00\x00\x40\xff\xff";

	let expected = PrimaryHeader {
		version: 0,
		packet_type: types::PacketType::Data,
		sec_header_flag: types::SecondaryHeaderFlag::NotPresent,
		app_proc_id: 0,
		sequence_flags: types::SeqFlag::Unsegmented,
		sequence_count: 0,
		data_length: 64,
	};

	// do the parsing and save the parsed header and any remaining bytes
	let (rest, parsed) = PrimaryHeader::from_bytes((raw, 0)).expect("failed to parse header");

	assert_eq!(parsed, expected);
	assert_eq!(rest.0, [255,255])

ccsds-spacepacket's People

Contributors

adminixtrator avatar jtt9340 avatar moralcode avatar wcampbell0x2a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ccsds-spacepacket's Issues

Add Documentation for docs.rs

Need to add thorough documentation and examples in whatever format is needed to show up on docs.rs, particularly for setting up custom secondary headers and how you would add custom stuff like calculating CRCs for a message.

Add new crates.io aerospace categories

Thanks to @elpiel of the AeroRust comminity, new categories for aerospace apps have been approved to add to crates.io.

Once these have been merged into crates.io, we should update this crate to use the relevant categories

Publish to crates.io

What will it take to get this to a reasonable state to publish on crates.io?

i think #1 is probably a good start, and possibly also documenting that this is so far just a primary header parser, not a full spacepacket parser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.