Skip to content

Commit 4b29cd0

Browse files
committed
samples: net: latmon: Use native networking API directly
This subsystem does not use the POSIX_API, and the sample only used one call to the POSIX API to close a socket instead of using the native networking API. Let's just use the native networking API, so we avoid pulling-in more dependencies. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 40a1c72 commit 4b29cd0

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

samples/net/latmon/prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# Copyright (c) 2025 Jorge Ramirez-Ortiz <[email protected]>
33

4-
CONFIG_POSIX_API=y
5-
64
# General config
75
CONFIG_LOG=y
86
CONFIG_GPIO=y

samples/net/latmon/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ LOG_MODULE_REGISTER(sample_latmon, LOG_LEVEL_DBG);
1313
#include <zephyr/net/socket.h>
1414
#include <zephyr/spinlock.h>
1515
#include <zephyr/sys/atomic.h>
16-
#include <zephyr/posix/unistd.h>
1716

1817
/*
1918
* Blink Control
@@ -267,7 +266,7 @@ int main(void)
267266
}
268267
out:
269268
k_thread_abort(blink_tid);
270-
close(socket);
269+
zsock_close(socket);
271270

272271
return ret;
273272
}

0 commit comments

Comments
 (0)