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

sys: net: add nanocoap #8123

Merged
merged 6 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -652,14 +652,18 @@ ifneq (,$(filter l2filter_%,$(USEMODULE)))
endif

ifneq (,$(filter gcoap,$(USEMODULE)))
USEPKG += nanocoap
USEMODULE += gnrc_sock_udp
USEMODULE += nanocoap
USEMODULE += gnrc_sock_udp
endif

ifneq (,$(filter luid,$(USEMODULE)))
FEATURES_OPTIONAL += periph_cpuid
endif

ifneq (,$(filter nanocoap_%,$(USEMODULE)))
USEMODULE += nanocoap
endif

# always select gpio (until explicit dependencies are sorted out)
FEATURES_OPTIONAL += periph_gpio

Expand Down
4 changes: 1 addition & 3 deletions examples/nanocoap_server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ USEMODULE += gnrc_sock_udp
# Additional networking modules that can be dropped if not needed
USEMODULE += gnrc_icmpv6_echo

USEPKG += nanocoap
# optionally enable nanocoap's debug output
#CFLAGS += -DNANOCOAP_DEBUG
USEMODULE += nanocoap_sock

# include this for nicely formatting the returned internal value
USEMODULE += fmt
Expand Down
2 changes: 1 addition & 1 deletion examples/nanocoap_server/coap_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <string.h>

#include "fmt.h"
#include "nanocoap.h"
#include "net/nanocoap.h"

/* internal value that can be read/written via CoAP */
static uint8_t internal_value = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/nanocoap_server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include <stdio.h>

#include "nanocoap.h"
#include "nanocoap_sock.h"
#include "net/nanocoap.h"
#include "net/nanocoap_sock.h"

#include "xtimer.h"

Expand Down
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ PSEUDOMODULES += lwip_tcp
PSEUDOMODULES += lwip_udp
PSEUDOMODULES += lwip_udplite
PSEUDOMODULES += mpu_stack_guard
PSEUDOMODULES += nanocoap_%
PSEUDOMODULES += netdev_default
PSEUDOMODULES += netif
PSEUDOMODULES += netstats
Expand Down
12 changes: 0 additions & 12 deletions pkg/nanocoap/Makefile

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/nanocoap/Makefile.include

This file was deleted.

5 changes: 0 additions & 5 deletions pkg/nanocoap/Makefile.nanocoap

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/nanocoap/doc.txt

This file was deleted.

3 changes: 3 additions & 0 deletions sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ endif
ifneq (,$(filter l2filter,$(USEMODULE)))
DIRS += net/link_layer/l2filter
endif
ifneq (,$(filter nanocoap,$(USEMODULE)))
DIRS += net/application_layer/nanocoap
endif

DIRS += $(dir $(wildcard $(addsuffix /Makefile, ${USEMODULE})))

Expand Down
4 changes: 3 additions & 1 deletion sys/include/net/gcoap.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@

#include <stdint.h>
#include <stdatomic.h>

#include "net/ipv6/addr.h"
#include "net/sock/udp.h"
#include "mutex.h"
#include "nanocoap.h"
#include "net/nanocoap.h"
#include "xtimer.h"

#ifdef __cplusplus
Expand Down
Loading