cec: changed all Handle...() commands to return a cec_abort_reason and send the corre...
[deb_libcec.git] / src / lib / CECTypeUtils.h
index afbbf9cd096e9c32a4ce9533fdcbd77f14f0edc5..20b8cbcce55d3080ef9fa1cbe269dad3e3483ce4 100644 (file)
@@ -521,6 +521,8 @@ namespace CEC
         return "1.6.2";
       case CEC_CLIENT_VERSION_1_6_3:
         return "1.6.3";
+      case CEC_CLIENT_VERSION_1_7_0:
+        return "1.7.0";
       default:
         return "Unknown";
       }
@@ -548,9 +550,30 @@ namespace CEC
         return "1.6.2";
       case CEC_SERVER_VERSION_1_6_3:
         return "1.6.3";
+      case CEC_SERVER_VERSION_1_7_0:
+        return "1.7.0";
       default:
         return "Unknown";
       }
     }
+
+    static const char *ToString(const cec_abort_reason reason)
+    {
+      switch(reason)
+      {
+      case CEC_ABORT_REASON_UNRECOGNIZED_OPCODE:
+        return "unrecognised opcode";
+      case CEC_ABORT_REASON_NOT_IN_CORRECT_MODE_TO_RESPOND:
+        return "not in correct mode to respond";
+      case CEC_ABORT_REASON_CANNOT_PROVIDE_SOURCE:
+        return "cannot provide source";
+      case CEC_ABORT_REASON_INVALID_OPERAND:
+        return "invalid operand";
+      case CEC_ABORT_REASON_REFUSED:
+        return "refused";
+      default:
+        return "unknown";
+      }
+    }
   };
 }