Carsten Bormann | 904658d | 2015-08-27 18:04:18 +0200 | [diff] [blame] | 1 | [](https://travis-ci.org/cabo/cn-cbor) |
| 2 | |
Carsten Bormann | 64e2b52 | 2015-02-17 18:52:34 +0100 | [diff] [blame] | 3 | # cn-cbor: A constrained node implementation of CBOR in C |
| 4 | |
Carsten Bormann | c2e5373 | 2020-04-08 21:51:38 +0200 | [diff] [blame] | 5 | Below is the original README for cn-cbor, a Proof of Concept |
| 6 | implementation of [CBOR](https://cbor.io) that I wrote in 2013. |
| 7 | People have been sending me fixes and updates to make this |
| 8 | implementation more useful for actual use, and for a while I have |
| 9 | occasionally integrated them. Jim Schaad now is so far ahead of this |
| 10 | repo that you are most likely better off using [his |
| 11 | repo](https://github.com/jimsch/cn-cbor) as your upstream. |
| 12 | |
| 13 | If you *are* here looking for experimental CBOR implementations for |
| 14 | constrained nodes, there are many, some of which are listed at |
| 15 | [cbor.io](https://cbor.io/impls.html). One more: I have recently |
| 16 | [extracted](https://github.com/cabo/bm_cbor) the implementation from |
| 17 | ARM-mbed's [SUIT manifest |
| 18 | generator](https://github.com/ARMmbed/suit-manifest-generator) (Apache |
| 19 | 2.0). SUIT implementers report (CBOR-specific) code sizes in the low |
| 20 | hundreds of bytes. Thank you, [ARM](https://github.com/bremoran). |
| 21 | |
| 22 | # cn-cbor: A constrained node implementation of CBOR in C |
| 23 | |
Carsten Bormann | 64e2b52 | 2015-02-17 18:52:34 +0100 | [diff] [blame] | 24 | This is a constrained node implementation of [CBOR](http://cbor.io) in |
| 25 | C that I threw together in 2013, before the publication of |
| 26 | [RFC 7049](http://tools.ietf.org/html/rfc7049), to validate certain |
| 27 | implementability considerations. |
| 28 | |
| 29 | Its API model was inspired by |
| 30 | [nxjson](https://bitbucket.org/yarosla/nxjson). It turns out that |
| 31 | this API model actually works even better with the advantages of the |
| 32 | CBOR format. |
| 33 | |
| 34 | This code has been used in a number of research implementations on |
| 35 | constrained nodes, with resulting code sizes appreciably under 1 KiB |
| 36 | on ARM platforms. |
| 37 | |
| 38 | I always meant to improve the interface some more with certain API |
| 39 | changes, in order to get even closer to 0.5 KiB, but I ran out of |
| 40 | time. So here it is. If I do get around to making these changes, the |
| 41 | API will indeed change a bit, so please be forewarned. |
| 42 | |
Joe Hildebrand | 0085b13 | 2015-03-31 00:31:56 -0600 | [diff] [blame] | 43 | ## Building |
| 44 | |
Carsten Bormann | bca0126 | 2015-04-02 22:26:57 +0200 | [diff] [blame] | 45 | There is a `Simple-Makefile` for playing around, as well as a complete |
| 46 | [`cmake`](http://www.cmake.org)-based build environment. |
| 47 | (You can choose what fits your needs better.) |
| 48 | |
Carsten Bormann | 8bffb27 | 2015-04-03 00:15:53 +0200 | [diff] [blame] | 49 | Building with `cmake`: |
| 50 | |
Joe Hildebrand | 0085b13 | 2015-03-31 00:31:56 -0600 | [diff] [blame] | 51 | ./build.sh |
| 52 | |
Carsten Bormann | b444590 | 2015-04-06 15:04:31 +0200 | [diff] [blame] | 53 | Building including testing: |
| 54 | |
| 55 | ./build.sh all test |
| 56 | |
| 57 | Generating a test coverage report (requires lcov[^1]; result in `build/lcov/index.html`): |
| 58 | |
| 59 | ./build.sh all coveralls coverage_report |
| 60 | |
Carsten Bormann | 64e2b52 | 2015-02-17 18:52:34 +0100 | [diff] [blame] | 61 | License: MIT |
Carsten Bormann | b444590 | 2015-04-06 15:04:31 +0200 | [diff] [blame] | 62 | |
| 63 | [^1]: Installation with homebrew: `brew install lcov` |