-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TinyDTLS integrated to RIOT (without sockets)
- All the commits haven been squashed. - The Makefile are upgraded for the lastet GNRC API version. - Fixed errors for Travis and Murdock.
- Loading branch information
Showing
7 changed files
with
1,110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# name of your application | ||
APPLICATION = dtls_echo | ||
|
||
# If no BOARD is found in the environment, use this default: | ||
BOARD ?= native | ||
|
||
# This has to be the absolute path to the RIOT base directory: | ||
RIOTBASE ?= $(CURDIR)/../.. | ||
|
||
BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ | ||
nrf6310 nucleo-f103 nucleo-f334 pca10000 pca10005 spark-core \ | ||
stm32f0discovery telosb weio wsn430-v1_3b wsn430-v1_4 \ | ||
yunjia-nrf51822 z1 nucleo-f072 | ||
|
||
# Include packages that pull up and auto-init the link layer. | ||
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present | ||
USEMODULE += gnrc_netdev_default | ||
USEMODULE += auto_init_gnrc_netif | ||
# Specify the mandatory networking modules for IPv6 and sUDP | ||
USEMODULE += gnrc_ipv6_router_default | ||
USEMODULE += gnrc_udp | ||
# Add a routing protocol | ||
USEMODULE += gnrc_rpl | ||
# This application dumps received packets to STDIO using the pktdump module | ||
USEMODULE += gnrc_pktdump | ||
# Additional networking modules that can be dropped if not needed | ||
USEMODULE += gnrc_icmpv6_echo | ||
# Add also the shell, some shell commands | ||
USEMODULE += shell | ||
USEMODULE += shell_commands | ||
USEMODULE += ps | ||
|
||
#This is from the original example, still not sure why is here. | ||
ifeq (,$(filter native,$(BOARD))) | ||
USEMODULE += pthread | ||
endif | ||
|
||
# NOTE: Add the package for TinyDTLS | ||
USEPKG += tinydtls | ||
|
||
# Comment this out to disable code in RIOT that does safety checking | ||
# which is not needed in a production environment but helps in the | ||
# development process: | ||
CFLAGS += -DDEVELHELP | ||
|
||
# NOTE: Those are taken from TinyDTLS (As the original Makefiles are | ||
# overwitten is a good idea to preserve them here. | ||
CFLAGS += -DDTLSv12 -DWITH_SHA256 | ||
# NOTE: The configuration for socket or non-socket can be handled here. | ||
CFLAGS += -DWITH_RIOT_GNRC | ||
|
||
# Change this to 0 show compiler invocation lines by default: | ||
QUIET ?= 1 | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# dtls_echo | ||
|
||
This example shows you how to use TinyDTLS with the non-socket approach. | ||
|
||
This code is based on ../gnrc_networking and ../gnrc_tftp. | ||
Is a good idea to read their README.md's for any doubt of how making the | ||
testings. | ||
|
||
## SOCKET vs. Non-socket (GNRC) | ||
|
||
This example is configured to use the GNRC instead of sockets (over GNRC). | ||
At the moment, the configuration must be done manually in the Makefile of | ||
this project. | ||
|
||
## Fast configuration (Between RIOT instances): | ||
|
||
Preparing the logical interfaces: | ||
|
||
./../../dist/tools/tapsetup/tapsetup --create 2 | ||
|
||
For the server instance: | ||
|
||
make all; PORT=tap1 make term | ||
dtlss start | ||
ifconfig | ||
|
||
Do not forget to copy the IPv6 addresses! | ||
|
||
For the client: | ||
|
||
PORT=tap0 make term | ||
dtlsc <IPv6's server address> "DATA TO DATA TO DATA!" |
Oops, something went wrong.