diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-02-22 16:16:48 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-02-22 16:16:48 +0100 |
commit | d0fb1850606ce003887259675e271a9aade4fda0 (patch) | |
tree | 0bf3be59348c0fd64f17c9e9a727e85ffc7bd98b /include/ble | |
parent | ba6324930118a62e05d3869f99543c4a7507f105 (diff) | |
download | ble-toys-d0fb1850606ce003887259675e271a9aade4fda0.tar.gz ble-toys-d0fb1850606ce003887259675e271a9aade4fda0.tar.bz2 ble-toys-d0fb1850606ce003887259675e271a9aade4fda0.tar.xz ble-toys-d0fb1850606ce003887259675e271a9aade4fda0.zip |
o Starting a new class for all SoilMoisture GATT stuff.
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); |