Simple data buffer splitter and re-assembler.
Diff: SplitterAssembler.h
- Revision:
- 6:094ed29a8bf7
- Parent:
- 5:b0dc0395174e
- Child:
- 7:6baecc15cb26
diff -r b0dc0395174e -r 094ed29a8bf7 SplitterAssembler.h --- a/SplitterAssembler.h Tue Feb 17 06:59:49 2015 +0000 +++ b/SplitterAssembler.h Wed Feb 18 06:57:57 2015 +0000 @@ -75,8 +75,16 @@ @param buffer input the result buffer @param buffer_length input the result buffer length (maximum) @param reset_after_assemble input reset the Fragmenter/Assembler after assembly is complete (default: TRUE) + @return the length of the assembled buffer */ - void assemble(uint8_t *buffer,int buffer_length,bool reset_after_assemble = true); + int assemble(uint8_t *buffer,int buffer_length,bool reset_after_assemble = true); + + /** + Find a specific character in the collected fragments + @param special_char the special character to look for + @return true - special char is in one of the fragments, false, otherwise + */ + bool hasCollectedCharacter(char special_char); private: int calculateNumFragments(uint8_t *data,int data_length);