Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg: add nanocoap #5972

Merged
merged 2 commits into from
Oct 31, 2016
Merged

pkg: add nanocoap #5972

merged 2 commits into from
Oct 31, 2016

Conversation

kaspar030
Copy link
Contributor

Here's the first PR regarding nanocoap.
While nanocoap contains client functionality, that depends on sock, so I've decided to add that at a later stage.

The PR includes an example application that has almost exactly the same functionality as microcoap_example (it's also based on conn for now).

Here's a code/memory comparison:

[kaspar@booze nanocoap_server (add_pkg_nanocoap)]$ BOARD=samr21-xpro make info-objsize | grep -E '(coap|main)'
    944       0       0     944     3b0 nanocoap.o (ex nanocoap.a)
    144       0     512     656     290 nanocoap_conn.o (ex nanocoap_server.a)
    178       0      64     242      f2 main.o (ex nanocoap_server.a)
    150       0       0     150      96 coap_handler.o (ex nanocoap_server.a)
[kaspar@booze nanocoap_server (add_pkg_nanocoap)]$
[kaspar@booze microcoap_server (add_pkg_nanocoap)]$ BOARD=samr21-xpro make info-objsize | grep -E '(coap|main)'
    164       8    1536    1708     6ac microcoap_conn.o (ex microcoap_server.a)
   1244       0       0    1244     4dc coap.o (ex microcoap.a)
    468       0     500     968     3c8 coap.o (ex microcoap_server.a)
    179       0      64     243      f3 main.o (ex microcoap_server.a)
[kaspar@booze microcoap_server (add_pkg_nanocoap)]

Thats 1416b code / 576b RAM for nanocoap and 2055b code / 2108b RAM for microcoap.
The comparison is favoring nanocoap, as microcoap currently has a little more functionality (it adds content types to /.well-known/core), and its buffers could probably be made smaller. Then again, it is not easy to determine how big they should be for microcoap, which was one of the main reasons why I started the rewrite.

Also, nanocoap only needs 57 lines of CoAP specific SLOC for this simple example, while microcoap needs ~130.

@kaspar030 kaspar030 added the Area: pkg Area: External package ports label Oct 19, 2016
@kaspar030 kaspar030 added this to the Release 2016.10 milestone Oct 19, 2016
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 19, 2016
@kaspar030
Copy link
Contributor Author

(launching CI to check for build errors)

kb2ma added a commit to kb2ma/RIOT that referenced this pull request Oct 20, 2016
* pkg provided by commit from kaspar030 add_pkg_nanocoap branch. See
  pending PR RIOT-OS#5972.
USEMODULE += gnrc_icmpv6_echo

#
USEMODULE += gnrc_conn_udp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs port to sock ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. :)

USEMODULE += gnrc_netdev_default
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules for IPv6 and UDP
USEMODULE += gnrc_ipv6_router_default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making this only a host #6007

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in a follow-up.

@kaspar030
Copy link
Contributor Author

  • squashed, as it now should build and I won't be able to change things until I'm back from holidays.

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Copper on native (and the provided example). ACK!

@miri64
Copy link
Member

miri64 commented Oct 31, 2016

and go.

@miri64 miri64 closed this Oct 31, 2016
@miri64 miri64 reopened this Oct 31, 2016
@miri64 miri64 merged commit c958dd8 into RIOT-OS:master Oct 31, 2016
@kaspar030 kaspar030 deleted the add_pkg_nanocoap branch January 22, 2019 10:21
@benpicco benpicco mentioned this pull request Jul 25, 2024
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants