Skip to content

Commit 3cc9fc5

Browse files
committed
Bump edgehog and zephyr
Signed-off-by: Simone Orru <simone.orru@secomind.com>
1 parent 02027d5 commit 3cc9fc5

4 files changed

Lines changed: 53 additions & 5 deletions

File tree

app/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ CONFIG_ZVFS_OPEN_MAX=16
149149

150150
CONFIG_POSIX_TIMERS=y
151151
CONFIG_SNTP=y
152-
CONFIG_POSIX_CLOCK=y # deprecated but needed for the config below
153152
CONFIG_NET_CONFIG_CLOCK_SNTP_INIT=y
154153
CONFIG_NET_CONFIG_SNTP_INIT_SERVER="0.pool.ntp.org"
155154
CONFIG_NET_CONFIG_SNTP_INIT_TIMEOUT=3000

app/src/eth.c

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
#include "eth.h"
88

99
#include <zephyr/kernel.h>
10-
#include <zephyr/logging/log.h>
1110
#include <zephyr/net/ethernet.h>
1211
#include <zephyr/net/ethernet_mgmt.h>
12+
#include <zephyr/version.h>
13+
14+
#include <zephyr/logging/log.h>
1315
LOG_MODULE_REGISTER(eth, CONFIG_APP_LOG_LEVEL); // NOLINT
1416

1517
/************************************************
@@ -30,8 +32,13 @@ static K_SEM_DEFINE(ipv4_address_obtained, 0, 1);
3032
* Callbacks declaration/definition *
3133
***********************************************/
3234

35+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
36+
static void eth_mgmt_event_handler(
37+
struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface)
38+
#else
3339
static void eth_mgmt_event_handler(
3440
struct net_mgmt_event_callback *event_cb, uint32_t mgmt_event, struct net_if *iface)
41+
#endif
3542
{
3643
(void) event_cb;
3744
(void) iface;
@@ -55,14 +62,23 @@ static void eth_mgmt_event_handler(
5562
break;
5663

5764
default:
65+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
66+
LOG_DBG("Status network event: %lld.", mgmt_event); // NOLINT
67+
#else
5868
LOG_DBG("Status network event: %d.", mgmt_event); // NOLINT
69+
#endif
5970
break;
6071
}
6172
// NOLINTEND(hicpp-signed-bitwise)
6273
}
6374

75+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
76+
static void status_mgmt_event_handler(
77+
struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface)
78+
#else
6479
static void status_mgmt_event_handler(
6580
struct net_mgmt_event_callback *event_cb, uint32_t mgmt_event, struct net_if *iface)
81+
#endif
6682
{
6783
(void) event_cb;
6884
(void) iface;
@@ -86,20 +102,30 @@ static void status_mgmt_event_handler(
86102
break;
87103

88104
default:
105+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
106+
LOG_DBG("Status network event: %lld.", mgmt_event); // NOLINT
107+
#else
89108
LOG_DBG("Status network event: %d.", mgmt_event); // NOLINT
109+
#endif
90110
break;
91111
}
92112
// NOLINTEND(hicpp-signed-bitwise)
93113
}
94114

115+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
116+
static void ipv6_mgmt_event_handler(
117+
struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface)
118+
#else
95119
static void ipv6_mgmt_event_handler(
96120
struct net_mgmt_event_callback *event_cb, uint32_t mgmt_event, struct net_if *iface)
121+
#endif
97122
{
98123
(void) event_cb;
99124
(void) iface;
100125

101126
// NOLINTBEGIN(hicpp-signed-bitwise)
102127
switch (mgmt_event) {
128+
103129
case NET_EVENT_IPV6_ADDR_ADD:
104130
LOG_DBG("IPv6 network event: NET_EVENT_IPV6_ADDR_ADD."); // NOLINT
105131
break;
@@ -177,20 +203,30 @@ static void ipv6_mgmt_event_handler(
177203
break;
178204

179205
default:
206+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
207+
LOG_DBG("IPv6 network event: %lld.", mgmt_event); // NOLINT
208+
#else
180209
LOG_DBG("IPv6 network event: %d.", mgmt_event); // NOLINT
210+
#endif
181211
break;
182212
}
183213
// NOLINTEND(hicpp-signed-bitwise)
184214
}
185215

216+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
217+
static void ipv4_mgmt_event_handler(
218+
struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface)
219+
#else
186220
static void ipv4_mgmt_event_handler(
187221
struct net_mgmt_event_callback *event_cb, uint32_t mgmt_event, struct net_if *iface)
222+
#endif
188223
{
189224
(void) event_cb;
190225
(void) iface;
191226

192227
// NOLINTBEGIN(hicpp-signed-bitwise)
193228
switch (mgmt_event) {
229+
194230
case NET_EVENT_IPV4_ADDR_ADD:
195231
LOG_DBG("Network event: NET_EVENT_IPV4_ADDR_ADD."); // NOLINT
196232
k_sem_give(&ipv4_address_obtained);
@@ -238,20 +274,30 @@ static void ipv4_mgmt_event_handler(
238274
break;
239275

240276
default:
277+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
278+
LOG_DBG("Network event: %lld.", mgmt_event); // NOLINT
279+
#else
241280
LOG_DBG("Network event: %d.", mgmt_event); // NOLINT
281+
#endif
242282
break;
243283
}
244284
// NOLINTEND(hicpp-signed-bitwise)
245285
}
246286

287+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
288+
static void l4_mgmt_event_handler(
289+
struct net_mgmt_event_callback *event_cb, uint64_t mgmt_event, struct net_if *iface)
290+
#else
247291
static void l4_mgmt_event_handler(
248292
struct net_mgmt_event_callback *event_cb, uint32_t mgmt_event, struct net_if *iface)
293+
#endif
249294
{
250295
(void) event_cb;
251296
(void) iface;
252297

253298
// NOLINTBEGIN(hicpp-signed-bitwise)
254299
switch (mgmt_event) {
300+
255301
case NET_EVENT_L4_CONNECTED:
256302
LOG_DBG("Network event: NET_EVENT_L4_CONNECTED."); // NOLINT
257303
break;
@@ -273,7 +319,11 @@ static void l4_mgmt_event_handler(
273319
break;
274320

275321
default:
322+
#if (KERNEL_VERSION_MAJOR >= 4) && (KERNEL_VERSION_MINOR >= 2)
323+
LOG_DBG("Network event: %lld.", mgmt_event); // NOLINT
324+
#else
276325
LOG_DBG("Network event: %d.", mgmt_event); // NOLINT
326+
#endif
277327
break;
278328
}
279329
// NOLINTEND(hicpp-signed-bitwise)

app/src/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ LOG_MODULE_REGISTER(cpu_metrics_app, CONFIG_APP_LOG_LEVEL);
2727
#endif
2828
#include <edgehog_device/device.h>
2929
#include <edgehog_device/telemetry.h>
30-
#include <edgehog_device/wifi_scan.h>
3130

3231
#include "eth.h"
3332
#include "generated_interfaces.h"

west.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ manifest:
1111
projects:
1212
- name: zephyr
1313
remote: zephyrproject-rtos
14-
revision: v4.1.0
14+
revision: v4.2.1
1515
import: true
1616
- name: edgehog-device-manager
1717
remote: edgehog-device-manager
1818
repo-path: edgehog-zephyr-device.git
19-
revision: v0.8.0
19+
revision: v0.9.0
2020
import: true

0 commit comments

Comments
 (0)