Skip to content

Commit c8141bb

Browse files
bors[bot]thvdveldDirbaio
authored
Merge #469
469: Add IEEE 802.15.4/6LoWPAN support r=Dirbaio a=thibautvdv This adds the IEEE 802.15.4 frame representation. Still a work in progress and interested to know what you think about this. I really would like to add 6LowPAN as well, however I'm not sure where to put this in smoltcp, since 6LowPAN is kind of weird. Co-authored-by: Thibaut Vandervelden <[email protected]> Co-authored-by: Dario Nieuwenhuis <[email protected]>
2 parents 5dbfc42 + bc2934d commit c8141bb

36 files changed

+3769
-259
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373

7474
features:
7575
# These feature sets cannot run tests, so we only check they build.
76-
- rand-custom-impl medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
76+
- rand-custom-impl medium-ip medium-ethernet medium-ieee802154 proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
7777
- rand-custom-impl defmt defmt-trace medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp async
7878

7979
steps:

Cargo.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,24 @@ verbose = []
3737
rand-custom-impl = []
3838
"medium-ethernet" = ["socket"]
3939
"medium-ip" = ["socket"]
40-
"phy-raw_socket" = ["std", "libc", "medium-ethernet"]
40+
"medium-ieee802154" = ["socket", "proto-sixlowpan"]
41+
42+
"phy-raw_socket" = ["std", "libc"]
4143
"phy-tuntap_interface" = ["std", "libc", "medium-ethernet"]
44+
4245
"proto-ipv4" = []
4346
"proto-igmp" = ["proto-ipv4"]
4447
"proto-dhcpv4" = ["proto-ipv4"]
4548
"proto-ipv6" = []
49+
"proto-sixlowpan" = ["proto-ipv6"]
50+
4651
"socket" = []
4752
"socket-raw" = ["socket"]
4853
"socket-udp" = ["socket"]
4954
"socket-tcp" = ["socket"]
5055
"socket-icmp" = ["socket"]
5156
"socket-dhcpv4" = ["socket", "medium-ethernet", "proto-dhcpv4"]
57+
5258
"async" = []
5359

5460
defmt-trace = []
@@ -59,9 +65,9 @@ defmt-error = []
5965

6066
default = [
6167
"std", "log", # needed for `cargo test --no-default-features --features default` :/
62-
"medium-ethernet", "medium-ip",
68+
"medium-ethernet", "medium-ip", "medium-ieee802154",
6369
"phy-raw_socket", "phy-tuntap_interface",
64-
"proto-ipv4", "proto-igmp", "proto-dhcpv4", "proto-ipv6",
70+
"proto-ipv4", "proto-igmp", "proto-dhcpv4", "proto-ipv6", "proto-sixlowpan",
6571
"socket-raw", "socket-icmp", "socket-udp", "socket-tcp", "socket-dhcpv4",
6672
"async"
6773
]
@@ -110,5 +116,9 @@ required-features = ["std", "medium-ethernet", "medium-ip", "phy-tuntap_interfac
110116
name = "dhcp_client"
111117
required-features = ["std", "medium-ethernet", "medium-ip", "phy-tuntap_interface", "proto-ipv4", "proto-dhcpv4", "socket-raw"]
112118

119+
[[example]]
120+
name = "sixlowpan"
121+
required-features = ["std", "medium-ieee802154", "phy-raw_socket", "proto-sixlowpan", "socket-udp"]
122+
113123
[profile.release]
114124
debug = 2

examples/benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn main() {
100100
let mut builder = InterfaceBuilder::new(device).ip_addrs(ip_addrs);
101101
if medium == Medium::Ethernet {
102102
builder = builder
103-
.ethernet_addr(ethernet_addr)
103+
.hardware_addr(ethernet_addr.into())
104104
.neighbor_cache(neighbor_cache);
105105
}
106106
let mut iface = builder.finalize();

examples/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn main() {
4747
.routes(routes);
4848
if medium == Medium::Ethernet {
4949
builder = builder
50-
.ethernet_addr(ethernet_addr)
50+
.hardware_addr(ethernet_addr.into())
5151
.neighbor_cache(neighbor_cache);
5252
}
5353
let mut iface = builder.finalize();

examples/dhcp_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn main() {
3939
.routes(routes);
4040
if medium == Medium::Ethernet {
4141
builder = builder
42-
.ethernet_addr(ethernet_addr)
42+
.hardware_addr(ethernet_addr.into())
4343
.neighbor_cache(neighbor_cache);
4444
}
4545
let mut iface = builder.finalize();

examples/httpclient.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn main() {
5353
.routes(routes);
5454
if medium == Medium::Ethernet {
5555
builder = builder
56-
.ethernet_addr(ethernet_addr)
56+
.hardware_addr(ethernet_addr.into())
5757
.neighbor_cache(neighbor_cache);
5858
}
5959
let mut iface = builder.finalize();

examples/loopback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn main() {
9595

9696
let mut ip_addrs = [IpCidr::new(IpAddress::v4(127, 0, 0, 1), 8)];
9797
let mut iface = InterfaceBuilder::new(device)
98-
.ethernet_addr(EthernetAddress::default())
98+
.hardware_addr(EthernetAddress::default().into())
9999
.neighbor_cache(neighbor_cache)
100100
.ip_addrs(ip_addrs)
101101
.finalize();

examples/multicast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn main() {
3838
let ip_addr = IpCidr::new(IpAddress::from(local_addr), 24);
3939
let mut ipv4_multicast_storage = [None; 1];
4040
let mut iface = InterfaceBuilder::new(device)
41-
.ethernet_addr(ethernet_addr)
41+
.hardware_addr(ethernet_addr.into())
4242
.neighbor_cache(neighbor_cache)
4343
.ip_addrs([ip_addr])
4444
.ipv4_multicast_groups(&mut ipv4_multicast_storage[..])

examples/ping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn main() {
132132
.routes(routes);
133133
if medium == Medium::Ethernet {
134134
builder = builder
135-
.ethernet_addr(ethernet_addr)
135+
.hardware_addr(ethernet_addr.into())
136136
.neighbor_cache(neighbor_cache);
137137
}
138138
let mut iface = builder.finalize();

examples/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn main() {
5959
let mut builder = InterfaceBuilder::new(device).ip_addrs(ip_addrs);
6060
if medium == Medium::Ethernet {
6161
builder = builder
62-
.ethernet_addr(ethernet_addr)
62+
.hardware_addr(ethernet_addr.into())
6363
.neighbor_cache(neighbor_cache);
6464
}
6565
let mut iface = builder.finalize();

0 commit comments

Comments
 (0)