-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[SWP] coap plugtests #1801
[SWP] coap plugtests #1801
Conversation
|
||
#pragma GCC diagnostic ignored "-Wunused-parameter" | ||
|
||
static inline void set_and_hash(size_t len, unsigned char* data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding conventions.
I don't quite get why the linker is unable to find |
I'll never find out why git hates me.... |
@sgso, will you try to fix it or should I adopt this PR? |
@OlegHahm, I think I addressed the stylistic problems. For me it compiles on native. This: "I don't quite get why the linker is unable to find _gettimeofday()." I never encountered. |
@authmillenon, you offered to help out with reviewing - thanks. :) |
@@ -1,6 +1,6 @@ | |||
PKG_NAME=libcoap | |||
PKG_URL=http://git.code.sf.net/p/libcoap/code | |||
PKG_VERSION=ef41ce5d02d64cec0751882ae8fd95f6c32bc018 | |||
PKG_URL=https://github.com/sgso/libcoap.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you really commiting to update it regularly in the future? Otherwise: how about adding a fork to RIOT-OS? What do you think @OlegHahm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could create a new patch set on top of the current version (like we do now with the older version) which seems to be in a good state and hasn't changed since August/September. Should libcoap development pick up some momentum in the future I'd recommend to ask its maintainer to include the patches together with a RIOT flag rather than fork it. But currently it's not worth the effort, in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could create a new patch set on top of the current version (like we do now with the older version) which seems to be in a good state and hasn't changed since August/September.
👍 please do so.
Apart from the repo situation I'm fine with this PR. |
@sgso, are you planning to do so? |
@OlegHahm, Tomorrow evening, I'll do. |
Great. |
Please squash and we're ready to go! |
Added cpp compatible headers & removed cppcheck errors. Squashed. |
|
This adds an example application under 'examples/coap-plugtests' which implements large parts of the ETSI CoAP plugtests as published here: https://github.com/cabo/td-coap4 It also adds an improved patch set to the most recent libcoap version under 'pkg/libcoap/'.
@authmillenon I don't know anything about all the new network stuff (is there an overview of what has changed somewhere?), but is there some select/epoll-like thing for networking now? Last time I asked, I was told to wait for "the new stuff". |
But regardless: CoAP is not dependent on 6LoWPAN and neither are the plugtests (at least that's what I remember, because that led to a lot of frustration for us on the last Plugtest in London, because everybody else used plain IPv4 and v6 while we were only speaking 6LoWPAN). So I guess you don't need ZEP.
The lack of asynchronous IO (which is required for |
@authmillenon Thank you, that cleared it up. I tried the ng_tapdev branch and experimented a little with ng_udp. The tap driver works well for me already. @OlegHahm I'd like to port this to ng_udp in a separate branch and give it some love in the process so it can be included with complete instructions how to test it locally with ng_tapdev against Californium. Ok? |
@sgso, sounds perfect to me. Thanks. |
@sgso keep in mind that ng_tapnet is more or less obsoleted by @kaspar030's dev_eth_tap (#2776). |
I put together a tree of dev_eth_net/ipv6/udp in https://github.com/sgso/RIOT/tree/ng_ipv6/dev_eth_netdev/ng_udp/fixes and started working on the coap plugtests in https://github.com/sgso/applications/tree/master/ng_coap_plugtests There is no coap yet involved but could somebody take a look at it and tell me if I initialize and use the network stack correctly? |
Normally all the initialization you do in |
The address auto-initialization will come as soon as I find some time for this :-) |
I replicated the functionality of this PR with the new network stack in: It needs a RIOT tree with ng_udp & dev_eth_tap and of course a patched libcoap. Locations and instructions can be found in README.md. Because I'm not using sockets (of any kind) this time, the asynchronous parts integrate nicely and I'll probably start to implement the Observe part of the plugtests as well. I'd like comments
Then "carry" around |
Sure, this is absolute legitimate. If you are in your own thread, there is nothing from stopping you doing stuff with the pkt snips as you like, as long as you make sure (what you do) you have exclusive rights on it. |
@sgso ping? |
Sorry, I got a little fascinated by real hardware and this suffered under it. I'll polish it within the next week. The main question now is how to provide the library. I'm not happy with the current patch-set method because updating is tiresome and we'll look at differences of patches here at github. I'd prefer to keep a patched libcoap in a separate repository and periodically update the commit/tag the pkg is pointing at. Upstream has been inactive since last summer, so we wouldn't miss out on anything by having a separate version. Would a RIOT repository be suitable for that? Maybe find one or two other people interested in CoAP besides me to maintain it there? |
I'm still uncertain about the separate repository, but since we are more git-dependent than other operating systems which use similar mechanisms for packages, it may be a better solution for now. |
Any other opinions on this? |
I think keeping a separate repository can help when reviewing changes. Meta diffs (diffs of diffs) are hard to read and to maintain. |
I agree with @gebart and @authmillenon here. |
@sgso Ping! needs rebase |
@gebart I'll commit a cleaned & polished libcoap version suitable for integration or separate repository when my exams are over next week. It's pretty much ready but I need to fix some formalities. |
Any news? |
Yes. I worked on this with the 'old' libcoap base. This (https://github.com/sgso/libcoap/commits/netapio-riot-clean) contains a netapi port that I cleaned from all the cruft, awful style and platform specific code as a basis for a riot specific version like mentioned above. It's probably outdated but in principle it's there. After libcoap moved to github, I found out about the 'develop' branch which is active and seems to address a lot of the issues that I loathed about libcoap. Under the assumption that libcoap is developed actively again, above branch does not make sense anymore. I tried to get the develop branch working with RIOT. But I will not go to GNU/autoconf-University just for integrating this in my free time. I have better things to do than figure out Makefiles and I don't know why an embedded library needs libtool and other crap. I'd suggest to hand over the project to the Eclipse foundation. They would love to provide some more additional layers of build tools. [/sarcasm] Check https://github.com/sgso/applications/tree/coap-plugtests/coap-plugtests for the latest working plugtests application (for some RIOT/libcoap combination, don't know which). It contains some glue code in coap_thread.c which might be interesting. Provide me with the Makefile to build the develop-branch within RIOT and I can supply some of my modifications. Apart from that, I'm out. (closing this) |
Hello, I am new to RIOT OS and do not have much experience with embedded programming. I am trying to flash the client.c code provided by libcoap examples into my board. However I am facing compilation problems. Is including the libcoap pkg into my makefile not enough? I am sorry if my question is not relevant to this topic. |
Libcoap examples have been tested with RIOT yet. For the moment, you can compile libcoap package with an example as it is shown here: |
This contains the coap-plugtests application. It passes the sections "Base CoAP", "Block", and "Link format" as specified here: https://github.com/cabo/td-coap4/
It depends on a patched libcoap that is referenced in the pkg/libcoap/Makefile and can be found here: https://github.com/sgso/libcoap/tree/riot-pkg. The patches are based on the current HEAD of libcoap. I worked with upstream to include most of the patches that are currently included in the libcoap pkg directory (most of them were due to RIOTs pedantic compiler flags).
There are no handlers programmed for the "Observe" part of the plugtest but my libcoap branch proposes a variant with timer enabled socket functions to compensate for the missing select/*poll.