Merge branch 'mueller/master' of https://egit.irs.uni-stuttgart.de/KSat/fsfw into mueller/master

This commit is contained in:
Robin Müller 2020-12-21 23:39:34 +01:00
commit 8dd9d6ad91
7 changed files with 41 additions and 9 deletions

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CoordinateTransformations.cpp
Sgp4Propagator.cpp
)

View File

@ -1,7 +1,9 @@
#ifndef SGP4PROPAGATOR_H_
#define SGP4PROPAGATOR_H_
#ifndef WIN32
#include <sys/time.h>
#endif
#include "../contrib/sgp4/sgp4unit.h"
#include "../returnvalues/HasReturnvaluesIF.h"

View File

@ -2,7 +2,12 @@
#define TIMEVALOPERATIONS_H_
#include <stdint.h>
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
#endif
timeval& operator+=(timeval& lhs, const timeval& rhs);

View File

@ -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 <Windows.h>
#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

View File

@ -119,7 +119,7 @@ void TcWinUdpPollingTask::setTimeout(double timeoutSeconds) {
int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO,
reinterpret_cast<const char*>(&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;
}

View File

@ -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.

View File

@ -7,7 +7,12 @@
#include "../globalfunctions/timevalOperations.h"
#include <cstdint>
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
#endif
class Clock {
public: