add channel header

This commit is contained in:
Nam Tran
2020-11-24 11:49:27 -06:00
parent 325fafde03
commit 3c6f2cbeb4
2 changed files with 64 additions and 5 deletions

View File

@@ -13,7 +13,8 @@
#include <ctime>
#include <iomanip>
#include <csignal>
#include <loguru.hpp>
#include "loguru.hpp"
#include "channel.h"
const char * HOST = "192.168.30.89";
const uint32_t PORT = 9999;
@@ -65,7 +66,7 @@ size_t process_channel(char const * ptr, size_t len){
int32_t integral[3];
for (int i = 0; i < 3; i++)
integral[i] = (wordData[i + 1] & 0xFFFFFF00)>>8;
LOG_SCOPE_F(INFO, "integrals: %u, %u, %u", integral[0], integral[1], integral[2]);
LOG_SCOPE_F(INFO, "integrals: %d, %d, %d", integral[0], integral[1], integral[2]);
uint32_t crossing_count = wordData[4] & 0x00FFFFFF;
uint32_t block_count = (wordData[5] &0xFF000000) >> 24;
@@ -78,8 +79,12 @@ size_t process_channel(char const * ptr, size_t len){
process_block(ptr, channel_size); // not correct yet!
}
// the number of bytes processed should be equal to the channel size
// the number of bytes cosumed by this function, regardless of block
// processing
bytes_left -= channel_size;
Channel c(ptr, channel_size);
c.Print();
}
}
@@ -202,8 +207,8 @@ int open_socket(){
}
void setup_logger(){
loguru::g_stderr_verbosity = loguru::Verbosity_INFO;
// loguru::g_stderr_verbosity = loguru::Verbosity_WARNING;
// loguru::g_stderr_verbosity = loguru::Verbosity_INFO;
loguru::g_stderr_verbosity = loguru::Verbosity_WARNING;
loguru::g_preamble_date = true; // The date field
loguru::g_preamble_time = true; // The time of the current day
loguru::g_preamble_uptime = true; // The time since init call