Commit | Line | Data |
---|---|---|
e9de9629 LOK |
1 | /* |
2 | * This file is part of the libCEC(R) library. | |
3 | * | |
4 | * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved. | |
5 | * libCEC(R) is an original work, containing original code. | |
6 | * | |
7 | * libCEC(R) is a trademark of Pulse-Eight Limited. | |
8 | * | |
9 | * This program is dual-licensed; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 | * | |
23 | * | |
24 | * Alternatively, you can license this library under a commercial license, | |
25 | * please contact Pulse-Eight Licensing for more information. | |
26 | * | |
27 | * For more information contact: | |
28 | * Pulse-Eight Licensing <license@pulse-eight.com> | |
29 | * http://www.pulse-eight.com/ | |
30 | * http://www.pulse-eight.net/ | |
31 | */ | |
32 | ||
33 | #include "CECBusDevice.h" | |
eafa9d46 LOK |
34 | #include "../CECProcessor.h" |
35 | #include "../implementations/ANCommandHandler.h" | |
36 | #include "../implementations/CECCommandHandler.h" | |
37 | #include "../implementations/SLCommandHandler.h" | |
11621576 | 38 | #include "../implementations/VLCommandHandler.h" |
eafa9d46 | 39 | #include "../platform/timeutils.h" |
e9de9629 LOK |
40 | |
41 | using namespace CEC; | |
42 | ||
43 | CCECBusDevice::CCECBusDevice(CCECProcessor *processor, cec_logical_address iLogicalAddress, uint16_t iPhysicalAddress) : | |
44 | m_iPhysicalAddress(iPhysicalAddress), | |
45 | m_iLogicalAddress(iLogicalAddress), | |
e55f3f70 | 46 | m_powerStatus(CEC_POWER_STATUS_UNKNOWN), |
e9de9629 | 47 | m_processor(processor), |
1844f5f7 | 48 | m_bMenuActive(true), |
0ab58650 | 49 | m_iVendorClass(CEC_VENDOR_UNKNOWN), |
6a1c0009 | 50 | m_iLastActive(0), |
700c1ea7 | 51 | m_cecVersion(CEC_VERSION_1_3A) |
e9de9629 LOK |
52 | { |
53 | m_handler = new CCECCommandHandler(this); | |
51b2a094 | 54 | |
a3269a0a LOK |
55 | for (unsigned int iPtr = 0; iPtr < 4; iPtr++) |
56 | m_menuLanguage.language[iPtr] = '?'; | |
57 | m_menuLanguage.language[3] = 0; | |
58 | m_menuLanguage.device = iLogicalAddress; | |
1fcf5a3f | 59 | |
51b2a094 LOK |
60 | m_vendor.vendor = CEC_VENDOR_UNKNOWN; |
61 | m_type = CEC_DEVICE_TYPE_RESERVED; | |
62 | m_strDeviceName = "Unknown"; | |
e9de9629 LOK |
63 | } |
64 | ||
65 | CCECBusDevice::~CCECBusDevice(void) | |
66 | { | |
6a1c0009 | 67 | m_condition.Broadcast(); |
e9de9629 LOK |
68 | delete m_handler; |
69 | } | |
70 | ||
93729720 | 71 | void CCECBusDevice::AddLog(cec_log_level level, const CStdString &strMessage) |
e9de9629 | 72 | { |
93729720 | 73 | m_processor->AddLog(level, strMessage); |
e9de9629 LOK |
74 | } |
75 | ||
93729720 | 76 | bool CCECBusDevice::HandleCommand(const cec_command &command) |
f8513317 | 77 | { |
93729720 LOK |
78 | CLockObject lock(&m_mutex); |
79 | m_iLastActive = GetTimeMs(); | |
80 | m_handler->HandleCommand(command); | |
81 | m_condition.Signal(); | |
82 | return true; | |
83 | } | |
84 | ||
85 | void CCECBusDevice::PollVendorId(void) | |
86 | { | |
87 | CLockObject lock(&m_mutex); | |
88 | if (m_iLastActive > 0 && m_iLogicalAddress != CECDEVICE_BROADCAST && | |
89 | m_vendor.vendor == CEC_VENDOR_UNKNOWN && | |
90 | GetTimeMs() - m_iLastActive > 5000) | |
91 | { | |
92 | m_iLastActive = GetTimeMs(); | |
93 | ||
94 | cec_command command; | |
95 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); | |
96 | if (m_processor->Transmit(command)) | |
97 | m_condition.Wait(&m_mutex, 1000); | |
98 | } | |
99 | } | |
100 | ||
101 | bool CCECBusDevice::PowerOn(void) | |
102 | { | |
103 | CStdString strLog; | |
104 | strLog.Format("<< powering on device with logical address %d", (int8_t)m_iLogicalAddress); | |
105 | AddLog(CEC_LOG_DEBUG, strLog.c_str()); | |
106 | ||
107 | cec_command command; | |
108 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON); | |
109 | ||
110 | return m_processor->Transmit(command); | |
111 | } | |
112 | ||
113 | bool CCECBusDevice::Standby(void) | |
114 | { | |
115 | CStdString strLog; | |
116 | strLog.Format("<< putting device with logical address %d in standby mode", (int8_t)m_iLogicalAddress); | |
117 | AddLog(CEC_LOG_DEBUG, strLog.c_str()); | |
118 | ||
119 | cec_command command; | |
120 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_STANDBY); | |
121 | ||
122 | return m_processor->Transmit(command); | |
123 | } | |
124 | ||
125 | /** @name Getters */ | |
126 | //@{ | |
127 | cec_version CCECBusDevice::GetCecVersion(bool bRefresh /* = true */) | |
128 | { | |
129 | if (bRefresh || m_cecVersion == CEC_VERSION_UNKNOWN) | |
130 | { | |
131 | AddLog(CEC_LOG_NOTICE, "<< requesting CEC version"); | |
132 | cec_command command; | |
133 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_CEC_VERSION); | |
134 | CLockObject lock(&m_mutex); | |
135 | if (m_processor->Transmit(command)) | |
136 | m_condition.Wait(&m_mutex, 1000); | |
137 | } | |
138 | ||
139 | return m_cecVersion; | |
140 | } | |
141 | ||
142 | cec_menu_language &CCECBusDevice::GetMenuLanguage(bool bRefresh /* = true */) | |
143 | { | |
144 | if (bRefresh || !strcmp(m_menuLanguage.language, "???")) | |
145 | { | |
146 | AddLog(CEC_LOG_NOTICE, "<< requesting menu language"); | |
147 | cec_command command; | |
148 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GET_MENU_LANGUAGE); | |
149 | CLockObject lock(&m_mutex); | |
150 | if (m_processor->Transmit(command)) | |
151 | m_condition.Wait(&m_mutex, 1000); | |
152 | } | |
153 | ||
154 | return m_menuLanguage; | |
155 | } | |
156 | ||
157 | cec_logical_address CCECBusDevice::GetMyLogicalAddress(void) const | |
158 | { | |
159 | return m_processor->GetLogicalAddress(); | |
f8513317 LOK |
160 | } |
161 | ||
e9de9629 LOK |
162 | uint16_t CCECBusDevice::GetMyPhysicalAddress(void) const |
163 | { | |
164 | return m_processor->GetPhysicalAddress(); | |
165 | } | |
166 | ||
93729720 | 167 | cec_power_status CCECBusDevice::GetPowerStatus(bool bRefresh /* = true */) |
e9de9629 | 168 | { |
93729720 LOK |
169 | if (bRefresh || m_powerStatus == CEC_POWER_STATUS_UNKNOWN) |
170 | { | |
171 | AddLog(CEC_LOG_NOTICE, "<< requesting power status"); | |
172 | cec_command command; | |
173 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_POWER_STATUS); | |
174 | CLockObject lock(&m_mutex); | |
175 | if (m_processor->Transmit(command)) | |
176 | m_condition.Wait(&m_mutex, 1000); | |
177 | } | |
178 | ||
179 | return m_powerStatus; | |
e9de9629 LOK |
180 | } |
181 | ||
93729720 | 182 | const cec_vendor &CCECBusDevice::GetVendor(void) |
a3269a0a | 183 | { |
93729720 | 184 | if (m_vendor.vendor == CEC_VENDOR_UNKNOWN) |
a3269a0a | 185 | { |
93729720 LOK |
186 | AddLog(CEC_LOG_NOTICE, "<< requesting vendor ID"); |
187 | cec_command command; | |
188 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); | |
189 | CLockObject lock(&m_mutex); | |
190 | ||
191 | if (m_processor->Transmit(command)) | |
192 | m_condition.Wait(&m_mutex, 1000); | |
a3269a0a | 193 | } |
93729720 LOK |
194 | |
195 | return m_vendor; | |
196 | } | |
197 | ||
198 | bool CCECBusDevice::MyLogicalAddressContains(cec_logical_address address) const | |
199 | { | |
200 | return m_processor->HasLogicalAddress(address); | |
a3269a0a LOK |
201 | } |
202 | ||
93729720 LOK |
203 | //@} |
204 | ||
205 | /** @name Setters */ | |
206 | //@{ | |
e55f3f70 | 207 | void CCECBusDevice::SetCecVersion(const cec_version newVersion) |
6a1c0009 LOK |
208 | { |
209 | CStdString strLog; | |
210 | m_cecVersion = newVersion; | |
211 | ||
212 | switch (newVersion) | |
213 | { | |
214 | case CEC_VERSION_1_2: | |
215 | strLog.Format("device %d reports CEC version 1.2", m_iLogicalAddress); | |
216 | break; | |
217 | case CEC_VERSION_1_2A: | |
218 | strLog.Format("device %d reports CEC version 1.2a", m_iLogicalAddress); | |
219 | break; | |
220 | case CEC_VERSION_1_3: | |
221 | strLog.Format("device %d reports CEC version 1.3", m_iLogicalAddress); | |
222 | break; | |
223 | case CEC_VERSION_1_3A: | |
224 | strLog.Format("device %d reports CEC version 1.3a", m_iLogicalAddress); | |
225 | break; | |
226 | default: | |
227 | strLog.Format("device %d reports an unknown CEC version", m_iLogicalAddress); | |
228 | m_cecVersion = CEC_VERSION_UNKNOWN; | |
229 | break; | |
230 | } | |
231 | AddLog(CEC_LOG_DEBUG, strLog); | |
232 | } | |
233 | ||
93729720 LOK |
234 | void CCECBusDevice::SetMenuLanguage(const cec_menu_language &language) |
235 | { | |
236 | if (language.device == m_iLogicalAddress) | |
237 | { | |
238 | CStdString strLog; | |
239 | strLog.Format("device %d menu language set to '%s'", m_iLogicalAddress, language.language); | |
240 | m_processor->AddLog(CEC_LOG_DEBUG, strLog); | |
241 | m_menuLanguage = language; | |
242 | } | |
243 | } | |
244 | ||
245 | bool CCECBusDevice::SetOSDString(cec_display_control duration, const char *strMessage) | |
246 | { | |
247 | CStdString strLog; | |
248 | strLog.Format("<< display message '%s'", strMessage); | |
249 | AddLog(CEC_LOG_NOTICE, strLog.c_str()); | |
250 | ||
251 | cec_command command; | |
252 | cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_SET_OSD_STRING); | |
253 | command.parameters.push_back((uint8_t)duration); | |
254 | ||
255 | unsigned int iLen = strlen(strMessage); | |
256 | if (iLen > 13) iLen = 13; | |
257 | ||
258 | for (unsigned int iPtr = 0; iPtr < iLen; iPtr++) | |
259 | command.parameters.push_back(strMessage[iPtr]); | |
260 | ||
261 | return m_processor->Transmit(command); | |
262 | } | |
263 | ||
264 | void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress, uint16_t iOldAddress /* = 0 */) | |
265 | { | |
266 | if (iNewAddress > 0) | |
267 | { | |
268 | CStdString strLog; | |
269 | strLog.Format(">> %i changed physical address from %04x to %04x", m_iLogicalAddress, m_iPhysicalAddress, iNewAddress); | |
270 | AddLog(CEC_LOG_DEBUG, strLog.c_str()); | |
271 | ||
272 | m_iPhysicalAddress = iNewAddress; | |
273 | } | |
274 | } | |
275 | ||
e55f3f70 LOK |
276 | void CCECBusDevice::SetPowerStatus(const cec_power_status powerStatus) |
277 | { | |
b0271d54 LOK |
278 | if (m_powerStatus != powerStatus) |
279 | { | |
280 | CStdString strLog; | |
281 | strLog.Format("device %d power status changed from %2x to %2x", m_iLogicalAddress, m_powerStatus, powerStatus); | |
282 | m_processor->AddLog(CEC_LOG_DEBUG, strLog); | |
283 | m_powerStatus = powerStatus; | |
284 | } | |
e55f3f70 LOK |
285 | } |
286 | ||
0f23c85c LOK |
287 | void CCECBusDevice::SetVendorId(const cec_datapacket &data) |
288 | { | |
289 | if (data.size < 3) | |
290 | { | |
291 | AddLog(CEC_LOG_WARNING, "invalid vendor ID received"); | |
292 | return; | |
293 | } | |
294 | ||
295 | uint64_t iVendorId = ((uint64_t)data[0] << 3) + | |
296 | ((uint64_t)data[1] << 2) + | |
297 | (uint64_t)data[2]; | |
298 | ||
299 | SetVendorId(iVendorId, data.size >= 4 ? data[3] : 0); | |
300 | } | |
301 | ||
2cd8b5d0 | 302 | void CCECBusDevice::SetVendorId(uint64_t iVendorId, uint8_t iVendorClass /* = 0 */) |
e9de9629 | 303 | { |
0500da96 | 304 | m_vendor.vendor = (cec_vendor_id)iVendorId; |
e9de9629 LOK |
305 | m_iVendorClass = iVendorClass; |
306 | ||
307 | switch (iVendorId) | |
308 | { | |
309 | case CEC_VENDOR_SAMSUNG: | |
0ab58650 LOK |
310 | if (m_handler->GetVendorId() != CEC_VENDOR_SAMSUNG) |
311 | { | |
312 | delete m_handler; | |
313 | m_handler = new CANCommandHandler(this); | |
314 | } | |
e9de9629 LOK |
315 | break; |
316 | case CEC_VENDOR_LG: | |
0ab58650 LOK |
317 | if (m_handler->GetVendorId() != CEC_VENDOR_LG) |
318 | { | |
319 | delete m_handler; | |
320 | m_handler = new CSLCommandHandler(this); | |
321 | } | |
e9de9629 | 322 | break; |
11621576 LOK |
323 | case CEC_VENDOR_PANASONIC: |
324 | if (m_handler->GetVendorId() != CEC_VENDOR_PANASONIC) | |
325 | { | |
326 | delete m_handler; | |
327 | m_handler = new CVLCommandHandler(this); | |
328 | } | |
329 | break; | |
e9de9629 | 330 | default: |
0ab58650 LOK |
331 | if (m_handler->GetVendorId() != CEC_VENDOR_UNKNOWN) |
332 | { | |
333 | delete m_handler; | |
334 | m_handler = new CCECCommandHandler(this); | |
335 | } | |
e9de9629 LOK |
336 | break; |
337 | } | |
338 | ||
339 | CStdString strLog; | |
0f23c85c | 340 | strLog.Format("device %d: vendor = %s (%06x) class = %2x", m_iLogicalAddress, GetVendorName(), GetVendorId(), GetVendorClass()); |
e9de9629 LOK |
341 | m_processor->AddLog(CEC_LOG_DEBUG, strLog.c_str()); |
342 | } | |
93729720 | 343 | //@} |
e9de9629 | 344 | |
93729720 LOK |
345 | /** @name Transmit methods */ |
346 | //@{ | |
347 | bool CCECBusDevice::TransmitActiveSource(void) | |
0f23c85c | 348 | { |
93729720 | 349 | AddLog(CEC_LOG_NOTICE, "<< broadcasting active source"); |
0f23c85c LOK |
350 | |
351 | cec_command command; | |
93729720 LOK |
352 | cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE); |
353 | command.parameters.push_back((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); | |
354 | command.parameters.push_back((uint8_t) (m_iPhysicalAddress & 0xFF)); | |
0f23c85c LOK |
355 | |
356 | return m_processor->Transmit(command); | |
357 | } | |
358 | ||
93729720 | 359 | bool CCECBusDevice::TransmitActiveView(void) |
0f23c85c | 360 | { |
93729720 | 361 | AddLog(CEC_LOG_DEBUG, "<< setting active view"); |
0f23c85c LOK |
362 | |
363 | cec_command command; | |
93729720 LOK |
364 | cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_ACTIVE_SOURCE); |
365 | command.parameters.push_back((m_iPhysicalAddress >> 8) & 0xFF); | |
366 | command.parameters.push_back(m_iPhysicalAddress & 0xFF); | |
0f23c85c LOK |
367 | |
368 | return m_processor->Transmit(command); | |
369 | } | |
370 | ||
29912296 | 371 | bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest) |
0f23c85c LOK |
372 | { |
373 | AddLog(CEC_LOG_NOTICE, "<< reporting CEC version as 1.3a"); | |
374 | ||
375 | cec_command command; | |
f8513317 | 376 | cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_CEC_VERSION); |
700c1ea7 | 377 | command.parameters.push_back(m_cecVersion); |
0f23c85c LOK |
378 | |
379 | return m_processor->Transmit(command); | |
380 | } | |
381 | ||
29912296 | 382 | bool CCECBusDevice::TransmitDeckStatus(cec_logical_address dest) |
0f23c85c LOK |
383 | { |
384 | // need to support opcodes play and deck control before doing anything with this | |
385 | AddLog(CEC_LOG_NOTICE, "<< deck status requested, feature abort"); | |
f8513317 | 386 | m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); |
0f23c85c LOK |
387 | return false; |
388 | } | |
389 | ||
93729720 LOK |
390 | bool CCECBusDevice::TransmitInactiveView(void) |
391 | { | |
392 | AddLog(CEC_LOG_DEBUG, "<< setting inactive view"); | |
393 | ||
394 | cec_command command; | |
395 | cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_INACTIVE_SOURCE); | |
396 | command.parameters.push_back((m_iPhysicalAddress >> 8) & 0xFF); | |
397 | command.parameters.push_back(m_iPhysicalAddress & 0xFF); | |
398 | ||
399 | return m_processor->Transmit(command); | |
400 | } | |
401 | ||
29912296 | 402 | bool CCECBusDevice::TransmitMenuState(cec_logical_address dest) |
0f23c85c | 403 | { |
1844f5f7 | 404 | if (m_bMenuActive) |
0f23c85c LOK |
405 | AddLog(CEC_LOG_NOTICE, "<< reporting menu state as active"); |
406 | else | |
407 | AddLog(CEC_LOG_NOTICE, "<< reporting menu state as inactive"); | |
408 | ||
409 | cec_command command; | |
f8513317 | 410 | cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_MENU_STATUS); |
1844f5f7 | 411 | command.parameters.push_back(m_bMenuActive ? (uint8_t) CEC_MENU_STATE_ACTIVATED : (uint8_t) CEC_MENU_STATE_DEACTIVATED); |
0f23c85c LOK |
412 | |
413 | return m_processor->Transmit(command); | |
414 | } | |
415 | ||
29912296 | 416 | bool CCECBusDevice::TransmitOSDName(cec_logical_address dest) |
0f23c85c | 417 | { |
0f23c85c | 418 | CStdString strLog; |
787a3cb8 | 419 | strLog.Format("<< reporting OSD name as %s", m_strDeviceName.c_str()); |
0f23c85c LOK |
420 | AddLog(CEC_LOG_NOTICE, strLog.c_str()); |
421 | ||
422 | cec_command command; | |
f8513317 | 423 | cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_SET_OSD_NAME); |
787a3cb8 LOK |
424 | for (unsigned int iPtr = 0; iPtr < m_strDeviceName.length(); iPtr++) |
425 | command.parameters.push_back(m_strDeviceName.at(iPtr)); | |
0f23c85c LOK |
426 | |
427 | return m_processor->Transmit(command); | |
428 | } | |
429 | ||
29912296 | 430 | bool CCECBusDevice::TransmitPhysicalAddress(void) |
0f23c85c LOK |
431 | { |
432 | CStdString strLog; | |
433 | strLog.Format("<< reporting physical address as %04x", m_iPhysicalAddress); | |
434 | AddLog(CEC_LOG_NOTICE, strLog.c_str()); | |
435 | ||
436 | cec_command command; | |
f8513317 | 437 | cec_command::format(command, m_iLogicalAddress, CECDEVICE_BROADCAST, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS); |
0f23c85c LOK |
438 | command.parameters.push_back((uint8_t) ((m_iPhysicalAddress >> 8) & 0xFF)); |
439 | command.parameters.push_back((uint8_t) (m_iPhysicalAddress & 0xFF)); | |
440 | command.parameters.push_back((uint8_t) (CEC_DEVICE_TYPE_PLAYBACK_DEVICE)); | |
441 | ||
442 | return m_processor->Transmit(command); | |
443 | } | |
444 | ||
93729720 | 445 | bool CCECBusDevice::TransmitPoll(cec_logical_address dest) |
57f45e6c LOK |
446 | { |
447 | bool bReturn(false); | |
448 | ||
93729720 LOK |
449 | if (dest == CECDEVICE_UNKNOWN) |
450 | dest = m_iLogicalAddress; | |
f8513317 | 451 | |
57f45e6c | 452 | CStdString strLog; |
93729720 | 453 | strLog.Format("<< sending POLL from device %1x to device %1x", m_iLogicalAddress, (int8_t)dest); |
57f45e6c LOK |
454 | AddLog(CEC_LOG_DEBUG, strLog); |
455 | ||
456 | cec_command command; | |
93729720 | 457 | cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_NONE); |
57f45e6c LOK |
458 | CLockObject lock(&m_mutex); |
459 | ||
460 | bReturn = m_processor->Transmit(command); | |
461 | AddLog(CEC_LOG_DEBUG, bReturn ? ">> POLL sent" : ">> POLL not sent"); | |
462 | return bReturn; | |
463 | } | |
93729720 LOK |
464 | |
465 | bool CCECBusDevice::TransmitPowerState(cec_logical_address dest) | |
466 | { | |
467 | CStdString strLog; | |
468 | strLog.Format("<< reporting power status '%d'", m_powerStatus); | |
469 | AddLog(CEC_LOG_NOTICE, strLog); | |
470 | ||
471 | cec_command command; | |
472 | cec_command::format(command, m_iLogicalAddress, dest, CEC_OPCODE_REPORT_POWER_STATUS); | |
473 | command.parameters.push_back((uint8_t) m_powerStatus); | |
474 | ||
475 | return m_processor->Transmit(command); | |
476 | } | |
477 | ||
478 | bool CCECBusDevice::TransmitVendorID(cec_logical_address dest) | |
479 | { | |
480 | AddLog(CEC_LOG_NOTICE, "<< vendor ID requested, feature abort"); | |
481 | m_processor->TransmitAbort(dest, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); | |
482 | return false; | |
483 | } | |
484 | //@} |