/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2025-present Eclipse ThreadX Contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Component */ /** */ /** User Datagram Protocol (UDP) */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SOURCE_CODE /* Include necessary system files. */ #include "nx_api.h" #include "nx_udp.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nxe_udp_socket_receive_notify PORTABLE C */ /* 6.4.3 */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function checks for errors in the UDP socket receive notify */ /* function call. */ /* */ /* INPUT */ /* */ /* socket_ptr Pointer to UDP socket */ /* udp_receive_notify Routine to call when one or */ /* more received packets are */ /* available for the socket */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _nx_udp_socket_receive_notify Actual socket receive notify */ /* function */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /**************************************************************************/ UINT _nxe_udp_socket_receive_notify(NX_UDP_SOCKET *socket_ptr, VOID (*udp_receive_notify)(NX_UDP_SOCKET *socket_ptr)) { UINT status; /* Check for invalid input pointers. */ if ((socket_ptr == NX_NULL) || (socket_ptr -> nx_udp_socket_id != NX_UDP_ID)) { return(NX_PTR_ERROR); } /* Call actual socket receive notify function. */ status = _nx_udp_socket_receive_notify(socket_ptr, udp_receive_notify); /* Return to caller. */ return(status); }