MeterLogger
proto.h
Go to the documentation of this file.
1 /*
2  * File: proto.h
3  * Author: ThuHien
4  *
5  * Created on November 23, 2012, 8:57 AM
6  */
7 
8 #ifndef _PROTO_H_
9 #define _PROTO_H_
10 #include <stdlib.h>
11 #include "typedef.h"
12 #include "ringbuf.h"
13 
14 typedef void(PROTO_PARSE_CALLBACK)();
15 
16 typedef struct{
17  U8 *buf;
24 
25 I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize);
27 I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize);
28 I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len);
30 I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF *rb, U8 *bufOut, U16* len, U16 maxBufLen);
31 #endif
32 
I16 ICACHE_FLASH_ATTR PROTO_Add(U8 *buf, const U8 *packet, I16 bufSize)
Definition: proto.c:70
PROTO_PARSE_CALLBACK * callback
Definition: proto.h:22
Definition: ringbuf.h:7
U8 isBegin
Definition: proto.h:21
short I16
Definition: typedef.h:11
#define ICACHE_FLASH_ATTR
Definition: c_types.h:99
I8 ICACHE_FLASH_ATTR PROTO_ParseByte(PROTO_PARSER *parser, U8 value)
Definition: proto.c:13
unsigned short U16
Definition: typedef.h:12
char I8
Definition: typedef.h:9
I16 ICACHE_FLASH_ATTR PROTO_AddRb(RINGBUF *rb, const U8 *packet, I16 len)
Definition: proto.c:106
I8 ICACHE_FLASH_ATTR PROTO_Init(PROTO_PARSER *parser, PROTO_PARSE_CALLBACK *completeCallback, U8 *buf, U16 bufSize)
Definition: proto.c:3
U16 dataLen
Definition: proto.h:19
unsigned char U8
Definition: typedef.h:10
void() PROTO_PARSE_CALLBACK()
Definition: proto.h:14
U8 isEsc
Definition: proto.h:20
U8 * buf
Definition: proto.h:17
I16 ICACHE_FLASH_ATTR PROTO_ParseRb(RINGBUF *rb, U8 *bufOut, U16 *len, U16 maxBufLen)
Definition: proto.c:56
I8 ICACHE_FLASH_ATTR PROTO_Parse(PROTO_PARSER *parser, U8 *buf, U16 len)
Definition: proto.c:49
U16 bufSize
Definition: proto.h:18