-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from robamu-org/develop
PR for release 0.4.0
- Loading branch information
Showing
31 changed files
with
1,410 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Examples | ||
========= | ||
|
||
You can find all examples listed here in the ``example`` folder of the project as well. | ||
|
||
ECSS PUS packets | ||
----------------- | ||
|
||
This examples shows how to generate PUS packets using the PUS ping telecommand and a PUS | ||
ping telemetry reply. | ||
|
||
.. code-block:: | ||
from spacepackets.ecss.tc import PusTelecommand | ||
from spacepackets.ecss.tm import PusTelemetry | ||
from spacepackets.util import get_printable_data_string, PrintFormats | ||
def main(): | ||
ping_cmd = PusTelecommand( | ||
service=17, | ||
subservice=1, | ||
apid=0x01 | ||
) | ||
cmd_as_bytes = ping_cmd.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=cmd_as_bytes) | ||
print(f'Ping telecommand [17,1]: {print_string}') | ||
ping_reply = PusTelemetry( | ||
service=17, | ||
subservice=2, | ||
apid=0x01 | ||
) | ||
tm_as_bytes = ping_reply.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=tm_as_bytes) | ||
print(f'Ping reply [17,2]: {print_string}') | ||
if __name__ == "__main__": | ||
main() | ||
CCSDS Space Packet | ||
------------------- | ||
|
||
This example shows how to generate a generic CCSDS Space Packet Header | ||
|
||
.. code-block:: | ||
from spacepackets.ccsds.spacepacket import SpacePacketHeader, PacketTypes | ||
from spacepackets.util import get_printable_data_string, PrintFormats | ||
def main(): | ||
spacepacket_header = SpacePacketHeader( | ||
packet_type=PacketTypes.TC, | ||
apid=0x01, | ||
source_sequence_count=0, | ||
data_length=0 | ||
) | ||
header_as_bytes = spacepacket_header.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=header_as_bytes) | ||
print(f'Space packet header: {print_string}') | ||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from spacepackets.ecss.tc import PusTelecommand | ||
from spacepackets.ecss.tm import PusTelemetry | ||
from spacepackets.util import get_printable_data_string, PrintFormats | ||
|
||
|
||
def main(): | ||
ping_cmd = PusTelecommand( | ||
service=17, | ||
subservice=1, | ||
apid=0x01 | ||
) | ||
cmd_as_bytes = ping_cmd.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=cmd_as_bytes) | ||
print(f'Ping telecommand [17,1]: {print_string}') | ||
|
||
ping_reply = PusTelemetry( | ||
service=17, | ||
subservice=2, | ||
apid=0x01 | ||
) | ||
tm_as_bytes = ping_reply.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=tm_as_bytes) | ||
print(f'Ping reply [17,2]: {print_string}') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from spacepackets.ccsds.spacepacket import SpacePacketHeader, PacketTypes | ||
from spacepackets.util import get_printable_data_string, PrintFormats | ||
|
||
|
||
def main(): | ||
spacepacket_header = SpacePacketHeader( | ||
packet_type=PacketTypes.TC, | ||
apid=0x01, | ||
source_sequence_count=0, | ||
data_length=0 | ||
) | ||
header_as_bytes = spacepacket_header.pack() | ||
print_string = get_printable_data_string(print_format=PrintFormats.HEX, data=header_as_bytes) | ||
print(f'Space packet header: {print_string}') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.