ready to check missing trigger

This commit is contained in:
Nam Tran
2020-11-24 22:22:46 -06:00
parent 78fc7cb184
commit b8550dee70
2 changed files with 8 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ bool bad_data = true;
int open_socket();
void signalHandler( int signum );
void setup_logger();
size_t process_channel(char const * ptr, size_t len);
size_t process_channel(char const * ptr, size_t len, uint32_t board_id);
size_t process_block(char const * ptr, size_t len);
size_t process_block(char const * ptr, size_t len){
return len;
@@ -107,8 +107,10 @@ int main(int argc, char * argv[])
size_t bytes_left = (frameSize - 3 * sizeof(uint32_t));
size_t bytes_processed = 0;
while ((bytes_left - bytes_processed >= MIN_CHANNEL_SIZE) && (bytes_processed < bytes_left)) {
bytes_processed += process_channel(char_buffer + 2 * sizeof(uint32_t) + bytes_processed,
bytes_left - bytes_processed);
bytes_processed += process_channel(
char_buffer + 2 * sizeof(uint32_t) + bytes_processed,
bytes_left - bytes_processed,
static_cast<uint32_t>(board_id));
}
spdlog::get("zynqDump")->debug("Done, {} bytes processed.", bytes_processed);
}
@@ -163,7 +165,7 @@ void setup_logger(){
}
}
size_t process_channel(char const * ptr, size_t len){
size_t process_channel(char const * ptr, size_t len, uint32_t board_id){
if ((len < MIN_CHANNEL_SIZE) || (len > MAX_CHANNEL_SIZE)) {
spdlog::debug("channel length must be between {} and {}.",
MIN_CHANNEL_SIZE, MAX_CHANNEL_SIZE);
@@ -209,7 +211,7 @@ size_t process_channel(char const * ptr, size_t len){
// processing
bytes_left -= channel_size;
Channel c(ptr, channel_size);
Channel c(ptr, channel_size, board_id);
c.Print();
}
}