From d0fb1850606ce003887259675e271a9aade4fda0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 22 Feb 2015 16:16:48 +0100 Subject: o Starting a new class for all SoilMoisture GATT stuff. --- include/ble/ByteBuffer.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') 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); -- cgit v1.2.3