summaryrefslogtreecommitdiff
path: root/fw/src
diff options
context:
space:
mode:
Diffstat (limited to 'fw/src')
-rw-r--r--fw/src/main.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/fw/src/main.c b/fw/src/main.c
index 31dbf45..1dd5790 100644
--- a/fw/src/main.c
+++ b/fw/src/main.c
@@ -1,4 +1,35 @@
+#include <zephyr/logging/log.h>
+#include <zephyr/net/net_if.h>
+
+LOG_MODULE_REGISTER(main);
+
int main(void)
{
+ LOG_INF("Function main was started.");
+
+ struct net_if *iface = net_if_get_default();
+ if (iface == NULL) {
+ LOG_ERR("Could not find default network interface.");
+ goto FINISH;
+ }
+ LOG_DBG("Got default network interface pointer 0x%p", (void *)iface);
+
+ struct net_linkaddr *link_addr = net_if_get_link_addr(iface);
+ if (iface == NULL) {
+ LOG_ERR("Could not determine link address of default network interface.");
+ goto FINISH;
+ }
+ LOG_INF(
+ "Got link address of default network interface: %02x:%02x:%02x:%02x:%02x:%02x.",
+ link_addr->addr[0],
+ link_addr->addr[1],
+ link_addr->addr[2],
+ link_addr->addr[3],
+ link_addr->addr[4],
+ link_addr->addr[5]
+ );
+
+FINISH:
+ LOG_INF("Function main was finished.");
return 0;
}