Simple data buffer splitter and re-assembler.
Diff: SplitterAssembler.h
- Revision:
- 4:221c8a56a80e
- Parent:
- 3:00f7a99862a3
- Child:
- 5:b0dc0395174e
diff -r 00f7a99862a3 -r 221c8a56a80e SplitterAssembler.h --- a/SplitterAssembler.h Mon Feb 16 06:37:21 2015 +0000 +++ b/SplitterAssembler.h Tue Feb 17 02:56:30 2015 +0000 @@ -26,8 +26,8 @@ #include "mbed.h" // TUNABLES -#define MAX_FRAGMENTS 100 // maximum number of supported fragments... increase as needed... -#define DEF_FRAGMENT_LENGTH 20 // Typically identical to BLE_UART_SERVICE_MAX_DATA_LEN in UARTService.h +#define MAX_FRAGMENTS 30 // maximum number of supported fragments... increase as needed... +#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 { public: @@ -85,7 +85,7 @@ int m_num_fragments; int m_last_fragment_length; - uint8_t m_fragments[DEF_FRAGMENT_LENGTH+1][MAX_FRAGMENTS]; + uint8_t m_fragments[MAX_FRAGMENTS][DEF_FRAGMENT_LENGTH+1]; }; #endif // __SPLITTER_ASSEMBLER_H__ \ No newline at end of file