equal
deleted
inserted
replaced
32 |
32 |
33 #include <relpipe/cli/CLI.h> |
33 #include <relpipe/cli/CLI.h> |
34 |
34 |
35 #include "PosixMQCommand.h" |
35 #include "PosixMQCommand.h" |
36 #include "PosixMQ.h" |
36 #include "PosixMQ.h" |
|
37 #include "Hex.h" |
37 |
38 |
38 using namespace std; |
39 using namespace std; |
39 using namespace relpipe::cli; |
40 using namespace relpipe::cli; |
40 using namespace relpipe::writer; |
41 using namespace relpipe::writer; |
41 |
42 |
55 }, true); |
56 }, true); |
56 |
57 |
57 for (int i = configuration.messageCount; i > 0; i--) { |
58 for (int i = configuration.messageCount; i > 0; i--) { |
58 std::string message = mq->receive(); |
59 std::string message = mq->receive(); |
59 |
60 |
60 std::stringstream hex; |
|
61 hex << std::hex << std::setfill('0'); |
|
62 for (uint8_t b : message) hex << std::setw(2) << (int) b; |
|
63 |
|
64 writer->writeAttribute(configuration.queue); |
61 writer->writeAttribute(configuration.queue); |
65 writer->writeAttribute(convertor.from_bytes(message)); // Show at least ASCII characters + ... if UTF-8 decoding fails |
62 writer->writeAttribute(Hex::toTxt(message)); |
66 writer->writeAttribute(convertor.from_bytes(hex.str())); |
63 writer->writeAttribute(Hex::toHex(message)); |
67 } |
64 } |
68 |
65 |
69 } |
66 } |
70 |
67 |
71 PosixMQCommand::~PosixMQCommand() { |
68 PosixMQCommand::~PosixMQCommand() { |