RDK Documentation (Open Sourced RDK Components)
OpCode.hpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 /**
22 * @defgroup hdmicec
23 * @{
24 * @defgroup ccec
25 * @{
26 **/
27 
28 
29 #ifndef HDMI_CCEC_OPCODE_HPP_
30 #define HDMI_CCEC_OPCODE_HPP_
31 
32 #include <iostream>
33 
34 #include "CCEC.hpp"
35 #include "ccec/CECFrame.hpp"
36 #include "Assert.hpp"
37 
38 #include "DataBlock.hpp"
39 
40 
41 CCEC_BEGIN_NAMESPACE
42 
43 extern "C" const char *GetOpName(Op_t op);
44 
45 enum
46 {
47  ACTIVE_SOURCE = 0x82,
48  IMAGE_VIEW_ON = 0x04,
49  TEXT_VIEW_ON = 0x0D,
50  INACTIVE_SOURCE = 0x9D,
51  REQUEST_ACTIVE_SOURCE = 0x85,
52  ROUTING_CHANGE = 0x80,
53  ROUTING_INFORMATION = 0x81,
54  SET_STREAM_PATH = 0x86,
55  STANDBY = 0x36,
56  RECORD_OFF = 0X0B,
57  RECORD_ON = 0X09,
58  RECORD_STATUS = 0X0A,
59  RECORD_TV_SCREEN = 0X0F,
60  CLEAR_ANALOGUE_TIMER = 0X33,
61  CLEAR_DIGITAL_TIMER = 0X99,
62  CLEAR_EXTERNAL_TIMER = 0XA1,
63  SET_ANALOG_TIMER = 0X34,
64  SET_DIGITAL_TIMER = 0X97,
65  SET_EXTERNAL_TIMER = 0XA2,
66  SET_TIMER_PROGRAM_TITLE = 0X67,
67  TIMER_CLEARED_STATUS = 0X43,
68  TIMER_STATUS = 0X35,
69  GET_CEC_VERSION = 0x9F,
70  CEC_VERSION = 0x9E,
71  GIVE_PHYSICAL_ADDRESS = 0x83,
72  GET_MENU_LANGUAGE = 0X91,
73  REPORT_PHYSICAL_ADDRESS = 0x84,
74  SET_MENU_LANGUAGE = 0X32,
75  DECK_CONTROL = 0X42,
76  DECK_STATUS = 0X1B,
77  GIVE_DECK_STATUS = 0X1A,
78  PLAY = 0X41,
79  GIVE_TUNER_DEVICE_STATUS = 0X08,
80  SELECT_ANALOGUE_SERVICE = 0X92,
81  SELECT_DIGITAL_SERVICE = 0X93,
82  TUNER_DEVICE_STATUS = 0X07,
83  TUNER_STEP_DECREMENT = 0X06,
84  TUNER_STEP_INCREMENT = 0X05,
85  DEVICE_VENDOR_ID = 0x87,
86  GIVE_DEVICE_VENDOR_ID = 0x8C,
87  VENDOR_COMMAND = 0X89,
88  VENDOR_COMMAND_WITH_ID = 0XA0,
89  VENDOR_REMOTE_BUTTON_DOWN = 0X8A,
90  VENDOR_REMOTE_BUTTON_UP = 0X8B,
91  SET_OSD_STRING = 0x64,
92  GIVE_OSD_NAME = 0x46,
93  SET_OSD_NAME = 0x47,
94  MENU_REQUEST = 0X8D,
95  MENU_STATUS = 0X8E,
96  USER_CONTROL_PRESSED = 0X44,
97  USER_CONTROL_RELEASED = 0X45,
98  GIVE_DEVICE_POWER_STATUS = 0x8F,
99  REPORT_POWER_STATUS = 0x90,
100  FEATURE_ABORT = 0x00,
101  ABORT = 0xFF,
102  GIVE_AUDIO_STATUS = 0X71,
103  GIVE_SYSTEM_AUDIO_MODE_STATUS = 0X7D,
104  REPORT_AUDIO_STATUS = 0X7A,
105  REPORT_SHORT_AUDIO_DESCRIPTOR = 0XA3,
106  REQUEST_SHORT_AUDIO_DESCRIPTOR = 0XA4,
107  SET_SYSTEM_AUDIO_MODE = 0X72,
108  SYSTEM_AUDIO_MODE_REQUEST = 0X70,
109  SYSTEM_AUDIO_MODE_STATUS = 0X7E,
110  SET_AUDIO_RATE = 0X9A,
111  INITIATE_ARC = 0XC0,
112  REPORT_ARC_INITIATED = 0XC1,
113  REPORT_ARC_TERMINATED = 0XC2,
114  REQUEST_ARC_INITIATION = 0XC3,
115  REQUEST_ARC_TERMINATION = 0XC4,
116  TERMINATE_ARC = 0XC5,
117  CDC_MESSAGE = 0XF8,
118  POLLING = 0x200, // Special Code for Polling Msg.
119 
120  UNKNOWN = 0xFFFF
121 };
122 
123 class OpCode : public DataBlock
124 {
125 public:
126  enum {
127  MAX_LEN = 1,
128  };
129 
130  OpCode(Op_t opCode) : opCode_(opCode) {};
131  OpCode(const CECFrame &frame, int startPos) : opCode_(frame.at(startPos)) {
132  }
133  CECFrame &serialize(CECFrame &frame) const {
134  if (opCode_ != POLLING) {
135  frame.append(opCode_);
136  }
137  return frame;
138  }
139  virtual Op_t opCode(void) const {return opCode_;};
140  virtual std::string toString(void) const {return GetOpName(opCode_);}
141  virtual void print(void) const {
142  CCEC_LOG( LOG_DEBUG , "Opcode : %s \n",toString().c_str());
143  };
144 private:
145  Op_t opCode_;
146 };
147 
148 
149 
150 CCEC_END_NAMESPACE;
151 
152 
153 #endif
154 
155 
156 /** @} */
157 /** @} */
OpCode
Definition: OpCode.hpp:123
CECFrame
Definition: CECFrame.hpp:40
CCEC_LOG
void CCEC_LOG(int level, const char *format ...)
This function is used to gets the logs depending on the level of log and print these to standard outp...
Definition: Util.cpp:120
DataBlock
Definition: DataBlock.hpp:45