From 123c44b385d5d3c17993dcee100318b5d6439181 Mon Sep 17 00:00:00 2001 From: Michael Watzko Date: Sun, 17 Feb 2019 14:11:09 +0100 Subject: [PATCH] Re-add set_mac/ip/subnet/gateway example --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c8df125..96b19ed 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,15 @@ Below some really basic usage how I am ca using it: ArpResponses::Cache, ) .ok(); + + if let Some(ref mut w5500) = w5500 { + let mut w5500: ActiveW5500<_> = w5500.activate(&mut spi).unwrap(); + // using a 'locally administered' MAC address + active.set_mac(MacAddress::new(0x02, 0x01, 0x02, 0x03, 0x04, 0x05)).unwrap(); + active.set_ip(IpAddress::new(192, 168, 0, 222)).unwrap(); + active.set_subnet(IpAddress::new(255, 255, 255, 0)).unwrap(); + active.set_gateway(IpAddress::new(192, 168, 0, 1)).unwrap(); + } let mut udp_server_socket: Option = w5500.as_mut().and_then(|w5500| { let mut w5500: ActiveW5500<_> = w5500.activate(&mut spi).ok()?;