tc_acceptance.h
44 lines
| 1.3 KiB
| text/x-c
|
CLexer
/ header / tc_acceptance.h
paul
|
r45 | #ifndef TC_ACCEPTANCE_H_INCLUDED | ||
#define TC_ACCEPTANCE_H_INCLUDED | ||||
#include "fsw_params.h" | ||||
paul
|
r318 | #define BIT_0 0x01 | ||
#define BIT_1 0x02 | ||||
#define BIT_2 0x04 | ||||
#define BIT_3 0x08 | ||||
#define BIT_4 0x10 | ||||
#define BIT_5 0x20 | ||||
#define BIT_6 0x40 | ||||
#define BIT_7 0x80 | ||||
#define CONST_CRC_0 0x1021 | ||||
#define CONST_CRC_1 0x2042 | ||||
#define CONST_CRC_2 0x4084 | ||||
#define CONST_CRC_3 0x8108 | ||||
#define CONST_CRC_4 0x1231 | ||||
#define CONST_CRC_5 0x2462 | ||||
#define CONST_CRC_6 0x48c4 | ||||
#define CONST_CRC_7 0x9188 | ||||
#define CRC_RESET 0xffff | ||||
paul
|
r45 | //********************** | ||
// GENERAL USE FUNCTIONS | ||||
unsigned int Crc_opt( unsigned char D, unsigned int Chk); | ||||
void initLookUpTableForCRC( void ); | ||||
void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData); | ||||
//********************* | ||||
// ACCEPTANCE FUNCTIONS | ||||
paul
|
r112 | int tc_parser( ccsdsTelecommandPacket_t * TCPacket, unsigned int estimatedPacketLength, unsigned char *computed_CRC ); | ||
paul
|
r45 | int tc_check_type( unsigned char packetType ); | ||
paul
|
r104 | int tc_check_type_subtype( unsigned char packetType, unsigned char packetSubType ); | ||
paul
|
r46 | int tc_check_sid( unsigned char sid ); | ||
paul
|
r45 | int tc_check_length( unsigned char packetType, unsigned int length ); | ||
int tc_check_crc(ccsdsTelecommandPacket_t * TCPacket, unsigned int length , unsigned char *computed_CRC); | ||||
#endif // TC_ACCEPTANCE_H_INCLUDED | ||||