This document details the changes between each release.
- Only compile EEPROM things if EEPROM.h (and
__has_include
) exists.
- Added new
expectDefiniteBytes
andexpectDefiniteText
functions toCBOR_parsing
. These test for a specific sequence of bytes or text.
- Added a header guard to
CBOR_streams.h
.
- Tested with ArduinoUnit v3.0.2.
- Fixed the map part of the
bytes_unavailable
test instream.inc
. It now ensures that the value part of the map entry is there and not some random value. - Compiles on more platforms (listed using PlatformIO board names):
teensylc
,teensy35
,teensy36
,esp12e
,nucleo_f302r8
,nucleo_f303k8
, andnucleo_f103rb
. This is in addition to just compiling and testing onteensy31
,huzzah
, andfeatheresp32
. - Now making use of PlatformIO's
build_unflags
to ensure that the-fsingle-precision-constant
does not take effect; the compiler was complaining that some float literals were still overflowing, even though-fno-single-precision-constant
was being passed inbuild_flags
.
- Compilation for ESP32.
- keywords.txt file.
- Removed the C-style comment line from
library.json
.
Reader::bytesAvailable()
function that returns the number of bytes available in the current Bytes or Text data item.
- Changed the behaviour of
readByte()
andreadBytes
inReader
to only read up to the number of bytes available in the current Bytes or Text data item. Reader::getDataType()
is nowconst
.
expectFloatValue
andexpectDoubleValue
now treat zero and negative zero as equal.
Reader::getDataType()
function that returns the current data type without advancing the stream.- Parsing helper functions that expect specific values for: unsigned ints,
ints, bytes with length, text with length, arrays with length, maps with
length, and tags. These join the other
expectXXXValue
functions. - More tests, including ones for detecting negative zero being different than positive zero.
- The length is now explicitly set to zero when parsing indefinite-length items: bytes, text, arrays, maps.
- Updated docs.
- Changed all
Reader
parameters in the parsing helper functions to references instead of copies. Now the internal state is correctly maintained across helper function calls.
- Moved the tests to a folder named
src_tests
for now. This makes it easier to directly reference this project as an Arduino and PlatformIO library.
expectBoolean
helper function, for consistency.expectBytesOrBreak
andexpectTextOrBreak
helper functions for reading indefinite-length Bytes or Text chunks.isFalse()
,isTrue()
,isNull()
,isUndefined()
, andisBreak()
functions inReader
.isNegativeOverflow()
andisUnsigned()
functions inReader
help disambiguate some special cases when reading and expecting integer values viaReader::getInt()
andexpectInt
.isIndefinite
output parameter inexpectBytes
,expectText
,expectArray
, andexpectMap
for discovering indefinite-length data items.
- The
readFully
helper function now returns asize_t
instead of anunsigned int
. Reader::getInt()
and theexpectInt
helper function can now read and expect both signed and unsigned integers. NewisNegativeOverflow()
andisUnsigned()
functions inReader
help disambiguate some special cases.- Documentation updates.
expectIndefiniteBytes
andexpectIndefiniteText
functions because there's no need to separate the syntactic difference. There's a newisIndefinite
output parameter inexpectBytes
,expectText
,expectArray
, andexpectMap
for discovering indefinite-length data items.
expectDoubleValue
was using afloat
internally.Reader::isWellFormed()
allowed nested indefinite-length bytes or text.Reader::getBoolean()
was allowing certain 1-byte simple values to function as booleans.
This release updates the API to include a way to access the read size and write size, and also makes the Reader and Writer classes implement Stream and Print, respectively. As well, the byte array and EEPROM Stream and Print implementations now provide a way to access the internal index (or address, in the case of EEPROM), for ease of determining how far reading or writing has progressed.
Tag: v1.1.0
This is the first release of the libCBOR library. It includes functions for reading and writing, and helper functions for parsing and for processing EEPROM.
Copyright (c) 2017-2019 Shawn Silverman