Skip to content

Commit

Permalink
Cleanup and migrate test to static ip
Browse files Browse the repository at this point in the history
  • Loading branch information
LasseRosenow committed Jan 22, 2025
1 parent b0b73fa commit 36a6fac
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 544 deletions.
23 changes: 0 additions & 23 deletions examples/riot/coap_federated/receiver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,7 @@ LF_REACTOR_CTOR_SIGNATURE(MainRecv) {

LF_ENTRY_POINT_FEDERATED(MainRecv, SEC(1), true, true, 1, false)

void print_ip_addresses(void) {
gnrc_netif_t *netif = gnrc_netif_iter(NULL);
char addr_str[IPV6_ADDR_MAX_STR_LEN];

while (netif) {
size_t max_addr_count = 4;
ipv6_addr_t addrs[max_addr_count];
gnrc_netif_ipv6_addrs_get(netif, addrs, max_addr_count * sizeof(ipv6_addr_t));

for (size_t i = 0; i < 2; i++) {
if (ipv6_addr_to_str(addr_str, &addrs[i], sizeof(addr_str))) {
LF_INFO(NET, "IPv6 address: %s", addr_str);
}
}

netif = gnrc_netif_iter(netif);
}
}

int main() {
#ifdef ONLY_PRINT_IP
print_ip_addresses();
#else
lf_start();
#endif
return 0;
}
23 changes: 0 additions & 23 deletions examples/riot/coap_federated/sender/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,7 @@ LF_REACTOR_CTOR_SIGNATURE(MainSender) {

LF_ENTRY_POINT_FEDERATED(MainSender, SEC(1), true, false, 1, true)

void print_ip_addresses(void) {
gnrc_netif_t *netif = gnrc_netif_iter(NULL);
char addr_str[IPV6_ADDR_MAX_STR_LEN];

while (netif) {
size_t max_addr_count = 4;
ipv6_addr_t addrs[max_addr_count];
gnrc_netif_ipv6_addrs_get(netif, addrs, max_addr_count * sizeof(ipv6_addr_t));

for (size_t i = 0; i < 2; i++) {
if (ipv6_addr_to_str(addr_str, &addrs[i], sizeof(addr_str))) {
LF_INFO(NET, "IPv6 address: %s", addr_str);
}
}

netif = gnrc_netif_iter(netif);
}
}

int main() {
#ifdef ONLY_PRINT_IP
print_ip_addresses();
#else
lf_start();
#endif
return 0;
}
143 changes: 0 additions & 143 deletions test/platform/riot/coap_channel_federated_test/left.txt

This file was deleted.

99 changes: 0 additions & 99 deletions test/platform/riot/coap_channel_federated_test/main.c

This file was deleted.

15 changes: 3 additions & 12 deletions test/platform/riot/coap_channel_federated_test/receiver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,8 @@ CFLAGS+= -DCONFIG_GCOAP_NO_RETRANS_BACKOFF=1
CFLAGS+= -DCONFIG_COAP_ACK_TIMEOUT_MS=400
CFLAGS+= -DCONFIG_COAP_MAX_RETRANSMIT=4

# Check if ONLY_PRINT_IP is defined
# If ONLY_PRINT_IP is defined the REMOTE_ADDRESS is not needed
ifdef ONLY_PRINT_IP
# ONLY_PRINT_IP is defined => Set CFLAGS for it
CFLAGS += -DONLY_PRINT_IP=$(ONLY_PRINT_IP)
else ifdef REMOTE_ADDRESS
# REMOTE_ADDRESS is defined => Set CFLAGS for it
CFLAGS += -DREMOTE_ADDRESS=\"$(REMOTE_ADDRESS)\"
else
# Neither is defined
$(error Either define REMOTE_ADDRESS or set ONLY_PRINT_IP=1 to print the IP-Address of this device.)
endif
# Static IPv6 address
CFLAGS += -DCONFIG_GNRC_IPV6_STATIC_LLADDR='"fe80::cafe:cafe:cafe:2"'
CFLAGS += -DCONFIG_GNRC_IPV6_STATIC_LLADDR_IS_FIXED=1

include $(CURDIR)/../../../../../make/riot/riot.mk
Empty file.
Loading

0 comments on commit 36a6fac

Please sign in to comment.