Compare commits
15 Commits
add_cfdp_s
...
296c587e3d
Author | SHA1 | Date | |
---|---|---|---|
296c587e3d | |||
0ff81294e7 | |||
b6e243b8b3 | |||
3bbcc42d39 | |||
fc4324a2fa | |||
54c028f913 | |||
1f6a5e635f | |||
c5b4b01362 | |||
c5420c7b53 | |||
3e422f51bd | |||
d1be0f9843 | |||
b83259592a | |||
a7a4e0f219 | |||
bdc5f593e2 | |||
10f7185e81 |
@ -82,7 +82,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF *cookie) {
|
|||||||
gpioComIF->pullHigh(gpioId);
|
gpioComIF->pullHigh(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t spiSpeed = 0;
|
uint32_t spiSpeed = 0;
|
||||||
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||||
|
|
||||||
SpiCookie::UncommonParameters params;
|
SpiCookie::UncommonParameters params;
|
||||||
|
@ -443,6 +443,51 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF *cookie,
|
|||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF *cookie) {
|
||||||
|
std::string deviceFile;
|
||||||
|
UartDeviceMapIter uartDeviceMapIter;
|
||||||
|
UartCookie* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||||
|
if(uartCookie == nullptr) {
|
||||||
|
sif::warning << "UartComIF::flushUartRxBuffer: Invalid uart cookie!" << std::endl;
|
||||||
|
return NULLPOINTER;
|
||||||
|
}
|
||||||
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
|
tcflush(fd, TCIFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF *cookie) {
|
||||||
|
std::string deviceFile;
|
||||||
|
UartDeviceMapIter uartDeviceMapIter;
|
||||||
|
UartCookie* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||||
|
if(uartCookie == nullptr) {
|
||||||
|
sif::warning << "UartComIF::flushUartTxBuffer: Invalid uart cookie!" << std::endl;
|
||||||
|
return NULLPOINTER;
|
||||||
|
}
|
||||||
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
|
tcflush(fd, TCOFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF *cookie) {
|
||||||
|
std::string deviceFile;
|
||||||
|
UartDeviceMapIter uartDeviceMapIter;
|
||||||
|
UartCookie* uartCookie = dynamic_cast<UartCookie*>(cookie);
|
||||||
|
if(uartCookie == nullptr) {
|
||||||
|
sif::warning << "UartComIF::flushUartTxAndRxBuf: Invalid uart cookie!" << std::endl;
|
||||||
|
return NULLPOINTER;
|
||||||
|
}
|
||||||
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
|
tcflush(fd, TCIOFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
void UartComIF::setUartMode(struct termios *options, UartCookie &uartCookie) {
|
void UartComIF::setUartMode(struct termios *options, UartCookie &uartCookie) {
|
||||||
UartModes uartMode = uartCookie.getUartMode();
|
UartModes uartMode = uartCookie.getUartMode();
|
||||||
if(uartMode == UartModes::NON_CANONICAL) {
|
if(uartMode == UartModes::NON_CANONICAL) {
|
||||||
|
@ -41,6 +41,21 @@ public:
|
|||||||
ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
|
ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
|
||||||
size_t *size) override;
|
size_t *size) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function discards all data received but not read in the UART buffer.
|
||||||
|
*/
|
||||||
|
ReturnValue_t flushUartRxBuffer(CookieIF *cookie);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function discards all data in the transmit buffer of the UART driver.
|
||||||
|
*/
|
||||||
|
ReturnValue_t flushUartTxBuffer(CookieIF *cookie);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function discards both data in the transmit and receive buffer of the UART.
|
||||||
|
*/
|
||||||
|
ReturnValue_t flushUartTxAndRxBuf(CookieIF *cookie);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
using UartDeviceFile_t = std::string;
|
using UartDeviceFile_t = std::string;
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#ifndef FSFW_DEFAULTCFG_VERSION_H_
|
#ifndef FSFW_VERSION_H_
|
||||||
#define FSFW_DEFAULTCFG_VERSION_H_
|
#define FSFW_VERSION_H_
|
||||||
|
|
||||||
const char* const FSFW_VERSION_NAME = "ASTP";
|
const char* const FSFW_VERSION_NAME = "ASTP";
|
||||||
|
|
||||||
#define FSFW_VERSION 1
|
#define FSFW_VERSION 1
|
||||||
#define FSFW_SUBVERSION 0
|
#define FSFW_SUBVERSION 3
|
||||||
#define FSFW_REVISION 0
|
#define FSFW_REVISION 0
|
||||||
|
|
||||||
|
#endif /* FSFW_VERSION_H_ */
|
||||||
|
|
||||||
#endif /* FSFW_DEFAULTCFG_VERSION_H_ */
|
|
||||||
|
@ -55,7 +55,19 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) {
|
|||||||
|
|
||||||
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy,
|
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy,
|
||||||
ActionId_t actionId, store_address_t dataAddress) {
|
ActionId_t actionId, store_address_t dataAddress) {
|
||||||
const uint8_t* dataPtr = NULL;
|
if(ipcStore == nullptr) {
|
||||||
|
#if FSFW_VERBOSE_LEVEL >= 1
|
||||||
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
|
sif::warning << "ActionHelper::prepareExecution: IPC Store not set. Call initialize first"
|
||||||
|
<< std::endl;
|
||||||
|
#else
|
||||||
|
sif::printWarning("ActionHelper::prepareExecution: "
|
||||||
|
"IPC Store not set. Call initialize first\n");
|
||||||
|
#endif
|
||||||
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
* @param args Any other arguments which an implementation might require
|
* @param args Any other arguments which an implementation might require
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t deleteFile(const char* repositoryPath,
|
virtual ReturnValue_t removeFile(const char* repositoryPath,
|
||||||
const char* filename, void* args = nullptr) = 0;
|
const char* filename, void* args = nullptr) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const std::string TcpTmTcBridge::DEFAULT_UDP_SERVER_PORT = tcpip::DEFAULT_SERVER_PORT;
|
const std::string TcpTmTcBridge::DEFAULT_SERVER_PORT = tcpip::DEFAULT_TCP_SERVER_PORT;
|
||||||
|
|
||||||
TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
||||||
object_id_t tmStoreId, object_id_t tcStoreId):
|
object_id_t tmStoreId, object_id_t tcStoreId):
|
||||||
|
@ -29,8 +29,8 @@ class TcpTmTcBridge:
|
|||||||
public TmTcBridge {
|
public TmTcBridge {
|
||||||
friend class TcpTmTcServer;
|
friend class TcpTmTcServer;
|
||||||
public:
|
public:
|
||||||
/* The ports chosen here should not be used by any other process. */
|
// The ports chosen here should not be used by any other process
|
||||||
static const std::string DEFAULT_UDP_SERVER_PORT;
|
static const std::string DEFAULT_SERVER_PORT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
#define FSFW_UDP_SEND_WIRETAPPING_ENABLED 0
|
#define FSFW_UDP_SEND_WIRETAPPING_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const std::string UdpTmTcBridge::DEFAULT_UDP_SERVER_PORT = tcpip::DEFAULT_SERVER_PORT;
|
const std::string UdpTmTcBridge::DEFAULT_SERVER_PORT = tcpip::DEFAULT_UDP_SERVER_PORT;
|
||||||
|
|
||||||
UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
||||||
std::string udpServerPort, object_id_t tmStoreId, object_id_t tcStoreId):
|
std::string udpServerPort, object_id_t tmStoreId, object_id_t tcStoreId):
|
||||||
TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) {
|
TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) {
|
||||||
if(udpServerPort == "") {
|
if(udpServerPort == "") {
|
||||||
this->udpServerPort = DEFAULT_UDP_SERVER_PORT;
|
this->udpServerPort = DEFAULT_SERVER_PORT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->udpServerPort = udpServerPort;
|
this->udpServerPort = udpServerPort;
|
||||||
|
@ -28,7 +28,7 @@ class UdpTmTcBridge:
|
|||||||
friend class UdpTcPollingTask;
|
friend class UdpTcPollingTask;
|
||||||
public:
|
public:
|
||||||
/* The ports chosen here should not be used by any other process. */
|
/* The ports chosen here should not be used by any other process. */
|
||||||
static const std::string DEFAULT_UDP_SERVER_PORT;
|
static const std::string DEFAULT_SERVER_PORT;
|
||||||
|
|
||||||
UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
|
||||||
std::string udpServerPort = "", object_id_t tmStoreId = objects::TM_STORE,
|
std::string udpServerPort = "", object_id_t tmStoreId = objects::TM_STORE,
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
|
|
||||||
namespace tcpip {
|
namespace tcpip {
|
||||||
|
|
||||||
const char* const DEFAULT_SERVER_PORT = "7301";
|
const char* const DEFAULT_UDP_SERVER_PORT = "7301";
|
||||||
|
const char* const DEFAULT_TCP_SERVER_PORT = "7303";
|
||||||
|
|
||||||
enum class Protocol {
|
enum class Protocol {
|
||||||
UDP,
|
UDP,
|
||||||
|
@ -22,9 +22,9 @@ public:
|
|||||||
* @param number
|
* @param number
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static constexpr ReturnValue_t makeReturnCode(uint8_t interfaceId,
|
static constexpr ReturnValue_t makeReturnCode(uint8_t classId,
|
||||||
uint8_t number) {
|
uint8_t number) {
|
||||||
return (static_cast<ReturnValue_t>(interfaceId) << 8) + number;
|
return (static_cast<ReturnValue_t>(classId) << 8) + number;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#ifndef FRAMEWORK_TASKS_TYPEDEF_H_
|
#ifndef FSFW_TASKS_TYPEDEF_H_
|
||||||
#define FRAMEWORK_TASKS_TYPEDEF_H_
|
#define FSFW_TASKS_TYPEDEF_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
typedef const char* TaskName;
|
typedef const char* TaskName;
|
||||||
typedef uint32_t TaskPriority;
|
typedef uint32_t TaskPriority;
|
||||||
@ -7,4 +10,4 @@ typedef size_t TaskStackSize;
|
|||||||
typedef double TaskPeriod;
|
typedef double TaskPeriod;
|
||||||
typedef void (*TaskDeadlineMissedFunction)();
|
typedef void (*TaskDeadlineMissedFunction)();
|
||||||
|
|
||||||
#endif /* FRAMEWORK_TASKS_TYPEDEF_H_ */
|
#endif /* FSFW_TASKS_TYPEDEF_H_ */
|
||||||
|
Reference in New Issue
Block a user