Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
parse_array/envelopetracker.h
- Committer:
- hober
- Date:
- 2019-01-07
- Revision:
- 1:edc6b5cc7112
- Parent:
- 0:9e6e3dc903c0
File content as of revision 1:edc6b5cc7112:
#ifndef ENVELOPETRACKER_H #define ENVELOPETRACKER_H #include "envelope.h" #include <list> class EnvelopeTracker { public: EnvelopeTracker(); // parsing void parse(char *buf, int bufLength); Envelope* getEnvelope(){ Envelope* ret = NULL; if(envelopeListIndexFront != -1){ ret = envelopeList[envelopeListIndexFront++]; envelopeListIndexFront %= envelopeListLength; if(envelopeListIndexFront == envelopeListIndex) envelopeListIndexFront = -1; } return ret; } int bufferDataLength(); void resetBuffer(); void setEnvelope(const Envelope &value); void setBufferLength(int value); ~EnvelopeTracker(); private: // check Header bool testHeader(); // check Footer bool testFooter(); // test XOR bool testXOR();// set xindex as headerIndex // current header index int currentHeaderIndex; // current footer index int currentFooterIndex; int currentDataIndex; // index int currentIndex; // array char * bufferArray; int bufferLength; int bufferTailIndex; Envelope** envelopeList; int envelopeListLength; int envelopeListIndex; int envelopeListIndexFront; Envelope envelope; int envelopeLength; int envelopeDataLength; int headerLength; }; #endif // ENVELOPETRACKER_H