![]() |
COSMOS core
1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
|
Functions | |
| int32_t | slip_check_crc (uint8_t *sbuf, uint16_t ssize) |
| Check SLIP packet CRC. More... | |
| int32_t | slip_check_crc (slip_t &sbuf) |
| int32_t | slip_unpack (uint8_t *sbuf, uint16_t ssize, uint8_t *rbuf, uint16_t rsize) |
| Unpack SLIP packet. More... | |
| int32_t | slip_unpack (slip_t &sbuf, slip_t &rbuf) |
| int32_t | slip_decode (uint8_t *sbuf, uint16_t ssize, uint8_t *rbuf, uint16_t rsize) |
| Decode SLIP packet. More... | |
| int32_t | slip_decode (slip_t &sbuf, slip_t &rbuf) |
| int32_t | slip_encode (uint8_t *rbuf, uint16_t rsize, uint8_t *sbuf, uint16_t ssize) |
| Encode data in to SLIP packet. More... | |
| int32_t | slip_encode (slip_t &rbuf, slip_t &sbuf) |
| int32_t | slip_pack (uint8_t *rbuf, uint16_t rsize, uint8_t *sbuf, uint16_t ssize) |
| Pack data in to SLIP packet. More... | |
| int32_t | slip_pack (slip_t &rbuf, slip_t &sbuf) |
| uint16_t | slip_calc_crc (uint8_t *buf, uint16_t size) |
| Calculate CRC-16-CCITT. More... | |
| uint16_t | slip_calc_crc (slip_t &buf) |
| uint16_t | slip_get_crc (uint8_t *buf, uint16_t index) |
| Get CRC from SLIP buffer. More... | |
| uint16_t | slip_get_crc (slip_t &buf) |
| uint16_t | slip_set_crc (uint8_t *buf, uint16_t index) |
| Set CRC for SLIP buffer. More... | |
| uint16_t | slip_set_crc (slip_t &buf) |
| int32_t slip_check_crc | ( | uint8_t * | sbuf, |
| uint16_t | ssize | ||
| ) |
Check SLIP packet CRC.
Get the CRC from the end of a SLIP packet and check it against the calculated CRC.
| sbuf | Pointer to buffer containing SLIP encoded data plus CRC. |
| ssize | Total size of buffer, including CRC. |
| int32_t slip_check_crc | ( | slip_t & | sbuf | ) |
| int32_t slip_unpack | ( | uint8_t * | sbuf, |
| uint16_t | ssize, | ||
| uint8_t * | rbuf, | ||
| uint16_t | rsize | ||
| ) |
Unpack SLIP packet.
Convert SLIP data in one buffer to raw ASCII data in second buffer and return length.
| sbuf | character buffer to read SLIP data from |
| ssize | size of SLIP buffer |
| rbuf | character buffer to store raw data |
| rsize | size of raw buffer, including terminal 0 |
| int32_t slip_decode | ( | uint8_t * | sbuf, |
| uint16_t | ssize, | ||
| uint8_t * | rbuf, | ||
| uint16_t | rsize | ||
| ) |
Decode SLIP packet.
Convert SLIP data in one buffer to raw ASCII data in second buffer and return length.
| sbuf | character buffer to read SLIP data from |
| ssize | size of SLIP buffer |
| rbuf | character buffer to store raw data |
| rsize | size of raw buffer, including terminal 0 |
| int32_t slip_encode | ( | uint8_t * | rbuf, |
| uint16_t | rsize, | ||
| uint8_t * | sbuf, | ||
| uint16_t | ssize | ||
| ) |
Encode data in to SLIP packet.
Convert raw ASCII in one buffer to SLIP encoded data in second buffer.
| rbuf | Buffer with raw data |
| rsize | Number of bytes in raw buffer |
| sbuf | Buffer to place SLIP data in |
| ssize | Maximum size of SLIP buffer |
| int32_t slip_pack | ( | uint8_t * | rbuf, |
| uint16_t | rsize, | ||
| uint8_t * | sbuf, | ||
| uint16_t | ssize | ||
| ) |
Pack data in to SLIP packet.
Convert raw ASCII in one buffer to SLIP encoded data in second buffer, appending a 16 bit CCITT CRC.
| rbuf | Buffer with raw data |
| rsize | Number of bytes in raw buffer |
| sbuf | Buffer to place SLIP data in |
| ssize | Maximum size of SLIP buffer |
| uint16_t slip_calc_crc | ( | uint8_t * | buf, |
| uint16_t | size | ||
| ) |
Calculate CRC-16-CCITT.
Calculate 16-bit CCITT CRC for the indicated buffer and number of bytes. The initial shift register value is 0xffff, and the calculation starts with the LSB, so the Polynomial is 0x8408.
| buf | bytes to calculate on |
| size | number of bytes |
| uint16_t slip_calc_crc | ( | slip_t & | buf | ) |
| uint16_t slip_get_crc | ( | uint8_t * | buf, |
| uint16_t | index | ||
| ) |
Get CRC from SLIP buffer.
Extract the CRC from the specified point in a SLIP buffer and return it as an unsigned integer.
| buf | SLIP buffer |
| index | Location in buffer of start of CRC |
| uint16_t slip_get_crc | ( | slip_t & | buf | ) |
| uint16_t slip_set_crc | ( | uint8_t * | buf, |
| uint16_t | index | ||
| ) |
Set CRC for SLIP buffer.
Calculate the CRC for the specified length SLIP buffer and append it to the buffer.
| buf | SLIP buffer |
| index | Location in buffer of start of CRC |
| uint16_t slip_set_crc | ( | slip_t & | buf | ) |