Commit 302ddf4b authored by Thomas Edwards's avatar Thomas Edwards
Browse files

Minor debug printing added before branch switch

parent 6abc3aae
......@@ -1025,6 +1025,17 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Check for correct length of buffer
if (strlen(buf) != reclen){
// debug printing
time_t timer;
char time_str_buffer[26];
struct tm* tm_info;
timer = time(NULL);
tm_info = localtime(&timer);
strftime(time_str_buffer, 26, "[%Y-%m-%d %H:%M:%S]: ", tm_info);
puts(time_str_buffer);
// fprintf(stderr,time_str_buffer);
std::cerr << time_str_buffer;
fprintf(stderr,"Received number of bytes not consistent. "
"Expected: %d. Received: %lu\n",
reclen,strlen(buf));
......@@ -1033,6 +1044,17 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
// Check 7th bits
for (int i=0; i<reclen;i++){
if ((unsigned char) buf[i]<32 || (unsigned char) buf[i]>159){
// debug printing
time_t timer;
char time_str_buffer[26];
struct tm* tm_info;
timer = time(NULL);
tm_info = localtime(&timer);
strftime(time_str_buffer, 26, "[%Y-%m-%d %H:%M:%S]: ", tm_info);
puts(time_str_buffer);
// fprintf(stderr,time_str_buffer);
std::cerr << time_str_buffer;
fprintf(stderr,"Faulty data: 7th bit check failed for byte "
"%d: %d.\n",i,(unsigned char) buf[i]);
fprintf(stderr,"%d%d%d%d%d%d%d%d\n",buf[i]&1,(buf[i]&2)/2,
......
Supports Markdown
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