almost there.. I think
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2023-11-14 18:20:52 +01:00
parent 2563432171
commit 3898e2d66f
11 changed files with 2454 additions and 32 deletions

View File

@ -45,12 +45,10 @@ PlocSupvUartManager::PlocSupvUartManager(object_id_t objectId)
PlocSupvUartManager::~PlocSupvUartManager() = default;
ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
sif::debug << "init ploc supv uart IF" << std::endl;
auto* uartCookie = dynamic_cast<SerialCookie*>(cookie);
if (uartCookie == nullptr) {
return FAILED;
}
sif::debug << "hello blub" << std::endl;
std::string devname = uartCookie->getDeviceFile();
/* Get file descriptor */
serialPort = open(devname.c_str(), O_RDWR);
@ -72,7 +70,7 @@ ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
tty.c_lflag &= ~(ICANON | ECHO);
// Blocking mode, 0.2 seconds timeout
tty.c_cc[VTIME] = 0;
tty.c_cc[VTIME] = 2;
tty.c_cc[VMIN] = 0;
serial::setBaudrate(tty, uartCookie->getBaudrate());
@ -82,7 +80,7 @@ ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
}
// Flush received and unread data
tcflush(serialPort, TCIOFLUSH);
sif::debug << "ploc supv cfg complete" << std::endl;
sif::debug << "piece of shit port " << serialPort << std::endl;
return OK;
}
@ -117,7 +115,6 @@ ReturnValue_t PlocSupvUartManager::performOperation(uint8_t operationCode) {
lock->lockMutex();
InternalState currentState = state;
lock->unlockMutex();
sif::debug << "supv uart man post-lock" << std::endl;
switch (currentState) {
case InternalState::SLEEPING:
case InternalState::GO_TO_SLEEP: {
@ -143,7 +140,7 @@ ReturnValue_t PlocSupvUartManager::performOperation(uint8_t operationCode) {
ReturnValue_t PlocSupvUartManager::handleUartReception() {
ReturnValue_t result = OK;
ReturnValue_t status = OK;
sif::debug << "handling uart reception" << std::endl;
sif::debug << "reading port " << serialPort << std::endl;
ssize_t bytesRead = read(serialPort, reinterpret_cast<void*>(recBuf.data()),
static_cast<unsigned int>(recBuf.size()));
if (bytesRead == 0) {