Skip to content

Commit 2c0cf4a

Browse files
jukkarjhedberg
authored andcommitted
net: midi2: Do not use poll from posix
As midi2 is provided by networking subsystem it should not depend on any features provided by Posix. Convert Posix poll API calls to zsock poll ones. There is no functionality changes, only naming changes. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
1 parent c294fc5 commit 2c0cf4a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/zephyr/net/midi2.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <stdint.h>
3232
#include <zephyr/audio/midi.h>
3333
#include <zephyr/net/socket.h>
34-
#include <zephyr/posix/poll.h>
3534

3635
/**
3736
* Size, in bytes, of the nonce sent to the client for authentication
@@ -214,7 +213,7 @@ struct netmidi2_ep {
214213
struct sockaddr_in6 addr6;
215214
};
216215
/** The listening socket wrapped in a poll descriptor */
217-
struct pollfd pollsock;
216+
struct zsock_pollfd pollsock;
218217
/** The function to call when data is received from a client */
219218
void (*rx_packet_cb)(struct netmidi2_session *session,
220219
const struct midi_ump ump);

subsys/net/lib/midi2/netmidi2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static void netmidi2_service_handler(struct net_socket_service_event *pev)
714714
{
715715
int ret;
716716
struct netmidi2_ep *ep = pev->user_data;
717-
struct pollfd *pfd = &pev->event;
717+
struct zsock_pollfd *pfd = &pev->event;
718718
struct sockaddr peer_addr;
719719
socklen_t peer_addr_len = sizeof(peer_addr);
720720
struct net_buf *rxbuf;
@@ -798,7 +798,7 @@ int netmidi2_host_ep_start(struct netmidi2_ep *ep)
798798
}
799799

800800
ep->pollsock.fd = sock;
801-
ep->pollsock.events = POLLIN;
801+
ep->pollsock.events = ZSOCK_POLLIN;
802802
ret = net_socket_service_register(&netmidi2_service, &ep->pollsock, 1, ep);
803803
if (ret < 0) {
804804
zsock_close(sock);

0 commit comments

Comments
 (0)