Simple data buffer splitter and re-assembler.
Diff: SplitterAssembler.h
- Revision:
- 7:6baecc15cb26
- Parent:
- 6:094ed29a8bf7
- Child:
- 8:bfa5b7b9b886
diff -r 094ed29a8bf7 -r 6baecc15cb26 SplitterAssembler.h --- a/SplitterAssembler.h Wed Feb 18 06:57:57 2015 +0000 +++ b/SplitterAssembler.h Wed Feb 18 19:40:20 2015 +0000 @@ -26,7 +26,7 @@ #include "mbed.h" // TUNABLES -#define MAX_FRAGMENTS 15 // maximum number of supported fragments... increase as needed... +#define MAX_FRAGMENTS 13 // maximum number of supported fragments... increase as needed... (max payload length = 256/DEF_FRAGMENT_LENGTH ~ 13) #define DEF_FRAGMENT_LENGTH 20 // BLE: set to max MTU for BLE UART: defined by BLE_UART_SERVICE_MAX_DATA_LEN in UARTService.h class SplitterAssembler { @@ -58,6 +58,12 @@ int getSplitLength() { return DEF_FRAGMENT_LENGTH; } /** + Get the number of fragments + @returns the number of fragments + */ + int getNumFragments() { return this->m_num_fragments; } + + /** Reset the Fragmenter/Assembler */ void reset(void);