Merge remote-tracking branch 'origin/develop' into irini
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -70,8 +70,8 @@ void UartTestClass::gpsInit() {
|
||||
/* Get file descriptor */
|
||||
serialPort = open("/dev/serial0", O_RDWR);
|
||||
if (serialPort < 0) {
|
||||
sif::warning << "UartTestClass::gpsInit: open call failed with error [" << errno << ", " << strerror(errno)
|
||||
<< std::endl;
|
||||
sif::warning << "UartTestClass::gpsInit: open call failed with error [" << errno << ", "
|
||||
<< strerror(errno) << std::endl;
|
||||
}
|
||||
/* Setting up UART parameters */
|
||||
tty.c_cflag &= ~PARENB; // Clear parity bit
|
||||
@ -99,8 +99,8 @@ void UartTestClass::gpsInit() {
|
||||
cfsetispeed(&tty, B9600);
|
||||
cfsetospeed(&tty, B9600);
|
||||
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
||||
sif::warning << "UartTestClass::gpsInit: tcsetattr call failed with error [" << errno << ", " << strerror(errno)
|
||||
<< std::endl;
|
||||
sif::warning << "UartTestClass::gpsInit: tcsetattr call failed with error [" << errno << ", "
|
||||
<< strerror(errno) << std::endl;
|
||||
;
|
||||
}
|
||||
// Flush received and unread data. Those are old NMEA strings which are not relevant anymore
|
||||
@ -115,8 +115,8 @@ void UartTestClass::gpsPeriodic() {
|
||||
bytesRead = read(serialPort, reinterpret_cast<void*>(recBuf.data()),
|
||||
static_cast<unsigned int>(recBuf.size()));
|
||||
if (bytesRead < 0) {
|
||||
sif::warning << "UartTestClass::gpsPeriodic: read call failed with error [" << errno
|
||||
<< ", " << strerror(errno) << "]" << std::endl;
|
||||
sif::warning << "UartTestClass::gpsPeriodic: read call failed with error [" << errno << ", "
|
||||
<< strerror(errno) << "]" << std::endl;
|
||||
break;
|
||||
} else if (bytesRead >= static_cast<int>(recBuf.size())) {
|
||||
sif::debug << "UartTestClass::gpsPeriodic: "
|
||||
@ -268,8 +268,8 @@ void UartTestClass::scexSimpleInit() {
|
||||
/* Get file descriptor */
|
||||
serialPort = open(devname.c_str(), O_RDWR);
|
||||
if (serialPort < 0) {
|
||||
sif::warning << "UartTestClass::scexSimpleInit: Open call failed with error [" << errno << ", " << strerror(errno)
|
||||
<< std::endl;
|
||||
sif::warning << "UartTestClass::scexSimpleInit: Open call failed with error [" << errno << ", "
|
||||
<< strerror(errno) << std::endl;
|
||||
return;
|
||||
}
|
||||
// Setting up UART parameters
|
||||
@ -296,8 +296,8 @@ void UartTestClass::scexSimpleInit() {
|
||||
#endif
|
||||
|
||||
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
||||
sif::warning << "UartTestClass::scexSimpleInit: tcsetattr call failed with error [" << errno << ", " << strerror(errno)
|
||||
<< std::endl;
|
||||
sif::warning << "UartTestClass::scexSimpleInit: tcsetattr call failed with error [" << errno
|
||||
<< ", " << strerror(errno) << std::endl;
|
||||
}
|
||||
// Flush received and unread data
|
||||
tcflush(serialPort, TCIOFLUSH);
|
||||
@ -323,7 +323,9 @@ void UartTestClass::scexSimplePeriodic() {
|
||||
};
|
||||
size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen);
|
||||
if (bytesWritten != encodedLen) {
|
||||
sif::warning << "UartTestClass::scexSimplePeriodic: Sending command to solar experiment failed" << std::endl;
|
||||
sif::warning
|
||||
<< "UartTestClass::scexSimplePeriodic: Sending command to solar experiment failed"
|
||||
<< std::endl;
|
||||
}
|
||||
cmdSent = true;
|
||||
cmdDone = false;
|
||||
@ -335,10 +337,11 @@ void UartTestClass::scexSimplePeriodic() {
|
||||
bytesRead = read(serialPort, reinterpret_cast<void*>(recBuf.data()),
|
||||
static_cast<unsigned int>(recBuf.size()));
|
||||
if (bytesRead == 0) {
|
||||
sif::warning << "UartTestClass::scexSimplePeriodic: Reading SCEX: Timeout or no bytes read" << std::endl;
|
||||
sif::warning << "UartTestClass::scexSimplePeriodic: Reading SCEX: Timeout or no bytes read"
|
||||
<< std::endl;
|
||||
} else if (bytesRead < 0) {
|
||||
sif::warning << "UartTestClass::scexSimplePeriodic: read call failed with error ["
|
||||
<< errno << ", " << strerror(errno) << "]" << std::endl;
|
||||
sif::warning << "UartTestClass::scexSimplePeriodic: read call failed with error [" << errno
|
||||
<< ", " << strerror(errno) << "]" << std::endl;
|
||||
break;
|
||||
} else if (bytesRead >= static_cast<int>(recBuf.size())) {
|
||||
sif::debug << "UartTestClass::scexSimplePeriodic: recv buffer might not be large "
|
||||
@ -383,7 +386,8 @@ void UartTestClass::foundDlePacketHandler(const DleParser::Context& ctx) {
|
||||
}
|
||||
|
||||
void UartTestClass::handleFoundDlePacket(uint8_t* packet, size_t len) {
|
||||
sif::info << "UartTestClass::handleFoundDlePacket: Detected DLE encoded packet with decoded size " << len << std::endl;
|
||||
sif::info << "UartTestClass::handleFoundDlePacket: Detected DLE encoded packet with decoded size "
|
||||
<< len << std::endl;
|
||||
}
|
||||
|
||||
std::string UartTestClass::random_string(std::string::size_type length) {
|
||||
|
Reference in New Issue
Block a user