On Friday 23 October 2015 17:41:12 Keane, Erich wrote:
> The err = err | <cbor function> is only used in a few places where
> knowing the error afterwards is important, for most situations, the
> error code is pretty meaningless since there is nothing we can do about
> it.

To be clear: there's only one error code that is important here and that's the 
"buffer is too short" when encoding the data. TinyCBOR has that in a special 
bit that no other error code will set, so it's guaranteed to work. 

Moreover, you *can* continue streaming data after you got such an error and 
TinyCBOR will then simply count how many bytes it needs, instead of encoding. 
At the end, you can allocate the buffer of the size that TinyCBOR says it 
should be and encoding should work (provided you have the same data, of 
course).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Reply via email to