25 lines
624 B
C
25 lines
624 B
C
#ifndef CLIENT_H
|
|
#define CLIENT_H
|
|
|
|
#include "hdlc_frame.h"
|
|
#include "uart_module.h"
|
|
#include <stdbool.h>
|
|
#include <stddef.h> // Для использования size_t
|
|
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
bool TEST_IS_VALID;
|
|
uint8_t address;
|
|
uint8_t _send_sequence_number;
|
|
uint8_t poll_final;
|
|
uint8_t _receive_sequence_number;
|
|
} Client;
|
|
|
|
void init_Client(Client* client, bool test_is_valid, uint8_t address);
|
|
void connect(Client* client);
|
|
void send(Client* client, uint8_t* data, size_t data_length);
|
|
void receive_data(uint8_t* recivedData);
|
|
bool validate(const uint8_t* frame, size_t length);
|
|
|
|
#endif
|