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 bool checkCRC(uint8_t const *buffer, size_t len);
17 class DataParser
18{
19 private:
20 SLPacker slPacker;
21
22 public:
23 static size_t sendFrame(uint8_t *destBuffer, uint8_t const *buffer, size_t len);
24 static size_t sendFrame(uint8_t *destBuffer, uint8_t const *buffer, size_t len, Stream *stream);
25 uint8_t *buf = slPacker.buf;
26 int update(uint8_t inp);
27};
28
29#endif /* __DATAPROTOCOL_H */
DataParser
Definition DataProtocol.h:18
SLPacker
Definition SLPacker.hpp:14