1
0
forked from fsfw/fsfw

Compare commits

...

2 Commits

Author SHA1 Message Date
9110fd2728 reintroducing tmtc bridge 2023-10-27 13:40:29 +02:00
8b9a468893 hotfixes to get it to compile for freertos/arm-none-eabi 2023-09-18 22:56:53 +02:00
5 changed files with 19 additions and 4 deletions

View File

@ -5,7 +5,9 @@ void TaskManagement::vRequestContextSwitchFromTask() { vTaskDelay(0); }
void TaskManagement::requestContextSwitch(CallContext callContext = CallContext::TASK) { void TaskManagement::requestContextSwitch(CallContext callContext = CallContext::TASK) {
if (callContext == CallContext::ISR) { if (callContext == CallContext::ISR) {
// This function depends on the partmacro.h definition for the specific device // This function depends on the partmacro.h definition for the specific device
vRequestContextSwitchFromISR(); //vRequestContextSwitchFromISR();
//TODO is this all still needed in current freeRTOS?
vRequestContextSwitchFromTask();
} else { } else {
vRequestContextSwitchFromTask(); vRequestContextSwitchFromTask();
} }

View File

@ -9,6 +9,8 @@
#ifdef PLATFORM_WIN #ifdef PLATFORM_WIN
// wtf? Required for timeval! // wtf? Required for timeval!
#include <winsock.h> #include <winsock.h>
#else
#include <sys/time.h>
#endif #endif
#include "TimeStampIF.h" #include "TimeStampIF.h"

View File

@ -3,4 +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,