Skip to content

Commit

Permalink
Merge pull request #255 from xkevin190/rpl_modifications
Browse files Browse the repository at this point in the history
firmware: rpl fixed routing
  • Loading branch information
xkevin190 authored May 27, 2022
2 parents 48046b5 + 036b5ab commit 8a855db
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/mesh4all_rpl/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
menu "example configuration"

rsource "../../firmware/sys/Kconfig"
rsource "../../firmware/network/Kconfig"

menu "Interface"
#comment "Interface wifi and Radio"
config WIFI_SUBSYSTEM
bool "Wifi-Subsytem Interface"
default y

config IEEE_802154
bool "Radio Interface"
default n
endmenu #interface
endmenu
42 changes: 42 additions & 0 deletions examples/mesh4all_rpl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
APPLICATION = mesh4all-rpl
BOARD ?= m4a-24g

# Current path
APPBASE ?= $(CURDIR)

# RIOT-OS's base path
RIOTBASE ?= $(CURDIR)/../../RIOT

# Custom boards "MUST BE" into "boards" folder, it's code **strongly** hardware dependent
EXTERNAL_BOARD_DIRS ?= $(CURDIR)/../../boards

# If We need custom actions, routines, etc **SHOULD BE** included in the "core" folder
# and "MUST BE" code hardware independent
# EXTERNAL_MODULE_DIRS += $(CURDIR)/../core

DEVHELP ?= 1
QUIET ?= 1

# Modules
USEMODULE += saul_default
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps

# Custom modules
# Note: this code is hardware independent but "COULD BE" configurable for a
# target board

USEMODULE += rpl_protocol
USEMODULE += radio
USEMODULE += gnrc_icmpv6_echo
USEMODULE += at_client

EXTERNAL_MODULE_DIRS += $(CURDIR)/../../firmware/peripherals
EXTERNAL_MODULE_DIRS += $(CURDIR)/../../firmware/network
EXTERNAL_MODULE_DIRS += $(CURDIR)/../../firmware/sys

# Use UART_DEV(1) for slipdev as a default, baudrate by default is 115200


include $(RIOTBASE)/Makefile.include
49 changes: 49 additions & 0 deletions examples/mesh4all_rpl/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2022 Mesh4all <mesh4all.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @brief Main firmware file
*
* @author xkevin190 <kevinvelasco193@gmail.com>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "shell.h"
#include "shell_commands.h"
#include "log.h"

#include "rpl_protocol.h"

#define MAIN_QUEUE_SIZE (8)

msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
shell_command_t shell_extended_commands[] = {{NULL, NULL, NULL}};

int main(void) {
LOG_INFO("~~ Welcome to rpl exam ~~\n");
/* Start shell */
char line_buf[SHELL_DEFAULT_BUFSIZE];
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);

rpl_setup();

shell_run(shell_extended_commands, line_buf, SHELL_DEFAULT_BUFSIZE);

return 0;
}
2 changes: 2 additions & 0 deletions firmware/network/radio/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,13 @@ int8_t initial_radio_setup(void) {
int16_t radio_tx = CONFIG_TX_POWER;
int16_t radio_channel = CONFIG_RADIO_CHANNEL;

#ifdef CONFIG_IS_DODAG
err = set_global_ipv6_to_radio();
if (err == -1) {
printf("Error: Failed to add global address.\n");
return err;
}
#endif

err = set_netopt_tx_power(radio_tx);
if (err == -1) {
Expand Down
1 change: 1 addition & 0 deletions firmware/network/rpl_protocol/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ USEMODULE += gnrc_rpl
USEMODULE += auto_init_gnrc_rpl
USEMODULE += radio
USEMODULE += uniqueid
USEMODULE += gnrc_ipv6_router_default

0 comments on commit 8a855db

Please # to comment.