using BinToHex to display mem blocks in pqistreamer debug

This commit is contained in:
csoler 2016-04-25 22:50:41 -04:00
parent 18e9e1c2db
commit dd81ce3bf3

View File

@ -706,12 +706,7 @@ start_packet_read:
}
}
#ifdef DEBUG_PQISTREAMER
std::cerr << "[" << (void*)pthread_self() << "] " << "block 0 : " << (int)(((unsigned char*)block)[0]) << " " << (int)(((unsigned char*)block)[1]) << " " << (int)(((unsigned char*)block)[2]) << " "
<< (int)(((unsigned char*)block)[3]) << " "
<< (int)(((unsigned char*)block)[4]) << " "
<< (int)(((unsigned char*)block)[5]) << " "
<< (int)(((unsigned char*)block)[6]) << " "
<< (int)(((unsigned char*)block)[7]) << " " << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 0 : " << RsUtil::BinToHex(block,8) << std::endl;
#endif
readbytes += blen;
@ -747,11 +742,7 @@ continue_packet:
std::cerr << "[" << (void*)pthread_self() << "] " << "continuing packet extralen = " << extralen << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "continuing packet state=" << mReading_state << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 1 : " << (int)(((unsigned char*)block)[0]) << " " << (int)(((unsigned char*)block)[1]) << " " << (int)(((unsigned char*)block)[2]) << " " << (int)(((unsigned char*)block)[3]) << " "
<< (int)(((unsigned char*)block)[4]) << " "
<< (int)(((unsigned char*)block)[5]) << " "
<< (int)(((unsigned char*)block)[6]) << " "
<< (int)(((unsigned char*)block)[7]) << " " << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 1 : " << RsUtil::BinToHex(block,8) << std::endl;
#endif
if (extralen > maxlen - blen)
{
@ -772,15 +763,9 @@ continue_packet:
msg += "\n";
rs_sprintf_append(msg, "(M:%d B:%d E:%d)\n", maxlen, blen, extralen);
msg += "\n";
rs_sprintf_append(msg, "block = %d %d %d %d %d %d %d %d\n",
(int)(((unsigned char*)block)[0]),
(int)(((unsigned char*)block)[1]),
(int)(((unsigned char*)block)[2]),
(int)(((unsigned char*)block)[3]),
(int)(((unsigned char*)block)[4]),
(int)(((unsigned char*)block)[5]),
(int)(((unsigned char*)block)[6]),
(int)(((unsigned char*)block)[7])) ;
msg += "block = " ;
msg += RsUtil::BinToHex((char*)block,8);
msg += "\n";
msg += "Please get your friends to upgrade to the latest version";
msg += "\n";
@ -847,17 +832,8 @@ continue_packet:
msgout += "If it happens manny time, please contact the developers, and send them these numbers:";
msgout += "\n";
rs_sprintf_append(msgout, "block = %d %d %d %d %d %d %d %d\n",
(int)(((unsigned char*)block)[0]),
(int)(((unsigned char*)block)[1]),
(int)(((unsigned char*)block)[2]),
(int)(((unsigned char*)block)[3]),
(int)(((unsigned char*)block)[4]),
(int)(((unsigned char*)block)[5]),
(int)(((unsigned char*)block)[6]),
(int)(((unsigned char*)block)[7]));
//notify->AddSysMessage(0, RS_SYS_WARNING, title, msgout.str());
msgout += "block = " ;
msgout += RsUtil::BinToHex((char*)block,8) + "\n" ;
std::cerr << msgout << std::endl;
}
@ -878,11 +854,7 @@ continue_packet:
}
#ifdef DEBUG_PQISTREAMER
std::cerr << "[" << (void*)pthread_self() << "] " << "continuing packet state=" << mReading_state << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 2 : " << (int)(((unsigned char*)extradata)[0]) << " " << (int)(((unsigned char*)extradata)[1]) << " " << (int)(((unsigned char*)extradata)[2]) << " " << (int)(((unsigned char*)extradata)[3]) << " "
<< (int)(((unsigned char*)extradata)[4]) << " "
<< (int)(((unsigned char*)extradata)[5]) << " "
<< (int)(((unsigned char*)extradata)[6]) << " "
<< (int)(((unsigned char*)extradata)[7]) << " " << std::endl ;
std::cerr << "[" << (void*)pthread_self() << "] " << "block 2 : " << RsUtil::BinToHex(extradata,8) << std::endl;
#endif
mFailed_read_attempts = 0 ;