From 0c85b05aca4d7a1adc8f5bf1a85133c845ecc63f Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Sun, 6 Sep 2020 09:54:22 +0200 Subject: [PATCH] continued win bridge --- osal/host/TmTcWinUdpBridge.cpp | 24 ++++++++++++++++++++---- osal/host/TmTcWinUdpBridge.h | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/osal/host/TmTcWinUdpBridge.cpp b/osal/host/TmTcWinUdpBridge.cpp index b7b43b13..4bb9a3b1 100644 --- a/osal/host/TmTcWinUdpBridge.cpp +++ b/osal/host/TmTcWinUdpBridge.cpp @@ -19,8 +19,8 @@ TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId, // Set up UDP socket: https://man7.org/linux/man-pages/man7/ip.7.html //clientSocket = socket(AF_INET, SOCK_DGRAM, 0); serverSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if(socket < 0) { - sif::error << "TmTcUnixUdpBridge::TmTcUnixUdpBridge: Could not open" + if(serverSocket != 0) { + sif::error << "TmTcWinUdpBridge::TmTcWinUdpBridge: Could not open" " UDP socket!" << std::endl; handleSocketError(); return; @@ -32,7 +32,7 @@ TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId, //serverAddress.sin_addr.s_addr = inet_addr("127.73.73.0"); serverAddress.sin_addr.s_addr = htonl(INADDR_ANY); serverAddress.sin_port = htons(setServerPort); - //serverAddressLen = sizeof(serverAddress); + serverAddressLen = sizeof(serverAddress); setsockopt(serverSocket, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&serverSocketOptions), sizeof(serverSocketOptions)); @@ -40,7 +40,7 @@ TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId, clientAddress.sin_family = AF_INET; clientAddress.sin_addr.s_addr = htonl(INADDR_ANY); clientAddress.sin_port = htons(setClientPort); - //clientAddressLen = sizeof(clientAddress); + clientAddressLen = sizeof(clientAddress); int result = bind(serverSocket, reinterpret_cast(&serverAddress), @@ -54,4 +54,20 @@ TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId, } } +TmTcWinUdpBridge::~TmTcWinUdpBridge() {} +void TmTcWinUdpBridge::handleSocketError() { +} + +void TmTcWinUdpBridge::handleBindError() { +} + +ReturnValue_t TmTcWinUdpBridge::sendTm(const uint8_t *data, size_t dataLen) { + return HasReturnvaluesIF::RETURN_OK; +} + +void TmTcWinUdpBridge::checkAndSetClientAddress(sockaddr_in clientAddress) { +} + +void TmTcWinUdpBridge::handleSendError() { +} diff --git a/osal/host/TmTcWinUdpBridge.h b/osal/host/TmTcWinUdpBridge.h index 66463065..8e6bb0fd 100644 --- a/osal/host/TmTcWinUdpBridge.h +++ b/osal/host/TmTcWinUdpBridge.h @@ -28,10 +28,10 @@ private: const int serverSocketOptions = 0; struct sockaddr_in clientAddress; - //socklen_t clientAddressLen = 0; + int clientAddressLen = 0; struct sockaddr_in serverAddress; - //socklen_t serverAddressLen = 0; + int serverAddressLen = 0; //! Access to the client address is mutex protected as it is set //! by another task.