equal
deleted
inserted
replaced
29 |
29 |
30 #include <iomanip> |
30 #include <iomanip> |
31 using namespace std; |
31 using namespace std; |
32 |
32 |
33 #include "SoeCommand.h" |
33 #include "SoeCommand.h" |
|
34 |
|
35 extern const ec_code_msg_t soe_error_codes[]; |
34 |
36 |
35 /*****************************************************************************/ |
37 /*****************************************************************************/ |
36 |
38 |
37 SoeCommand::SoeCommand(const string &name, const string &briefDesc): |
39 SoeCommand::SoeCommand(const string &name, const string &briefDesc): |
38 Command(name, briefDesc) |
40 Command(name, briefDesc) |
103 } |
105 } |
104 |
106 |
105 return idn; |
107 return idn; |
106 } |
108 } |
107 |
109 |
|
110 /*****************************************************************************/ |
|
111 |
|
112 /** Outputs an SoE error code. |
|
113 */ |
|
114 std::string SoeCommand::errorMsg(uint16_t code) |
|
115 { |
|
116 const ec_code_msg_t *error_msg; |
|
117 stringstream str; |
|
118 |
|
119 str << "0x" << hex << setfill('0') << setw(4) << code << ": "; |
|
120 |
|
121 for (error_msg = soe_error_codes; error_msg->code; error_msg++) { |
|
122 if (error_msg->code == code) { |
|
123 str << error_msg->message; |
|
124 return str.str(); |
|
125 } |
|
126 } |
|
127 |
|
128 str << "(Unknown)"; |
|
129 return str.str(); |
|
130 } |
|
131 |
108 /****************************************************************************/ |
132 /****************************************************************************/ |