new tmtc unix udp bridge #141

Merged
taheran merged 7 commits from KSat/fsfw:mueller/feature/TmTcUnixBridge into master 2020-09-08 14:14:01 +02:00
6 changed files with 111 additions and 103 deletions
Showing only changes of commit aec557a8c0 - Show all commits

View File

@ -90,3 +90,10 @@ double timevalOperations::toDouble(const timeval timeval) {
double result = timeval.tv_sec * 1000000. + timeval.tv_usec; double result = timeval.tv_sec * 1000000. + timeval.tv_usec;
return result / 1000000.; return result / 1000000.;
} }
timeval timevalOperations::toTimeval(const double seconds) {
timeval tval;
tval.tv_sec = seconds;
tval.tv_usec = seconds *(double) 1e6 - (tval.tv_sec *1e6);
return tval;
}

View File

@ -41,6 +41,7 @@ namespace timevalOperations {
* @return seconds * @return seconds
*/ */
double toDouble(const timeval timeval); double toDouble(const timeval timeval);
timeval toTimeval(const double seconds);
} }
#endif /* TIMEVALOPERATIONS_H_ */ #endif /* TIMEVALOPERATIONS_H_ */

View File

@ -1,5 +1,5 @@
#include <framework/osal/linux/TcUnixUdpPollingTask.h> #include "TcUnixUdpPollingTask.h"
#include <framework/globalfunctions/arrayprinter.h> #include "../../globalfunctions/arrayprinter.h"
TcUnixUdpPollingTask::TcUnixUdpPollingTask(object_id_t objectId, TcUnixUdpPollingTask::TcUnixUdpPollingTask(object_id_t objectId,
object_id_t tmtcUnixUdpBridge, size_t frameSize, object_id_t tmtcUnixUdpBridge, size_t frameSize,

View File

@ -1,9 +1,9 @@
#ifndef FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_ #ifndef FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#define FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_ #define FRAMEWORK_OSAL_LINUX_TCSOCKETPOLLINGTASK_H_
#include <framework/objectmanager/SystemObject.h> #include "../../objectmanager/SystemObject.h"
#include <framework/osal/linux/TmTcUnixUdpBridge.h> #include "../../osal/linux/TmTcUnixUdpBridge.h"
#include <framework/tasks/ExecutableObjectIF.h> #include "../../tasks/ExecutableObjectIF.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <vector> #include <vector>

View File

@ -1,6 +1,6 @@
#include <framework/osal/linux/TmTcUnixUdpBridge.h> #include "TmTcUnixUdpBridge.h"
#include <framework/serviceinterface/ServiceInterfaceStream.h> #include "../../serviceinterface/ServiceInterfaceStream.h"
#include <framework/ipc/MutexHelper.h> #include "../../ipc/MutexHelper.h"
#include <errno.h> #include <errno.h>
#include <arpa/inet.h> #include <arpa/inet.h>
@ -85,7 +85,7 @@ ReturnValue_t TmTcUnixUdpBridge::sendTm(const uint8_t *data, size_t dataLen) {
} }
void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in newAddress) { void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in newAddress) {
MutexHelper lock(mutex, 10); MutexHelper lock(mutex, MutexIF::TimeoutType::WAITING, 10);
// char ipAddress [15]; // char ipAddress [15];
// sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET, // sif::debug << "IP Address Sender: "<< inet_ntop(AF_INET,

View File

@ -1,8 +1,8 @@
#ifndef FRAMEWORK_OSAL_LINUX_TMTCUNIXUDPBRIDGE_H_ #ifndef FRAMEWORK_OSAL_LINUX_TMTCUNIXUDPBRIDGE_H_
#define FRAMEWORK_OSAL_LINUX_TMTCUNIXUDPBRIDGE_H_ #define FRAMEWORK_OSAL_LINUX_TMTCUNIXUDPBRIDGE_H_
#include <framework/tmtcservices/AcceptsTelecommandsIF.h> #include "../../tmtcservices/AcceptsTelecommandsIF.h"
#include <framework/tmtcservices/TmTcBridge.h> #include "../../tmtcservices/TmTcBridge.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/udp.h> #include <netinet/udp.h>