tool/SoeCommand.cpp
changeset 1966 23c638a81fe7
parent 1877 7b77000f9764
--- a/tool/SoeCommand.cpp	Wed Sep 22 15:41:43 2010 +0200
+++ b/tool/SoeCommand.cpp	Sun Oct 24 08:43:44 2010 +0200
@@ -36,13 +36,6 @@
 
 /*****************************************************************************/
 
-SoeCommand::SoeCommand(const string &name, const string &briefDesc):
-    Command(name, briefDesc)
-{
-}
-
-/*****************************************************************************/
-
 uint16_t SoeCommand::parseIdn(const string &str)
 {
     uint16_t idn = 0x0000;
@@ -109,6 +102,19 @@
 
 /*****************************************************************************/
 
+string SoeCommand::outputIdn(uint16_t idn)
+{
+    stringstream str;
+
+    str << ((idn & 0x8000) ? 'P' : 'S')
+        << "-" << ((idn >> 12) & 0x07)
+        << "-" << setfill('0') << setw(4) << (idn & 0x0fff);
+
+    return str.str();
+}
+
+/*****************************************************************************/
+
 /** Outputs an SoE error code.
 */
 std::string SoeCommand::errorMsg(uint16_t code)