reintroducing tmtc bridge
fsfw/fsfw/pipeline/head There was a failure building this commit Details

This commit is contained in:
Ulrich Mohr 2023-10-27 13:40:29 +02:00
parent 8b9a468893
commit 9110fd2728
3 changed files with 13 additions and 3 deletions

View File

@ -3,5 +3,5 @@ target_sources(
FsfwProtocolHeader.cpp FsfwProtocolHeader.cpp
TmManager.cpp TmManager.cpp
TmMessage.cpp TmMessage.cpp
#UdpTmTcBridge.cpp UdpTmTcBridge.cpp
) )

View File

@ -1,6 +1,8 @@
#include "UdpTmTcBridge.h" #include "UdpTmTcBridge.h"
extern "C" {
#include <arpa/inet.h> #include <arpa/inet.h>
}
#include <errno.h> #include <errno.h>
#include <fsfw/action.h> #include <fsfw/action.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
@ -48,7 +50,7 @@ ReturnValue_t UdpTmTcBridgeNew::initialize() {
int retval; int retval;
serverSocket = socket(AF_INET6, SOCK_DGRAM | SOCK_NONBLOCK, 0); serverSocket = socket(AF_INET6, SOCK_DGRAM, 0);
if (serverSocket == -1) { if (serverSocket == -1) {
// TODO resolve errno // TODO resolve errno
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
@ -57,6 +59,11 @@ ReturnValue_t UdpTmTcBridgeNew::initialize() {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
//TODO verify that lwip interprets this correctly
int flags = fcntl(serverSocket, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(serverSocket, F_SETFL, flags);
sockaddr_in6 serverAddr; sockaddr_in6 serverAddr;
memset(&serverAddr, 0, sizeof(serverAddr)); memset(&serverAddr, 0, sizeof(serverAddr));
@ -144,6 +151,7 @@ void UdpTmTcBridgeNew::handleTC() {
return; return;
} }
size_t bufferLen = receivedLen; size_t bufferLen = receivedLen;
const uint8_t *constApplicationData = applicationData; const uint8_t *constApplicationData = applicationData;

View File

@ -5,7 +5,9 @@
#include <fsfw/storagemanager/StorageManagerIF.h> #include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/tasks/ExecutableObjectIF.h> #include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtc/AcceptsTelemetryIF.h> #include <fsfw/tmtc/AcceptsTelemetryIF.h>
#include <netinet/in.h> #include <sys/socket.h>
class UdpTmTcBridgeNew : public SystemObject, class UdpTmTcBridgeNew : public SystemObject,
public ExecutableObjectIF, public ExecutableObjectIF,