diff --git a/C/src/xplaneConnect.c b/C/src/xplaneConnect.c index e69d50b..1831929 100755 --- a/C/src/xplaneConnect.c +++ b/C/src/xplaneConnect.c @@ -137,6 +137,12 @@ void closeUDP(XPCSocket sock) } } +/// Sends the given data to the X-Plane plugin. +/// +/// \param sock The socket to use to send the data. +/// \param buffer A pointer to the data to send. +/// \param len The number of bytes to send. +/// \returns If an error occurs, a negative number. Otehrwise, the number of bytes sent. int sendUDP(XPCSocket sock, char buffer[], int len) { // Preconditions @@ -165,6 +171,12 @@ int sendUDP(XPCSocket sock, char buffer[], int len) return result; } +/// Reads a datagram from the specified socket. +/// +/// \param sock The socket to read from. +/// \param buffer A pointer to the location to store the data. +/// \param len The number of bytes to read. +/// \returns If an error occurs, a negative number. Otehrwise, the number of bytes read. int readUDP(XPCSocket sock, char buffer[], int len) { #ifdef _WIN32 diff --git a/C/src/xplaneConnect.h b/C/src/xplaneConnect.h index 6c967c4..3a2a02e 100644 --- a/C/src/xplaneConnect.h +++ b/C/src/xplaneConnect.h @@ -84,22 +84,6 @@ XPCSocket openUDP(const char *xpIP, unsigned short xpPort, unsigned short port); /// \param sock The socket to close. void closeUDP(XPCSocket sock); -/// Sends the given data to the X-Plane plugin. -/// -/// \param sock The socket to use to send the data. -/// \param buffer A pointer to the data to send. -/// \param len The number of bytes to send. -/// \returns If an error occurs, a negative number. Otehrwise, the number of bytes sent. -int sendUDP(XPCSocket sock, char buffer[], int len); - -/// Reads a datagram from the specified socket. -/// -/// \param sock The socket to read from. -/// \param buffer A pointer to the location to store the data. -/// \param len The number of bytes to read. -/// \returns If an error occurs, a negative number. Otehrwise, the number of bytes read. -int readUDP(XPCSocket sock, char buffer[], int len); - // Configuration /// Sets the port on which the socket sends and receives data.