-
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
net/coap: Packet API function to add Uri-Query option #13213
Conversation
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.
It looks good. The unit tests still pass. Just a small typo. Also, the prefix on the second commit is a bit misleading, as you are using the new query function in the unit test and not in gcoap itself.
I think it also would be good to modify nanocoap's query unit tests to use this function now.
Unit test result
> make tests-gcoap test
Building application "tests_unittests" for "native" with MCU "native".
"make" -C /home/leandro/Work/RIOT/boards/native
"make" -C /home/leandro/Work/RIOT/boards/native/drivers
"make" -C /home/leandro/Work/RIOT/core
"make" -C /home/leandro/Work/RIOT/cpu/native
"make" -C /home/leandro/Work/RIOT/cpu/native/periph
"make" -C /home/leandro/Work/RIOT/cpu/native/stdio_native
"make" -C /home/leandro/Work/RIOT/cpu/native/vfs
"make" -C /home/leandro/Work/RIOT/drivers
"make" -C /home/leandro/Work/RIOT/drivers/periph_common
"make" -C /home/leandro/Work/RIOT/sys
"make" -C /home/leandro/Work/RIOT/sys/div
"make" -C /home/leandro/Work/RIOT/sys/embunit
"make" -C /home/leandro/Work/RIOT/sys/evtimer
"make" -C /home/leandro/Work/RIOT/sys/fmt
"make" -C /home/leandro/Work/RIOT/sys/luid
"make" -C /home/leandro/Work/RIOT/sys/net/application_layer/gcoap
"make" -C /home/leandro/Work/RIOT/sys/net/application_layer/nanocoap
"make" -C /home/leandro/Work/RIOT/sys/net/crosslayer/inet_csum
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/netapi
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/netif
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/netif/hdr
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/netreg
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/network_layer/icmpv6
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/network_layer/ipv6
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/network_layer/ipv6/hdr
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/network_layer/ipv6/nib
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/network_layer/ndp
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/pkt
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/pktbuf
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/pktbuf_static
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/sock
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/sock/udp
"make" -C /home/leandro/Work/RIOT/sys/net/gnrc/transport_layer/udp
"make" -C /home/leandro/Work/RIOT/sys/net/link_layer/l2util
"make" -C /home/leandro/Work/RIOT/sys/net/netif
"make" -C /home/leandro/Work/RIOT/sys/net/network_layer/icmpv6
"make" -C /home/leandro/Work/RIOT/sys/net/network_layer/ipv6/addr
"make" -C /home/leandro/Work/RIOT/sys/net/network_layer/ipv6/hdr
"make" -C /home/leandro/Work/RIOT/sys/net/sock
"make" -C /home/leandro/Work/RIOT/sys/net/transport_layer/udp
"make" -C /home/leandro/Work/RIOT/sys/posix/inet
"make" -C /home/leandro/Work/RIOT/sys/random
"make" -C /home/leandro/Work/RIOT/sys/random/tinymt32
"make" -C /home/leandro/Work/RIOT/sys/test_utils/interactive_sync
"make" -C /home/leandro/Work/RIOT/sys/xtimer
"make" -C /home/leandro/Work/RIOT/tests/unittests/tests-gcoap
text data bss dec hex filename
54727 1284 47840 103851 195ab /home/leandro/Work/RIOT/tests/unittests/bin/native/tests_unittests.elf
r
/home/leandro/Work/RIOT/tests/unittests/bin/native/tests_unittests.elf
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.
main(): This is RIOT! (Version: 2020.04-devel-110-g8ccc4-coap/add_uquery_opt)
Help: Press s to start test, r to print it is ready
READY
s
START
...........
OK (11 tests)
So, change the second commit to this?
I like In general as a result of #9309 there's a larger issue of what tests belong in nanocoap vs. gcoap. nanocoap also has become so large that its tests can be sub-divided along functional lines in the future. |
I agree, let's do it this way, as |
Pushed test fixups as discussed. There are four commits now. If it looks good, I will squash down to these three:
|
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.
Changes look good. Unit tests for nanocoap and gcoap still pass. ACK.
@kb2ma please squash down to the commits you mentioned.
82563d8
to
bd73f12
Compare
bd73f12
to
b354722
Compare
Squashed and rebased due to recent changes for Kconfig. |
Contribution description
#9309 is a tracking issue for the migration of CoAP Option functionality to the nanocoap Packet API. The last remaining function for the migration is
gcoap_add_qstring()
. This PR addscoap_opt_add_uquery()
to nanocoap, renamed to be more descriptive and conform to the Packet API naming convention. We plan to create a follow-on PR to migrate existing uses and deprecategcoap_add_qstring()
.Testing procedure
Build the documentation to ensure the new function appears as part of the Options Write Packet API section of the nanocoap documentation. Also run the gcoap unit tests.
Issues/PRs references
Part of #9309.