Re-add set_mac/ip/subnet/gateway example
This commit is contained in:
parent
c069211e72
commit
123c44b385
1 changed files with 9 additions and 0 deletions
|
|
@ -13,6 +13,15 @@ Below some really basic usage how I am ca using it:
|
|||
)
|
||||
.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<UdpSocket> = w5500.as_mut().and_then(|w5500| {
|
||||
let mut w5500: ActiveW5500<_> = w5500.activate(&mut spi).ok()?;
|
||||
let socket0: UninitializedSocket = w5500.take_socket(Socket::Socket0)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue