This document details the changes between each release.
- Only compile EEPROM things if EEPROM.h (and
__has_include) exists.
- Added new
expectDefiniteBytesandexpectDefiniteTextfunctions 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_unavailabletest 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_unflagsto ensure that the-fsingle-precision-constantdoes not take effect; the compiler was complaining that some float literals were still overflowing, even though-fno-single-precision-constantwas 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()andreadBytesinReaderto only read up to the number of bytes available in the current Bytes or Text data item. Reader::getDataType()is nowconst.
expectFloatValueandexpectDoubleValuenow 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
expectXXXValuefunctions. - 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
Readerparameters 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_testsfor now. This makes it easier to directly reference this project as an Arduino and PlatformIO library.
expectBooleanhelper function, for consistency.expectBytesOrBreakandexpectTextOrBreakhelper functions for reading indefinite-length Bytes or Text chunks.isFalse(),isTrue(),isNull(),isUndefined(), andisBreak()functions inReader.isNegativeOverflow()andisUnsigned()functions inReaderhelp disambiguate some special cases when reading and expecting integer values viaReader::getInt()andexpectInt.isIndefiniteoutput parameter inexpectBytes,expectText,expectArray, andexpectMapfor discovering indefinite-length data items.
- The
readFullyhelper function now returns asize_tinstead of anunsigned int. Reader::getInt()and theexpectInthelper function can now read and expect both signed and unsigned integers. NewisNegativeOverflow()andisUnsigned()functions inReaderhelp disambiguate some special cases.- Documentation updates.
expectIndefiniteBytesandexpectIndefiniteTextfunctions because there's no need to separate the syntactic difference. There's a newisIndefiniteoutput parameter inexpectBytes,expectText,expectArray, andexpectMapfor discovering indefinite-length data items.
expectDoubleValuewas using afloatinternally.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