-
Notifications
You must be signed in to change notification settings - Fork 3
/
protocol.h
34 lines (28 loc) · 952 Bytes
/
protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (c) 2021-2023 dresden elektronik ingenieurtechnik gmbh.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
*/
#ifndef PROTOCOL_H
#define PROTOCOL_H
typedef struct {
unsigned bufpos;
unsigned short crc;
unsigned char escaped;
unsigned char buf[256];
} PROT_RxState;
/* Platform independent declarations. */
void PROT_SendFlagged(const unsigned char *data, unsigned len);
void PROT_ReceiveFlagged(PROT_RxState *rx, const unsigned char *data, unsigned len);
void PROT_Packet(const unsigned char *data, unsigned len);
/*! Platform specific declarations.
Following functions need to be implemented in the platform layer.
*/
int PROT_Write(const unsigned char *data, unsigned len);
int PROT_Putc(unsigned char ch);
int PROT_Flush(void);
#endif /* PROTOCOL_H */