We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d522b7 commit cc3dc59Copy full SHA for cc3dc59
src/netif.rs
@@ -391,6 +391,21 @@ impl EspNetif {
391
})
392
}
393
394
+ pub fn set_ip_info(&mut self, ip_info: ipv4::IpInfo) -> Result<(), EspError> {
395
+ let raw_ip_info: Newtype<esp_netif_ip_info_t> = ip_info.into();
396
+
397
+ unsafe { esp_netif_dhcpc_stop(self.0) }; // ignore error
398
+ unsafe { esp!(esp_netif_set_ip_info(self.0, &raw_ip_info.0)) }?;
399
+ if let Some(dns) = ip_info.dns {
400
+ self.set_dns(dns);
401
+ }
402
+ if let Some(dns) = ip_info.secondary_dns {
403
+ self.set_secondary_dns(dns);
404
405
406
+ Ok(())
407
408
409
pub fn get_key(&self) -> heapless::String<32> {
410
unsafe { from_cstr_ptr(esp_netif_get_ifkey(self.0)) }
411
.try_into()
0 commit comments