diff options
Diffstat (limited to 'include/ble')
-rw-r--r-- | include/ble/ByteBuffer.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ble/ByteBuffer.h b/include/ble/ByteBuffer.h index f884d6e..74a1bf7 100644 --- a/include/ble/ByteBuffer.h +++ b/include/ble/ByteBuffer.h @@ -39,8 +39,9 @@ public: return end - ptr; } - inline void setCursor(size_t newCursor) { + inline ByteBuffer &setCursor(size_t newCursor) { ptr = (uint8_t *) &zero[newCursor]; + return *this; } inline void skip(size_t length) { @@ -52,8 +53,8 @@ public: ByteBuffer &write16le(uint16_t value); /** - * Appends the entire buffer. Make a view if you want to write a part of it. - */ + * Appends the entire buffer. Make a view if you want to write a part of it. + */ ByteBuffer &write(const ByteBuffer &value); ByteBuffer &write(const uint8_t *bytes, size_t len); |