From 24dc124384d78587aea010c3ee245955b9283517 Mon Sep 17 00:00:00 2001
From: Andreas Gattringer <andreas.gattringer@univie.ac.at>
Date: Tue, 16 Apr 2024 09:28:40 +0200
Subject: [PATCH] w5550: added method to set network properties directly

---
 umnp/microcontroller/devices/network/ethernet_w5500.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/umnp/microcontroller/devices/network/ethernet_w5500.py b/umnp/microcontroller/devices/network/ethernet_w5500.py
index bc54763..29de738 100644
--- a/umnp/microcontroller/devices/network/ethernet_w5500.py
+++ b/umnp/microcontroller/devices/network/ethernet_w5500.py
@@ -31,6 +31,9 @@ class EthernetW5500(EthernetAdapter):
         if dhcp:
             self.enable_dhcp()
 
+    def set_network(self, ip: str, subnet_mask: str, gateway: str, dns: str):
+        self._nic.ifconfig((ip, subnet_mask, gateway, dns))
+
     def enable_dhcp(self):
         while True:
             print("Requesting IP via DHCP")
-- 
GitLab