Skip to content

Commit 7ebaa8e

Browse files
author
Arto Kinnunen
authored
Add Nanostack configuration for WS (ARMmbed#1961)
-Add WS configuration files for border_router and router -Fix compilation warnings
1 parent e20028a commit 7ebaa8e

File tree

21 files changed

+156
-11
lines changed

21 files changed

+156
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ clean-extra: $(CLEANTESTDIRS)
109109
# 3. TBD: importing to mbed OS
110110

111111
TARGET_DIR:=release
112-
CONFIGURATIONS_TO_BUILD:=lowpan_border_router lowpan_host lowpan_router nanostack_full thread_border_router thread_router thread_end_device ethernet_host
112+
CONFIGURATIONS_TO_BUILD:=lowpan_border_router lowpan_host lowpan_router nanostack_full thread_border_router thread_router thread_end_device ethernet_host ws_border_router ws_router
113113
TOOLCHAINS_TO_BUILD:=GCC ARM ARMC6 IAR
114114
CORES_TO_BUILD:=Cortex-M0 Cortex-M3
115115

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,8 @@ static void lowpan_mle_receive_security_bypass_cb(int8_t interface_id, mle_messa
14081408
pana_reset_client_session();
14091409
bootsrap_next_state_kick(ER_PANA_AUTH_ERROR, interface);
14101410
}
1411+
#else
1412+
(void)mle_msg;
14111413
#endif
14121414
}
14131415

source/6LoWPAN/ND/nd_router_object.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ buffer_t *nd_dar_parse(buffer_t *buf, protocol_interface_info_entry_t *cur_inter
831831
}
832832

833833
drop:
834+
#else
835+
(void)cur_interface;
834836
#endif
835837

836838
return buffer_free(buf);

source/6LoWPAN/Thread/thread_test_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ int thread_test_version_set(int8_t interface_id, uint8_t version)
634634
return 0;
635635

636636
#else
637+
(void)version;
637638
(void)interface_id;
638639
return -1;
639640
#endif
@@ -1358,6 +1359,8 @@ int thread_test_mle_message_send(int8_t interface_id, uint8_t *dst_address, uint
13581359
(void)msg_id;
13591360
(void)write_src_addr;
13601361
(void)write_leader_data;
1362+
(void)write_network_data;
1363+
(void)write_timestamp;
13611364
(void)write_operational_set;
13621365
(void)write_challenge;
13631366
(void)msg_ptr;

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#define RPL_INSTANCE_ID 1
4343

44-
#ifdef HAVE_WS
44+
#ifdef HAVE_WS_BORDER_ROUTER
4545

4646

4747
/* when creating BBR make ULA dodag ID always and when network becomes available add prefix to DHCP
@@ -426,15 +426,15 @@ uint16_t ws_bbr_pan_size(protocol_interface_info_entry_t *cur)
426426
}
427427

428428

429-
#endif //HAVE_WS
429+
#endif //HAVE_WS_BORDER_ROUTER
430430

431431
/* Public APIs
432432
*
433433
*/
434434

435435
int ws_bbr_start(int8_t interface_id, int8_t bb_interface_id)
436436
{
437-
#ifdef HAVE_WS
437+
#ifdef HAVE_WS_BORDER_ROUTER
438438

439439
(void)interface_id;
440440
protocol_interface_info_entry_t *bb_interface = protocol_stack_interface_info_get_by_id(bb_interface_id);
@@ -448,13 +448,14 @@ int ws_bbr_start(int8_t interface_id, int8_t bb_interface_id)
448448

449449
return 0;
450450
#else
451+
(void)interface_id;
451452
(void)bb_interface_id;
452453
return -1;
453454
#endif
454455
}
455456
void ws_bbr_stop(int8_t interface_id)
456457
{
457-
#ifdef HAVE_WS
458+
#ifdef HAVE_WS_BORDER_ROUTER
458459

459460
(void)interface_id;
460461
backbone_interface_id = -1;

source/6LoWPAN/ws/ws_bbr_api_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define WS_BBR_API_PRIVATE_H_
2020

2121

22-
#ifdef HAVE_WS
22+
#ifdef HAVE_WS_BORDER_ROUTER
2323

2424
extern uint16_t test_pan_size_override;
2525

@@ -34,9 +34,9 @@ void ws_bbr_rpl_config(uint8_t imin, uint8_t doubling, uint8_t redundancy);
3434
#else
3535

3636
#define ws_bbr_seconds_timer( cur, seconds)
37-
#define ws_bbr_pan_size(cur)
37+
#define ws_bbr_pan_size(cur) 0
3838
#define ws_bbr_rpl_config( imin, doubling, redundancy);
3939

40-
#endif //HAVE_WS
40+
#endif //HAVE_WS_BORDER_ROUTER
4141

4242
#endif /* WS_BBR_API_PRIVATE_H_ */

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ static int8_t ws_bootstrap_down(protocol_interface_info_entry_t *cur)
681681
// Reset WS information
682682
// ws_common_reset(cur)
683683
ws_llc_reset(cur);
684-
nd_proxy_downstream_interface_unregister(cur->id);
684+
if (nd_proxy_downstream_interface_unregister(cur->id) != 0) {
685+
tr_warn("nd proxy unregister failed");
686+
}
685687
ws_nud_table_reset(cur);
686688
dhcp_client_delete(cur->id);
687689
ws_eapol_relay_delete(cur);

source/6LoWPAN/ws/ws_test_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ int ws_test_pan_size_set(int8_t interface_id, uint16_t pan_size)
3838
{
3939

4040
(void) interface_id;
41+
#ifdef HAVE_WS_BORDER_ROUTER
4142
test_pan_size_override = pan_size;
4243
return 0;
44+
#else
45+
(void) pan_size;
46+
return -1;
47+
#endif
4348
}
4449

4550
int ws_test_max_child_count_set(int8_t interface_id, uint16_t child_count)

source/Core/address.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ static bool addr_is_ipv4_mapped(const uint8_t addr[static 16])
176176
/* Scope(A), as defined in RFC 6724 plus RFC 4007 */
177177
uint_fast8_t addr_ipv6_scope(const uint8_t addr[static 16], const protocol_interface_info_entry_t *interface)
178178
{
179+
#ifndef HAVE_THREAD
180+
(void)interface;
181+
#endif
179182
if (addr_is_ipv6_multicast(addr)) {
180183
return addr_ipv6_multicast_scope(addr);
181184
}

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,9 +1600,9 @@ static int8_t mcps_generic_packet_build(protocol_interface_rf_mac_setup_s *rf_pt
16001600
return 0;
16011601
}
16021602

1603-
16041603
int8_t mcps_generic_ack_build(protocol_interface_rf_mac_setup_s *rf_ptr, const mac_fcf_sequence_t *fcf, const uint8_t *data_ptr, const mcps_ack_data_payload_t *ack_payload, uint32_t rx_time)
16051604
{
1605+
(void)rx_time;
16061606
phy_device_driver_s *dev_driver = rf_ptr->dev_driver->phy_driver;
16071607
dev_driver_tx_buffer_s *tx_buf = &rf_ptr->dev_driver_tx_buffer;
16081608

0 commit comments

Comments
 (0)