Compare commits
14 Commits
important_
...
0ff81294e7
Author | SHA1 | Date | |
---|---|---|---|
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);
|
||||
}
|
||||
|
||||
size_t spiSpeed = 0;
|
||||
uint32_t spiSpeed = 0;
|
||||
spi::SpiModes spiMode = spi::SpiModes::MODE_0;
|
||||
|
||||
SpiCookie::UncommonParameters params;
|
||||
|
@ -443,6 +443,51 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF *cookie,
|
||||
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) {
|
||||
UartModes uartMode = uartCookie.getUartMode();
|
||||
if(uartMode == UartModes::NON_CANONICAL) {
|
||||
|
@ -41,6 +41,21 @@ public:
|
||||
ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer,
|
||||
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:
|
||||
|
||||
using UartDeviceFile_t = std::string;
|
||||
|
@ -1,12 +1,10 @@
|
||||
#ifndef FSFW_DEFAULTCFG_VERSION_H_
|
||||
#define FSFW_DEFAULTCFG_VERSION_H_
|
||||
#ifndef FSFW_VERSION_H_
|
||||
#define FSFW_VERSION_H_
|
||||
|
||||
const char* const FSFW_VERSION_NAME = "ASTP";
|
||||
|
||||
#define FSFW_VERSION 1
|
||||
#define FSFW_SUBVERSION 0
|
||||
#define FSFW_SUBVERSION 3
|
||||
#define FSFW_REVISION 0
|
||||
|
||||
|
||||
|
||||
#endif /* FSFW_DEFAULTCFG_VERSION_H_ */
|
||||
#endif /* FSFW_VERSION_H_ */
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
* @param args Any other arguments which an implementation might require
|
||||
* @return
|
||||
*/
|
||||
virtual ReturnValue_t deleteFile(const char* repositoryPath,
|
||||
virtual ReturnValue_t removeFile(const char* repositoryPath,
|
||||
const char* filename, void* args = nullptr) = 0;
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#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,
|
||||
object_id_t tmStoreId, object_id_t tcStoreId):
|
||||
|
@ -29,8 +29,8 @@ class TcpTmTcBridge:
|
||||
public TmTcBridge {
|
||||
friend class TcpTmTcServer;
|
||||
public:
|
||||
/* The ports chosen here should not be used by any other process. */
|
||||
static const std::string DEFAULT_UDP_SERVER_PORT;
|
||||
// The ports chosen here should not be used by any other process
|
||||
static const std::string DEFAULT_SERVER_PORT;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -17,13 +17,13 @@
|
||||
#define FSFW_UDP_SEND_WIRETAPPING_ENABLED 0
|
||||
#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,
|
||||
std::string udpServerPort, object_id_t tmStoreId, object_id_t tcStoreId):
|
||||
TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) {
|
||||
if(udpServerPort == "") {
|
||||
this->udpServerPort = DEFAULT_UDP_SERVER_PORT;
|
||||
this->udpServerPort = DEFAULT_SERVER_PORT;
|
||||
}
|
||||
else {
|
||||
this->udpServerPort = udpServerPort;
|
||||
|
@ -28,7 +28,7 @@ class UdpTmTcBridge:
|
||||
friend class UdpTcPollingTask;
|
||||
public:
|
||||
/* 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,
|
||||
std::string udpServerPort = "", object_id_t tmStoreId = objects::TM_STORE,
|
||||
|
@ -13,7 +13,8 @@
|
||||
|
||||
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 {
|
||||
UDP,
|
||||
|
@ -22,9 +22,9 @@ public:
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
static constexpr ReturnValue_t makeReturnCode(uint8_t interfaceId,
|
||||
static constexpr ReturnValue_t makeReturnCode(uint8_t classId,
|
||||
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_
|
||||
#define FRAMEWORK_TASKS_TYPEDEF_H_
|
||||
#ifndef FSFW_TASKS_TYPEDEF_H_
|
||||
#define FSFW_TASKS_TYPEDEF_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
typedef const char* TaskName;
|
||||
typedef uint32_t TaskPriority;
|
||||
@ -7,4 +10,4 @@ typedef size_t TaskStackSize;
|
||||
typedef double TaskPeriod;
|
||||
typedef void (*TaskDeadlineMissedFunction)();
|
||||
|
||||
#endif /* FRAMEWORK_TASKS_TYPEDEF_H_ */
|
||||
#endif /* FSFW_TASKS_TYPEDEF_H_ */
|
||||
|
Reference in New Issue
Block a user