2 * This file is part of the libCEC(R) library.
4 * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
5 * libCEC(R) is an original work, containing original code.
7 * libCEC(R) is a trademark of Pulse-Eight Limited.
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.
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.
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.
24 * Alternatively, you can license this library under a commercial license,
25 * please contact Pulse-Eight Licensing for more information.
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/
33 #include "CECBusDevice.h"
34 #include "../CECProcessor.h"
35 #include "../implementations/ANCommandHandler.h"
36 #include "../implementations/CECCommandHandler.h"
37 #include "../implementations/SLCommandHandler.h"
38 #include "../implementations/VLCommandHandler.h"
39 #include "../platform/timeutils.h"
43 #define ToString(p) CCECCommandHandler::ToString(p)
45 CCECBusDevice::CCECBusDevice(CCECProcessor
*processor
, cec_logical_address iLogicalAddress
, uint16_t iPhysicalAddress
) :
46 m_type(CEC_DEVICE_TYPE_RESERVED
),
47 m_iPhysicalAddress(iPhysicalAddress
),
49 m_iLogicalAddress(iLogicalAddress
),
50 m_powerStatus(CEC_POWER_STATUS_UNKNOWN
),
51 m_processor(processor
),
52 m_vendor(CEC_VENDOR_UNKNOWN
),
53 m_menuState(CEC_MENU_STATE_ACTIVATED
),
54 m_bActiveSource(false),
55 m_iLastCommandSent(0),
57 m_cecVersion(CEC_VERSION_UNKNOWN
),
58 m_deviceStatus(CEC_DEVICE_STATUS_UNKNOWN
)
60 m_handler
= new CCECCommandHandler(this);
62 for (unsigned int iPtr
= 0; iPtr
< 4; iPtr
++)
63 m_menuLanguage
.language
[iPtr
] = '?';
64 m_menuLanguage
.language
[3] = 0;
65 m_menuLanguage
.device
= iLogicalAddress
;
67 m_strDeviceName
= ToString(m_iLogicalAddress
);
70 CCECBusDevice::~CCECBusDevice(void)
72 m_condition
.Broadcast();
76 void CCECBusDevice::AddLog(cec_log_level level
, const CStdString
&strMessage
)
78 m_processor
->AddLog(level
, strMessage
);
81 bool CCECBusDevice::HandleCommand(const cec_command
&command
)
83 CLockObject
lock(&m_transmitMutex
);
84 m_iLastActive
= GetTimeMs();
85 m_handler
->HandleCommand(command
);
90 void CCECBusDevice::PollVendorId(void)
92 CLockObject
lock(&m_transmitMutex
);
93 if (m_iLastActive
> 0 && m_iLogicalAddress
!= CECDEVICE_BROADCAST
&&
94 m_vendor
== CEC_VENDOR_UNKNOWN
&&
95 GetTimeMs() - m_iLastCommandSent
> 5000 &&
96 !m_processor
->IsMonitoring())
99 strLog
.Format("<< requesting vendor ID of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
100 AddLog(CEC_LOG_NOTICE
, strLog
);
101 m_iLastCommandSent
= GetTimeMs();
104 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
);
105 if (m_processor
->Transmit(command
))
106 m_condition
.Wait(&m_transmitMutex
, 1000);
110 bool CCECBusDevice::PowerOn(void)
113 strLog
.Format("<< powering on '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
114 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
117 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_IMAGE_VIEW_ON
);
118 if (m_processor
->Transmit(command
))
127 bool CCECBusDevice::Standby(void)
130 strLog
.Format("<< putting '%s' (%X) in standby mode", GetLogicalAddressName(), m_iLogicalAddress
);
131 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
134 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_STANDBY
);
136 return m_processor
->Transmit(command
);
141 cec_version
CCECBusDevice::GetCecVersion(void)
143 CLockObject
lock(&m_mutex
);
144 if (m_cecVersion
== CEC_VERSION_UNKNOWN
)
154 bool CCECBusDevice::RequestCecVersion(void)
157 if (!MyLogicalAddressContains(m_iLogicalAddress
))
160 strLog
.Format("<< requesting CEC version of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
161 AddLog(CEC_LOG_NOTICE
, strLog
);
163 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_GET_CEC_VERSION
);
164 CLockObject
lock(&m_transmitMutex
);
165 if (m_processor
->Transmit(command
))
166 bReturn
= m_condition
.Wait(&m_transmitMutex
, 1000);
171 const char* CCECBusDevice::GetLogicalAddressName(void) const
173 return ToString(m_iLogicalAddress
);
176 cec_menu_language
&CCECBusDevice::GetMenuLanguage(void)
178 CLockObject
lock(&m_mutex
);
179 if (!strcmp(m_menuLanguage
.language
, "???"))
182 RequestMenuLanguage();
185 return m_menuLanguage
;
188 bool CCECBusDevice::RequestMenuLanguage(void)
191 if (!MyLogicalAddressContains(m_iLogicalAddress
))
194 strLog
.Format("<< requesting menu language of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
195 AddLog(CEC_LOG_NOTICE
, strLog
);
197 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_GET_MENU_LANGUAGE
);
198 CLockObject
lock(&m_transmitMutex
);
199 if (m_processor
->Transmit(command
))
200 bReturn
= m_condition
.Wait(&m_transmitMutex
, 1000);
205 cec_logical_address
CCECBusDevice::GetMyLogicalAddress(void) const
207 return m_processor
->GetLogicalAddress();
210 uint16_t CCECBusDevice::GetMyPhysicalAddress(void) const
212 return m_processor
->GetPhysicalAddress();
215 cec_power_status
CCECBusDevice::GetPowerStatus(void)
217 CLockObject
lock(&m_mutex
);
218 if (m_powerStatus
== CEC_POWER_STATUS_UNKNOWN
)
221 RequestPowerStatus();
224 return m_powerStatus
;
227 bool CCECBusDevice::RequestPowerStatus(void)
230 if (!MyLogicalAddressContains(m_iLogicalAddress
))
233 strLog
.Format("<< requesting power status of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
234 AddLog(CEC_LOG_NOTICE
, strLog
);
236 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
);
237 CLockObject
lock(&m_transmitMutex
);
238 if (m_processor
->Transmit(command
))
239 bReturn
= m_condition
.Wait(&m_transmitMutex
, 1000);
244 cec_vendor_id
CCECBusDevice::GetVendorId(void)
246 CLockObject
lock(&m_mutex
);
247 if (m_vendor
== CEC_VENDOR_UNKNOWN
)
256 bool CCECBusDevice::RequestVendorId(void)
259 if (!MyLogicalAddressContains(m_iLogicalAddress
))
262 strLog
.Format("<< requesting vendor ID of '%s' (%X)", GetLogicalAddressName(), m_iLogicalAddress
);
263 AddLog(CEC_LOG_NOTICE
, strLog
);
265 cec_command::Format(command
, GetMyLogicalAddress(), m_iLogicalAddress
, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
);
267 CLockObject
lock(&m_transmitMutex
);
268 if (m_processor
->Transmit(command
))
269 bReturn
= m_condition
.Wait(&m_transmitMutex
, 1000);
274 const char *CCECBusDevice::GetVendorName(void)
276 return ToString(GetVendorId());
279 bool CCECBusDevice::MyLogicalAddressContains(cec_logical_address address
) const
281 return m_processor
->HasLogicalAddress(address
);
284 cec_bus_device_status
CCECBusDevice::GetStatus(void)
286 CLockObject
lock(&m_mutex
);
287 if (m_deviceStatus
== CEC_DEVICE_STATUS_UNKNOWN
)
289 if (m_processor
->PollDevice(m_iLogicalAddress
))
290 m_deviceStatus
= CEC_DEVICE_STATUS_PRESENT
;
292 m_deviceStatus
= CEC_DEVICE_STATUS_NOT_PRESENT
;
295 return m_deviceStatus
;
302 void CCECBusDevice::SetCecVersion(const cec_version newVersion
)
304 m_cecVersion
= newVersion
;
307 strLog
.Format("%s (%X): CEC version %s", GetLogicalAddressName(), m_iLogicalAddress
, ToString(newVersion
));
308 AddLog(CEC_LOG_DEBUG
, strLog
);
311 void CCECBusDevice::SetMenuLanguage(const cec_menu_language
&language
)
313 CLockObject
lock(&m_mutex
);
314 if (language
.device
== m_iLogicalAddress
)
317 strLog
.Format(">> %s (%X): menu language set to '%s'", GetLogicalAddressName(), m_iLogicalAddress
, language
.language
);
318 m_processor
->AddLog(CEC_LOG_DEBUG
, strLog
);
319 m_menuLanguage
= language
;
323 void CCECBusDevice::SetOSDName(CStdString strName
)
325 CLockObject
lock(&m_mutex
);
326 if (m_strDeviceName
!= strName
)
329 strLog
.Format(">> %s (%X): osd name set to '%s'", GetLogicalAddressName(), m_iLogicalAddress
, strName
);
330 m_processor
->AddLog(CEC_LOG_DEBUG
, strLog
);
331 m_strDeviceName
= strName
;
335 void CCECBusDevice::SetMenuState(const cec_menu_state state
)
337 CLockObject
lock(&m_mutex
);
338 if (m_menuState
!= state
)
341 strLog
.Format(">> %s (%X): menu state set to '%s'", GetLogicalAddressName(), m_iLogicalAddress
, ToString(m_menuState
));
342 m_processor
->AddLog(CEC_LOG_DEBUG
, strLog
);
347 void CCECBusDevice::SetInactiveDevice(void)
349 CLockObject
lock(&m_mutex
);
350 m_bActiveSource
= false;
353 void CCECBusDevice::SetActiveDevice(void)
355 CLockObject
lock(&m_mutex
);
357 for (int iPtr
= 0; iPtr
< 16; iPtr
++)
358 if (iPtr
!= m_iLogicalAddress
)
359 m_processor
->m_busDevices
[iPtr
]->SetInactiveDevice();
361 m_bActiveSource
= true;
362 m_powerStatus
= CEC_POWER_STATUS_ON
;
365 bool CCECBusDevice::TryLogicalAddress(void)
368 strLog
.Format("trying logical address '%s'", GetLogicalAddressName());
369 AddLog(CEC_LOG_DEBUG
, strLog
);
371 m_processor
->SetAckMask(0x1 << m_iLogicalAddress
);
372 if (!TransmitPoll(m_iLogicalAddress
))
374 strLog
.Format("using logical address '%s'", GetLogicalAddressName());
375 AddLog(CEC_LOG_NOTICE
, strLog
);
376 SetDeviceStatus(CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC
);
381 strLog
.Format("logical address '%s' already taken", GetLogicalAddressName());
382 AddLog(CEC_LOG_DEBUG
, strLog
);
383 SetDeviceStatus(CEC_DEVICE_STATUS_PRESENT
);
387 void CCECBusDevice::SetDeviceStatus(const cec_bus_device_status newStatus
)
389 CLockObject
lock(&m_mutex
);
392 case CEC_DEVICE_STATUS_UNKNOWN
:
394 m_powerStatus
= CEC_POWER_STATUS_UNKNOWN
;
395 m_vendor
= CEC_VENDOR_UNKNOWN
;
396 m_menuState
= CEC_MENU_STATE_ACTIVATED
;
397 m_bActiveSource
= false;
398 m_iLastCommandSent
= 0;
400 m_cecVersion
= CEC_VERSION_UNKNOWN
;
401 m_deviceStatus
= newStatus
;
403 case CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC
:
405 m_powerStatus
= CEC_POWER_STATUS_ON
;
406 m_vendor
= CEC_VENDOR_UNKNOWN
;
407 m_menuState
= CEC_MENU_STATE_ACTIVATED
;
408 m_bActiveSource
= false;
409 m_iLastCommandSent
= 0;
411 m_cecVersion
= CEC_VERSION_1_3A
;
412 m_deviceStatus
= newStatus
;
414 case CEC_DEVICE_STATUS_PRESENT
:
415 case CEC_DEVICE_STATUS_NOT_PRESENT
:
416 m_deviceStatus
= newStatus
;
421 void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress
)
423 CLockObject
lock(&m_mutex
);
427 strLog
.Format(">> %s (%X): physical address changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress
, m_iPhysicalAddress
, iNewAddress
);
428 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
430 m_iPhysicalAddress
= iNewAddress
;
434 void CCECBusDevice::SetStreamPath(uint16_t iNewAddress
, uint16_t iOldAddress
/* = 0 */)
436 CLockObject
lock(&m_mutex
);
440 strLog
.Format(">> %s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress
, iOldAddress
, iNewAddress
);
441 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
443 m_iStreamPath
= iNewAddress
;
448 SetPowerStatus(CEC_POWER_STATUS_ON
);
453 void CCECBusDevice::SetPowerStatus(const cec_power_status powerStatus
)
455 CLockObject
lock(&m_mutex
);
456 if (m_powerStatus
!= powerStatus
)
459 strLog
.Format(">> %s (%X): power status changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress
, ToString(m_powerStatus
), ToString(powerStatus
));
460 m_processor
->AddLog(CEC_LOG_DEBUG
, strLog
);
461 m_powerStatus
= powerStatus
;
465 void CCECBusDevice::SetVendorId(uint64_t iVendorId
)
468 CLockObject
lock(&m_mutex
);
469 m_vendor
= (cec_vendor_id
)iVendorId
;
473 case CEC_VENDOR_SAMSUNG
:
474 if (m_handler
->GetVendorId() != CEC_VENDOR_SAMSUNG
)
477 m_handler
= new CANCommandHandler(this);
481 if (m_handler
->GetVendorId() != CEC_VENDOR_LG
)
484 m_handler
= new CSLCommandHandler(this);
487 case CEC_VENDOR_PANASONIC
:
488 if (m_handler
->GetVendorId() != CEC_VENDOR_PANASONIC
)
491 m_handler
= new CVLCommandHandler(this);
495 if (m_handler
->GetVendorId() != CEC_VENDOR_UNKNOWN
)
498 m_handler
= new CCECCommandHandler(this);
505 strLog
.Format("%s (%X): vendor = %s (%06x)", GetLogicalAddressName(), m_iLogicalAddress
, GetVendorName(), m_vendor
);
506 m_processor
->AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
510 /** @name Transmit methods */
512 bool CCECBusDevice::TransmitActiveSource(void)
514 CLockObject
lock(&m_mutex
);
515 if (m_powerStatus
!= CEC_POWER_STATUS_ON
)
518 strLog
.Format("<< %s (%X) is not powered on", GetLogicalAddressName(), m_iLogicalAddress
);
519 AddLog(CEC_LOG_DEBUG
, strLog
);
521 else if (m_bActiveSource
)
524 strLog
.Format("<< %s (%X) -> broadcast (F): active source (%4x)", GetLogicalAddressName(), m_iLogicalAddress
, m_iPhysicalAddress
);
525 AddLog(CEC_LOG_NOTICE
, strLog
);
528 cec_command::Format(command
, m_iLogicalAddress
, CECDEVICE_BROADCAST
, CEC_OPCODE_ACTIVE_SOURCE
);
529 command
.parameters
.PushBack((uint8_t) ((m_iPhysicalAddress
>> 8) & 0xFF));
530 command
.parameters
.PushBack((uint8_t) (m_iPhysicalAddress
& 0xFF));
533 return m_processor
->Transmit(command
);
538 strLog
.Format("<< %s (%X) is not the active source", GetLogicalAddressName(), m_iLogicalAddress
);
539 AddLog(CEC_LOG_DEBUG
, strLog
);
545 bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest
)
547 CLockObject
lock(&m_mutex
);
549 strLog
.Format("<< %s (%X) -> %s (%X): cec version %s", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, ToString(m_cecVersion
));
550 AddLog(CEC_LOG_NOTICE
, strLog
);
553 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_CEC_VERSION
);
554 command
.parameters
.PushBack((uint8_t)m_cecVersion
);
557 return m_processor
->Transmit(command
);
560 bool CCECBusDevice::TransmitInactiveView(void)
563 strLog
.Format("<< %s (%X) -> broadcast (F): inactive view", GetLogicalAddressName(), m_iLogicalAddress
);
564 AddLog(CEC_LOG_NOTICE
, strLog
);
567 cec_command::Format(command
, m_iLogicalAddress
, CECDEVICE_BROADCAST
, CEC_OPCODE_INACTIVE_SOURCE
);
568 command
.parameters
.PushBack((m_iPhysicalAddress
>> 8) & 0xFF);
569 command
.parameters
.PushBack(m_iPhysicalAddress
& 0xFF);
571 return m_processor
->Transmit(command
);
574 bool CCECBusDevice::TransmitMenuState(cec_logical_address dest
)
577 strLog
.Format("<< %s (%X) -> %s (%X): menu state '%s'", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, ToString(m_menuState
));
578 AddLog(CEC_LOG_NOTICE
, strLog
);
581 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_MENU_STATUS
);
582 command
.parameters
.PushBack((uint8_t)m_menuState
);
584 return m_processor
->Transmit(command
);
587 bool CCECBusDevice::TransmitOSDName(cec_logical_address dest
)
589 CLockObject
lock(&m_mutex
);
591 strLog
.Format("<< %s (%X) -> %s (%X): OSD name '%s'", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, m_strDeviceName
.c_str());
592 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
595 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_SET_OSD_NAME
);
596 for (unsigned int iPtr
= 0; iPtr
< m_strDeviceName
.length(); iPtr
++)
597 command
.parameters
.PushBack(m_strDeviceName
.at(iPtr
));
600 return m_processor
->Transmit(command
);
603 bool CCECBusDevice::TransmitOSDString(cec_logical_address dest
, cec_display_control duration
, const char *strMessage
)
605 CLockObject
lock(&m_mutex
);
607 strLog
.Format("<< %s (%X) -> %s (%X): display OSD message '%s'", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, strMessage
);
608 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
611 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_SET_OSD_STRING
);
612 command
.parameters
.PushBack((uint8_t)duration
);
614 unsigned int iLen
= strlen(strMessage
);
615 if (iLen
> 13) iLen
= 13;
617 for (unsigned int iPtr
= 0; iPtr
< iLen
; iPtr
++)
618 command
.parameters
.PushBack(strMessage
[iPtr
]);
621 return m_processor
->Transmit(command
);
624 bool CCECBusDevice::TransmitPhysicalAddress(void)
626 CLockObject
lock(&m_mutex
);
628 strLog
.Format("<< %s (%X) -> broadcast (F): physical adddress %4x", GetLogicalAddressName(), m_iLogicalAddress
, m_iPhysicalAddress
);
629 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
632 cec_command::Format(command
, m_iLogicalAddress
, CECDEVICE_BROADCAST
, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
);
633 command
.parameters
.PushBack((uint8_t) ((m_iPhysicalAddress
>> 8) & 0xFF));
634 command
.parameters
.PushBack((uint8_t) (m_iPhysicalAddress
& 0xFF));
635 command
.parameters
.PushBack((uint8_t) (m_type
));
638 return m_processor
->Transmit(command
);
641 bool CCECBusDevice::TransmitPoll(cec_logical_address dest
)
644 if (dest
== CECDEVICE_UNKNOWN
)
645 dest
= m_iLogicalAddress
;
648 strLog
.Format("<< %s (%X) -> %s (%X): POLL", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
);
649 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
652 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_NONE
);
653 CLockObject
lock(&m_transmitMutex
);
655 bReturn
= m_processor
->Transmit(command
);
656 AddLog(CEC_LOG_DEBUG
, bReturn
? ">> POLL sent" : ">> POLL not sent");
660 bool CCECBusDevice::TransmitPowerState(cec_logical_address dest
)
662 CLockObject
lock(&m_mutex
);
664 strLog
.Format("<< %s (%X) -> %s (%X): %s", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, ToString(m_powerStatus
));
665 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
668 cec_command::Format(command
, m_iLogicalAddress
, dest
, CEC_OPCODE_REPORT_POWER_STATUS
);
669 command
.parameters
.PushBack((uint8_t) m_powerStatus
);
672 return m_processor
->Transmit(command
);
675 bool CCECBusDevice::TransmitVendorID(cec_logical_address dest
)
677 CLockObject
lock(&m_mutex
);
678 if (m_vendor
== CEC_VENDOR_UNKNOWN
)
681 strLog
.Format("<< %s (%X) -> %s (%X): vendor id feature abort", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
);
682 AddLog(CEC_LOG_NOTICE
, strLog
);
685 m_processor
->TransmitAbort(dest
, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
);
691 strLog
.Format("<< %s (%X) -> %s (%X): vendor id %s (%x)", GetLogicalAddressName(), m_iLogicalAddress
, ToString(dest
), dest
, ToString(m_vendor
), (uint64_t)m_vendor
);
692 AddLog(CEC_LOG_NOTICE
, strLog
);
695 cec_command::Format(command
, m_iLogicalAddress
, CECDEVICE_BROADCAST
, CEC_OPCODE_DEVICE_VENDOR_ID
);
697 command
.parameters
.PushBack((uint8_t) (((uint64_t)m_vendor
>> 16) & 0xFF));
698 command
.parameters
.PushBack((uint8_t) (((uint64_t)m_vendor
>> 8) & 0xFF));
699 command
.parameters
.PushBack((uint8_t) ((uint64_t)m_vendor
& 0xFF));
702 return m_processor
->Transmit(command
);