MCPcopy Create free account
hub / github.com/ImplFerris/esp32-projects / create_interface

Function create_interface

wifi-webfetch/src/bin/main.rs:91–101  ·  view source on GitHub ↗
(device: &mut esp_radio::wifi::WifiDevice)

Source from the content-addressed store, hash-verified

89}
90
91pub fn create_interface(device: &mut esp_radio::wifi::WifiDevice) -> smoltcp::iface::Interface {
92 // users could create multiple instances but since they only have one WifiDevice
93 // they probably can't do anything bad with that
94 smoltcp::iface::Interface::new(
95 smoltcp::iface::Config::new(smoltcp::wire::HardwareAddress::Ethernet(
96 smoltcp::wire::EthernetAddress::from_bytes(&device.mac_address()),
97 )),
98 device,
99 timestamp(),
100 )
101}
102
103// some smoltcp boilerplate
104fn timestamp() -> smoltcp::time::Instant {

Callers 1

mainFunction · 0.85

Calls 1

timestampFunction · 0.85

Tested by

no test coverage detected