Change hex representation fmt to "0x00, 0x02, 0xff"

This commit is contained in:
DL4PD 2018-03-19 21:32:44 +01:00
parent e2703d2663
commit d7f8d7dbad
2 changed files with 4 additions and 4 deletions

View File

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

View File

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