This commit is contained in:
2025-01-17 17:29:17 +08:00
parent f8a41af344
commit cc4d898114
4 changed files with 89 additions and 45 deletions

View File

@@ -35,9 +35,20 @@ typedef enum
VALIDATION_LENGTH_ERROR = 8
} validation_result_t;
typedef enum
{
PS_LEN = 0,
PS_TYPE,
PS_PAYLOAD,
PS_CRC,
PS_NULL
} packet_state;
/******************************************************************************/
void process_command(uint8_t* cmd, size_t length);
// void process_command(uint8_t* cmd, size_t length);
void process_command(void);
uint8_t calculate_crc(uint8_t data[], uint8_t data_length);
@@ -53,4 +64,8 @@ void gd60914_tempture_report(void);
void ultrasonic_distance_report(void);
void process_printer(void);
void get_command (void);
#endif //RS485_PROTOCOL_H