X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FPulse-Eight%2FUSBCECAdapterMessage.h;h=b862fea5d116f84e828e13f71c89d715dcf53bea;hb=34232c9249859abed3ae97c4d4289dd6ec87a2f6;hp=74980bba14acf60b3fc0914c0d919a8fdfe6d45a;hpb=cb8feb4160641e48180542d195f704170bfbaf90;p=deb_libcec.git diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h b/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h index 74980bb..b862fea 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterMessage.h @@ -2,7 +2,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -77,10 +77,20 @@ namespace CEC MSGCODE_GET_OSD_NAME, MSGCODE_SET_OSD_NAME, MSGCODE_WRITE_EEPROM, + MSGCODE_GET_ADAPTER_TYPE, + MSGCODE_SET_ACTIVE_SOURCE, + MSGCODE_FRAME_EOM = 0x80, MSGCODE_FRAME_ACK = 0x40, } cec_adapter_messagecode; + typedef enum p8_cec_adapter_type + { + P8_ADAPTERTYPE_UNKNOWN = 0, + P8_ADAPTERTYPE_EXTERNAL, + P8_ADAPTERTYPE_DAUGHTERBOARD, + } p8_cec_adapter_type; + class CCECAdapterMessage { public: @@ -194,10 +204,22 @@ namespace CEC 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. */ @@ -230,12 +252,12 @@ namespace CEC */ cec_adapter_messagecode Reply(void) const; - uint8_t maxTries; /**< the maximum number of times to try to send this message */ cec_datapacket response; /**< the response to this message */ cec_datapacket packet; /**< the actual data */ cec_adapter_message_state state; /**< the current state of this message */ int32_t transmit_timeout; /**< the timeout to use when sending this message */ uint8_t lineTimeout; /**< the default CEC line timeout to use when sending this message */ + bool bFireAndForget; /**< true to auto delete, don't wait for a response */ private: bool bNextByteIsEscaped; /**< true when the next byte that is added will be escaped, false otherwise */