|
CCSDSPack
C++ Library for CCSDS Space Packet manipulation. i.e. generation, extraction, analisys and more
|
Go to the source code of this file.
Functions | |
| uint16_t | crc16 (const std::vector< std::uint8_t > &data, std::uint16_t polynomial=0x1021, std::uint16_t initialValue=0xFFFF, std::uint16_t finalXorValue=0x0000) |
| Computes the CRC-16 checksum for a given data vector with configurable parameters. | |
| bool | stringEndsWith (const std::string &str, const std::string &suffix) |
| Tests if str ends with suffix. | |
| void | printPacket (CCSDS::Packet &packet) |
| Prints to console a CCSDS Packets, breaking it down to Primary header and Data field. | |
| void | printPackets (CCSDS::Manager &manager) |
| Prints to console a series of CCSDS Packets contained in the manager. | |
| std::string | getBinaryString (std::uint32_t value, std::int32_t bits) |
| Converts a given value to its binary representation as a string, with spaces every 4 bits. | |
| std::string | getBitsSpaces (std::int32_t num) |
| Generates a string of spaces for formatting binary outputs. | |
| void | printBufferData (const std::vector< std::uint8_t > &buffer, std::int32_t limitBytes=20) |
| Prints to console the HEX data from the bytes vector. | |
| void | printData (CCSDS::DataField dataField) |
| Prints the data field details, including the secondary header and application data. | |
| void | printHeader (CCSDS::Header &header) |
| Prints the header fields and their binary or hexadecimal representations. | |
| CCSDS::ResultBool | printPrimaryHeader (CCSDS::Packet &packet) |
| Prints to console the primary header of a provided CCSDS packet. | |
| void | printDataField (CCSDS::Packet &packet) |
| Prints the data field and the CRC-16 checksum of the packet. | |
| CCSDS::ResultBool | writeBinaryFile (const std::vector< std::uint8_t > &data, const std::string &filename) |
| This function takes in a buffer of data and a file name. | |
| CCSDS::ResultBuffer | readBinaryFile (const std::string &filename) |
| Read a specified binary file and return its contents as a buffer. | |
| bool | fileExists (const std::string &fileName) |
| filesystem check fore file existence prepared for both windows and linux. | |
| uint16_t crc16 | ( | const std::vector< std::uint8_t > & | data, |
| std::uint16_t | polynomial = 0x1021, |
||
| std::uint16_t | initialValue = 0xFFFF, |
||
| std::uint16_t | finalXorValue = 0x0000 |
||
| ) |
Computes the CRC-16 checksum for a given data vector with configurable parameters.
| data | A vector of bytes to compute the checksum for. |
| polynomial | The polynomial used for the CRC calculation (default: CCSDS CRC-16 polynomial 0x1021). |
| initialValue | The initial value of the CRC register (default: 0xFFFF). |
| finalXorValue | The final XOR value applied to the CRC result (default: 0x0000). |
Definition at line 17 of file CCSDSUtils.cpp.
| bool fileExists | ( | const std::string & | fileName | ) |
filesystem check fore file existence prepared for both windows and linux.
| fileName | std::string |
Definition at line 237 of file CCSDSUtils.cpp.
| std::string getBinaryString | ( | std::uint32_t | value, |
| std::int32_t | bits | ||
| ) |
Converts a given value to its binary representation as a string, with spaces every 4 bits.
| value | The 32-bit integer value to convert. |
| bits | The number of significant bits to include in the binary string. |
Definition at line 43 of file CCSDSUtils.cpp.
| std::string getBitsSpaces | ( | std::int32_t | num | ) |
Generates a string of spaces for formatting binary outputs.
| num | The number of spaces required. |
num. Definition at line 59 of file CCSDSUtils.cpp.
| void printBufferData | ( | const std::vector< std::uint8_t > & | buffer, |
| std::int32_t | limitBytes = 20 |
||
| ) |
Prints to console the HEX data from the bytes vector.
| buffer | |
| limitBytes |
Definition at line 69 of file CCSDSUtils.cpp.
| void printData | ( | CCSDS::DataField | dataField | ) |
Prints the data field details, including the secondary header and application data.
Outputs information about the presence of a secondary header and the content of both the secondary header and the application data in hexadecimal format.
Definition at line 87 of file CCSDSUtils.cpp.
| void printDataField | ( | CCSDS::Packet & | packet | ) |
Prints the data field and the CRC-16 checksum of the packet.
Outputs the content of the data field and the CRC-16 checksum in hexadecimal format to the standard output.
Definition at line 170 of file CCSDSUtils.cpp.
| void printHeader | ( | CCSDS::Header & | header | ) |
Prints the header fields and their binary or hexadecimal representations.
Outputs all relevant header fields, including the full primary header, version number, type, data field header flag, APID, sequence flags, sequence count, and data length. Each field is displayed with appropriate formatting and spacing.
Definition at line 109 of file CCSDSUtils.cpp.
| void printPacket | ( | CCSDS::Packet & | packet | ) |
Prints to console a CCSDS Packets, breaking it down to Primary header and Data field.
| packet |
Definition at line 179 of file CCSDSUtils.cpp.
| void printPackets | ( | CCSDS::Manager & | manager | ) |
Prints to console a series of CCSDS Packets contained in the manager.
| manager |
Definition at line 184 of file CCSDSUtils.cpp.
| CCSDS::ResultBool printPrimaryHeader | ( | CCSDS::Packet & | packet | ) |
Prints to console the primary header of a provided CCSDS packet.
| packet |
Definition at line 163 of file CCSDSUtils.cpp.
| CCSDS::ResultBuffer readBinaryFile | ( | const std::string & | filename | ) |
Read a specified binary file and return its contents as a buffer.
| filename |
Definition at line 219 of file CCSDSUtils.cpp.
| bool stringEndsWith | ( | const std::string & | str, |
| const std::string & | suffix | ||
| ) |
Tests if str ends with suffix.
equivalent to endsWith(str) in c++20
| str | string |
| suffix | string |
Definition at line 38 of file CCSDSUtils.cpp.
| CCSDS::ResultBool writeBinaryFile | ( | const std::vector< std::uint8_t > & | data, |
| const std::string & | filename | ||
| ) |
This function takes in a buffer of data and a file name.
and writes the data in binary form to the file.
| data | vector of std::uint8_t |
| filename | string |
Definition at line 205 of file CCSDSUtils.cpp.