Commit 602643d1 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

S/N logged

parent f79a7045
......@@ -236,7 +236,7 @@ int Driver_Obs_Serial::find_baud(char* init_chars[], int init_chars_num) {
// This has to be in loop as characters received at false baud rate
// somehow can corrupt the value in valid_baudrates_size (Buffer overrun
// in driver_serial::receive
// in driver_serial::receive)
serial.get_baudrates(&valid_baudrates, &valid_baudrates_size);
//fprintf(stderr," %d\n",valid_baudrates_size);
......
......@@ -1061,6 +1061,15 @@ int driver_obs_obsdaq::init() {
filter_cmds[9] = "92";
filter_cmds[10] = "A1";
/////////////////////////////////////////////////////////////////////////
//
// Logging.
//
/////////////////////////////////////////////////////////////////////////
std::cerr << "==== Initialized ObsDAQ with S/N " << sn << std::endl;
return (0);
}
......
......@@ -4,6 +4,8 @@
#include <sched.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <ctime>
#include <iomanip> // put_time
//#include <thread>
//#include <vector>
......@@ -22,7 +24,14 @@
int main(int argc, char* argv[]) {
// Write logging message
std::time_t time = std::time(nullptr);
fprintf(stderr,"=========================================\n");
fprintf(stderr,"# Logger restarted #\n");
std::cerr << "#" << std::put_time(std::gmtime(&time), "%c %Z") << "#" << std::endl;
fprintf(stderr,"=========================================\n");
// Try to schedule with realtime scheduler
struct sched_param sp = { .sched_priority = 10 };
if (!sched_setscheduler(0,SCHED_FIFO,&sp)) {
std::cerr << "High priority FIFO scheduler FAILED for OBSDAQ_Logger." << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment