false;
}
-bool CCECAdapterMessage::IsError(void) const
+bool CCECAdapterMessage::MessageCodeIsError(const cec_adapter_messagecode code)
{
- cec_adapter_messagecode code = Message();
return (code == MSGCODE_HIGH_ERROR ||
- code == MSGCODE_LOW_ERROR ||
- code == MSGCODE_RECEIVE_FAILED ||
- code == MSGCODE_COMMAND_REJECTED ||
- code == MSGCODE_TRANSMIT_LINE_TIMEOUT ||
- code == MSGCODE_TRANSMIT_FAILED_LINE ||
- code == MSGCODE_TRANSMIT_FAILED_ACK ||
- code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA ||
- code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE);
+ code == MSGCODE_LOW_ERROR ||
+ code == MSGCODE_RECEIVE_FAILED ||
+ code == MSGCODE_COMMAND_REJECTED ||
+ code == MSGCODE_TRANSMIT_LINE_TIMEOUT ||
+ code == MSGCODE_TRANSMIT_FAILED_LINE ||
+ code == MSGCODE_TRANSMIT_FAILED_ACK ||
+ code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA ||
+ code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE);
+}
+
+bool CCECAdapterMessage::IsError(void) const
+{
+ return MessageCodeIsError(Message());
+}
+
+bool CCECAdapterMessage::ReplyIsError(void) const
+{
+ return MessageCodeIsError(Reply());
}
bool CCECAdapterMessage::NeedsRetry(void) const
bool IsACK(void) const;
/*!
- * @return True when this message has been replied with an error code, false otherwise.
+ * @brief Checks whether the given messagecode is an error message.
+ * @param code The code to check.
+ * @return True when it's an error, false otherwise.
+ */
+ static bool MessageCodeIsError(const cec_adapter_messagecode code);
+
+ /*!
+ * @return True when this message contains an error code, false otherwise.
*/
bool IsError(void) const;
+ /*!
+ * @return True when this message has been replied with an error code, false otherwise.
+ */
+ bool ReplyIsError(void) const;
+
/*!
* @return True when this message has been replied with an error code and needs to be retried, false otherwise.
*/