Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
GcStreamParser.hxx
Go to the documentation of this file.
1
35#ifndef _UTILS_GCSTREAMPARSER_HXX_
36#define _UTILS_GCSTREAMPARSER_HXX_
37
38#include <string>
39
48{
49public:
51 : offset_(-1)
52 {
53 }
54
57 bool consume_byte(char c);
58
67 bool parse_frame_to_output(struct can_frame *output_frame);
68
70 void frame_buffer(std::string *payload);
71
72private:
74 char cbuf_[32];
77};
78
79#endif // _UTILS_GCSTREAMPARSER_HXX_
Parses a sequence of characters; finds GridConnect protocol packet boundaries in the sequence of pack...
bool consume_byte(char c)
Adds the next character from the source stream.
int offset_
offset of next byte in cbuf to write.
void frame_buffer(std::string *payload)
bool parse_frame_to_output(struct can_frame *output_frame)
Parses the current contents of the frame buffer to a can_frame struct.
char cbuf_[32]
Collects data from a partial GC packet.