From ca2571464680d6fbef9e011c61fbcabe9b178e84 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:01:48 +0100 Subject: [PATCH 1/6] upstream coordinates taken over --- coordinates/CMakeLists.txt | 5 +++++ coordinates/Sgp4Propagator.h | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 coordinates/CMakeLists.txt diff --git a/coordinates/CMakeLists.txt b/coordinates/CMakeLists.txt new file mode 100644 index 00000000..a1fa1e52 --- /dev/null +++ b/coordinates/CMakeLists.txt @@ -0,0 +1,5 @@ +target_sources(${LIB_FSFW_NAME} + PRIVATE + CoordinateTransformations.cpp + Sgp4Propagator.cpp +) \ No newline at end of file diff --git a/coordinates/Sgp4Propagator.h b/coordinates/Sgp4Propagator.h index 3949547e..f813c6f4 100644 --- a/coordinates/Sgp4Propagator.h +++ b/coordinates/Sgp4Propagator.h @@ -1,7 +1,9 @@ #ifndef SGP4PROPAGATOR_H_ #define SGP4PROPAGATOR_H_ +#ifndef WIN32 #include +#endif #include "../contrib/sgp4/sgp4unit.h" #include "../returnvalues/HasReturnvaluesIF.h" From de61d0c3ac331e179d0839284f1b537acf56f825 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:02:13 +0100 Subject: [PATCH 2/6] upstream timeval op --- globalfunctions/timevalOperations.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/globalfunctions/timevalOperations.h b/globalfunctions/timevalOperations.h index 3977d5d9..db68f330 100644 --- a/globalfunctions/timevalOperations.h +++ b/globalfunctions/timevalOperations.h @@ -2,7 +2,12 @@ #define TIMEVALOPERATIONS_H_ #include + +#ifdef WIN32 +#include +#else #include +#endif timeval& operator+=(timeval& lhs, const timeval& rhs); From e511dc61b48b12d944302a781326ad79811dfd8b Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:02:41 +0100 Subject: [PATCH 3/6] upstream osal endiness adapted --- osal/Endiness.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osal/Endiness.h b/osal/Endiness.h index 55d0aeb3..9d3fdef0 100644 --- a/osal/Endiness.h +++ b/osal/Endiness.h @@ -1,10 +1,6 @@ #ifndef FRAMEWORK_OSAL_ENDINESS_H_ #define FRAMEWORK_OSAL_ENDINESS_H_ -/** - * @defgroup osal Operating System Abstraction Layer - * @brief Provides clean interfaces to use OS functionalities - */ /* * BSD-style endian declaration @@ -26,9 +22,23 @@ #else #error "Can't decide which end is which!" #endif +#else + +#ifdef WIN32 +#include +#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN +#define BYTE_ORDER_SYSTEM LITTLE_ENDIAN +#else +#define BYTE_ORDER_SYSTEM BIG_ENDIAN +#endif + + #else #error __BYTE_ORDER__ not defined #endif + +#endif + #endif From 30c9209c7488ac4bc69c1ee0bcd6424009d39c07 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:03:19 +0100 Subject: [PATCH 4/6] better win udp polling task error handling --- osal/windows/TcWinUdpPollingTask.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osal/windows/TcWinUdpPollingTask.cpp b/osal/windows/TcWinUdpPollingTask.cpp index 7b54bb2c..06deafd1 100644 --- a/osal/windows/TcWinUdpPollingTask.cpp +++ b/osal/windows/TcWinUdpPollingTask.cpp @@ -119,7 +119,7 @@ void TcWinUdpPollingTask::setTimeout(double timeoutSeconds) { int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(&timeoutMs), sizeof(DWORD)); if(result == -1) { - sif::error << "TcSocketPollingTask::TcSocketPollingTask: Setting " + sif::error << "TcWinUdpPollingTask::TcSocketPollingTask: Setting " "receive timeout failed with " << strerror(errno) << std::endl; } } @@ -128,17 +128,22 @@ void TcWinUdpPollingTask::handleReadError() { int error = WSAGetLastError(); switch(error) { case(WSANOTINITIALISED): { - sif::info << "TmTcWinUdpBridge::handleReadError: WSANOTINITIALISED: " + sif::info << "TcWinUdpPollingTask::handleReadError: WSANOTINITIALISED: " << "WSAStartup(...) call " << "necessary" << std::endl; break; } case(WSAEFAULT): { - sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: " + sif::info << "TcWinUdpPollingTask::handleReadError: WSADEFAULT: " << "Bad address " << std::endl; break; } + case(WSAEINVAL): { + sif::info << "TcWinUdpPollingTask::handleReadError: WSAEINVAL: " + << "Invalid input parameters. " << std::endl; + break; + } default: { - sif::info << "TmTcWinUdpBridge::handleReadError: Error code: " + sif::info << "TcWinUdpPollingTask::handleReadError: Error code: " << error << std::endl; break; } From a6e38afb98317abb7d0c592fe7be9edee1cbb356 Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:04:04 +0100 Subject: [PATCH 5/6] buffer more explicit eof() --- serviceinterface/ServiceInterfaceBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serviceinterface/ServiceInterfaceBuffer.h b/serviceinterface/ServiceInterfaceBuffer.h index c5d5b258..e69538d1 100644 --- a/serviceinterface/ServiceInterfaceBuffer.h +++ b/serviceinterface/ServiceInterfaceBuffer.h @@ -30,7 +30,7 @@ protected: //! This is called when buffer becomes full. If //! buffer is not used, then this is called every //! time when characters are put to stream. - int overflow(int c = Traits::eof()) override; + int overflow(int c = std::ostream::traits_type::eof()) override; //! This function is called when stream is flushed, //! for example when std::endl is put to stream. From 17a12b78073c98eb0abdce9f7c46df9c18e46fac Mon Sep 17 00:00:00 2001 From: Spacefish Date: Mon, 21 Dec 2020 14:05:44 +0100 Subject: [PATCH 6/6] clock update --- timemanager/Clock.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/timemanager/Clock.h b/timemanager/Clock.h index f4ed847a..9f6f9885 100644 --- a/timemanager/Clock.h +++ b/timemanager/Clock.h @@ -7,7 +7,12 @@ #include "../globalfunctions/timevalOperations.h" #include + +#ifdef WIN32 +#include +#else #include +#endif class Clock { public: