Bind
C++ UI toolkit for Arduino
Loading...
Searching...
No Matches
DataProtocol.h
1
#ifndef __DATAPROTOCOL_H
2
#define __DATAPROTOCOL_H
3
#include <stdint.h>
4
#include <string.h>
5
#include "Stream.h"
6
#include "SLPacker.hpp"
7
8
static
uint8_t VERSIONID = 0;
9
10
enum
DataDirection
11
{
12
toAndroid,
13
fromAndroid
14
};
15
16
int
sendFrame(uint8_t *destBuffer, uint8_t
const
*buffer,
size_t
len);
17
bool
checkCRC(uint8_t
const
*buffer,
size_t
len);
18
class
DataParser
19
{
20
private
:
21
SLPacker
slPacker;
22
23
public
:
24
static
size_t
sendFrame(uint8_t *destBuffer, uint8_t
const
*buffer,
size_t
len);
25
static
size_t
sendFrame(uint8_t *destBuffer, uint8_t
const
*buffer,
size_t
len, Stream *stream);
26
uint8_t *buf = slPacker.buf;
27
int
update(uint8_t inp);
28
};
29
30
#endif
/* __DATAPROTOCOL_H */
DataParser
Definition
DataProtocol.h:19
SLPacker
Definition
SLPacker.hpp:14
src
DataProtocol.h
Generated by
1.9.8