Artemis Teensy Flight Software
The software on the Teensy in the Artemis cubesat.
Cosmos::Support::PacketComm Class Reference

Classes

struct  CCSDS_Header
 
struct  CommunicateHeader
 
struct  CommunicateResponseHeader
 
struct  FileChunkData
 
struct  Header
 
struct  ResponseHeader
 
struct  TestHeader
 

Public Types

enum class  TypeId : uint16_t {
  Blank = 0 , DataObc = 0x100 , DataObcBeacon = 0x101 , DataObcPong = 0x102 ,
  DataObcResponse = 0x103 , DataObcTime = 0x104 , DataObcNop = 0x17f , CommandObc = 0x180 ,
  CommandObcReset = 0x181 , CommandObcReboot = 0x182 , CommandObcPing = 0x183 , CommandObcSetTime = 0x184 ,
  CommandObcGetTimeHuman = 0x185 , CommandObcGetTimeBinary = 0x186 , CommandObcExternalCommand = 0x187 , CommandObcExternalTask = 0x188 ,
  CommandObcInternalRequest = 0x189 , CommandObcSendBeacon = 0x18a , CommandObcHalt = 0x18b , CommandObcNop = 0x1ff ,
  DataEps = 0x200 , DataEpsResponse = 0x201 , CommandEps = 0x280 , CommandEpsCommunicate = 0x281 ,
  CommandEpsSwitchName = 0x282 , CommandEpsSwitchNumber = 0x283 , CommandEpsReset = 0x284 , CommandEpsState = 0x285 ,
  CommandEpsWatchdog = 0x286 , CommandEpsSetTime = 0x287 , CommandEpsMinimumPower = 0x288 , CommandEpsSwitchNames = 0x289 ,
  CommandEpsSwitchStatus = 0x28a , DataAdcs = 0x300 , DataAdcsResponse = 0x301 , CommandAdcs = 0x380 ,
  CommandAdcsCommunicate = 0x381 , CommandAdcsState = 0x382 , CommandAdcsSetRunMode = 0x383 , CommandAdcsGetAdcsState = 0x384 ,
  CommandAdcsOrbitParameters = 0x385 , DataFile = 0x400 , DataFileCommand = 0x401 , DataFileMessage = 0x402 ,
  DataFileQueue = 0x403 , DataFileCancel = 0x404 , DataFileComplete = 0x405 , DataFileReqMeta = 0x406 ,
  DataFileReqData = 0x407 , DataFileMetaData = 0x408 , DataFileChunkData = 0x409 , DataFileReqComplete = 0x40a ,
  CommandFile = 0x480 , CommandFileListDirectory = 0x481 , CommandFileTransferFile = 0x482 , CommandFileTransferNode = 0x483 ,
  CommandFileTransferRadio = 0x484 , CommandFileTransferList = 0x485 , DataExec = 0x500 , CommandExec = 0x580 ,
  CommandExecClearQueue = 0x581 , CommandExecSetOpsMode = 0x582 , CommandExecEnableChannel = 0x583 , CommandExecLoadCommand = 0x584 ,
  CommandExecAddCommand = 0x585 , DataRadio = 0x700 , DataRadioTest = 0x701 , DataRadioResponse = 0x702 ,
  CommandRadio = 0x780 , CommandRadioTest = 0x781 , CommandRadioCommunicate = 0x782 , CommandRadioAstrodevCommunicate = 0x783 ,
  DataCamera = 0x800 , CommandCamera = 0x880 , CommandCameraOn = 0x881 , CommandCameraCapture = 0x882
}
 
enum class  PacketStyle : uint8_t { None , Minimal , V2 }
 
using AdcsResponseHeader = CommunicateResponseHeader
 
using EpsResponseHeader = CommunicateResponseHeader
 
using RadioResponseHeader = CommunicateResponseHeader
 

Public Member Functions

 PacketComm (uint16_t size=4)
 
void Invert (vector< uint8_t > &data)
 
void CalcCRC ()
 
bool CheckCRC ()
 
int32_t Unwrap (bool checkcrc=true)
 
int32_t Unwrap (bool checkcrc, bool minimal_header)
 
int32_t RawUnPacketize (bool invert=false, bool checkcrc=true)
 
int32_t RawUnPacketize (bool invert, bool checkcrc, bool minimal_header)
 
bool ASMUnPacketize ()
 
bool ASMUnPacketize (bool checkcrc, bool descramble)
 
bool SLIPUnPacketize (bool checkcrc=true)
 
bool HDLCUnPacketize (bool checkcrc=true)
 
bool AX25UnPacketize (bool checkcrc=true)
 
bool Wrap ()
 Wrap up header and payload Merge Cosmos::Support::PacketComm::data and ::Cosmos::Support::PacketComm::header into ::Cosmos::Support::PacketComm::wrapped. More...
 
bool Wrap (bool calc_checksum)
 Wrap up header and payload Merge Cosmos::Support::PacketComm::data and ::Cosmos::Support::PacketComm::header into ::Cosmos::Support::PacketComm::wrapped. More...
 
bool RawPacketize ()
 
bool ASMPacketize ()
 
bool ASMPacketize (uint16_t packet_wrapped_size, bool scramble)
 Pads packetized packets to specified size. More...
 
bool AX25Packetize (string dest_call="", string sour_call="", uint8_t flagcount=2, uint8_t dest_stat=0x60, uint8_t sour_stat=0x61, uint8_t cont=0x03, uint8_t prot=0xf0)
 
bool HDLCPacketize (uint8_t flagcount=10)
 
bool SLIPPacketize ()
 

Public Attributes

std::map< TypeId, string > TypeString
 
std::map< string, TypeId > StringType
 
struct Cosmos::Support::PacketComm::Header header
 
CCSDS_Header ccsds_header
 
vector< uint8_t > packetized
 
vector< uint8_t > wrapped
 
vector< uint8_t > data
 Data of interest.
 
uint16_t crc
 
PacketStyle style = PacketStyle::V2
 
vector< uint8_t > atsm = {0x1a, 0xcf, 0xfc, 0x1d}
 
vector< uint8_t > atsmr = {0x58, 0xf3, 0x3f, 0xb8}
 
vector< uint8_t > satsm = {0x35, 0x2e, 0xf8, 0x53}
 
CRC16 calc_crc
 

Member Function Documentation

◆ ASMPacketize()

bool Cosmos::Support::PacketComm::ASMPacketize ( uint16_t  packet_wrapped_size,
bool  scramble 
)

Pads packetized packets to specified size.

Parameters
packet_wrapped_sizeSize to stuff a packet up to for fixed-sized requirements

◆ Unwrap()

int32_t Cosmos::Support::PacketComm::Unwrap ( bool  checkcrc,
bool  minimal_header 
)
Parameters
checkcrcPerform crc check validation
Returns
Data size on success, negative on error

◆ Wrap() [1/2]

bool Cosmos::Support::PacketComm::Wrap ( )

Wrap up header and payload Merge Cosmos::Support::PacketComm::data and ::Cosmos::Support::PacketComm::header into ::Cosmos::Support::PacketComm::wrapped.

Returns
Boolean success

◆ Wrap() [2/2]

bool Cosmos::Support::PacketComm::Wrap ( bool  calc_checksum)

Wrap up header and payload Merge Cosmos::Support::PacketComm::data and ::Cosmos::Support::PacketComm::header into ::Cosmos::Support::PacketComm::wrapped.

Parameters
calc_checksumIf false, skips crc calculation
Returns
Boolean success

The documentation for this class was generated from the following files: