Make consistent the format of the message sink

This commit is contained in:
Manolis Surligas 2018-03-20 20:39:46 +02:00
parent 8424f5930d
commit 0074fe7c10
2 changed files with 5 additions and 5 deletions

View File

@ -119,8 +119,8 @@ namespace gr
std::ofstream fd (filename.c_str ()); std::ofstream fd (filename.c_str ());
su = (uint8_t *) pmt::blob_data (msg); su = (uint8_t *) pmt::blob_data (msg);
for (size_t i = 0; i < pmt::blob_length (msg); i++) { for (size_t i = 0; i < pmt::blob_length (msg); i++) {
fd << "0x" << std::hex << std::setw (2) fd << "0x" << std::hex << std::setw (2) << std::setfill ('0')
<< std::setfill('0') << (uint32_t) su[i] << " "; << (uint32_t) su[i] << " ";
} }
fd.close (); fd.close ();
break; break;

View File

@ -67,8 +67,8 @@ namespace gr
case 1: case 1:
su = (uint8_t *) pmt::blob_data (msg); su = (uint8_t *) pmt::blob_data (msg);
for (size_t i = 0; i < pmt::blob_length (msg); i++) { for (size_t i = 0; i < pmt::blob_length (msg); i++) {
d_fos << "0x" << std::hex << std::setw (2) d_fos << "0x" << std::hex << std::setw (2) << std::setfill ('0')
<< std::setfill('0') << (uint32_t) su[i] << " "; << (uint32_t) su[i] << " ";
} }
d_fos << std::endl; d_fos << std::endl;
break; break;
@ -110,7 +110,7 @@ namespace gr
case 1: // hex annotated case 1: // hex annotated
su = (uint8_t *) pmt::blob_data (msg); su = (uint8_t *) pmt::blob_data (msg);
for (size_t i = 0; i < pmt::blob_length (msg); i++) { for (size_t i = 0; i < pmt::blob_length (msg); i++) {
std::cout << std::hex << std::showbase << std::setw (4) std::cout << "0x" << std::hex << std::setw (2) << std::setfill ('0')
<< (uint32_t) su[i] << " "; << (uint32_t) su[i] << " ";
} }
std::cout << std::endl; std::cout << std::endl;