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 "CECParser.h"
40 #include "util/StdString.h"
41 #include "libPlatform/serialport.h"
42 #include "util/threads.h"
43 #include "util/timeutils.h"
44 #include "CECDetect.h"
45 #include "Communication.h"
50 #define CEC_MAX_RETRY 5
51 #define CEC_BUTTON_TIMEOUT 500
54 * ICECDevice implementation
57 CCECParser::CCECParser(const char *strDeviceName
, cec_logical_address iLogicalAddress
/* = CECDEVICE_PLAYBACKDEVICE1 */, int iPhysicalAddress
/* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) :
58 m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN
),
59 m_physicaladdress(iPhysicalAddress
),
60 m_iLogicalAddress(iLogicalAddress
),
61 m_strDeviceName(strDeviceName
),
64 m_communication
= new CCommunication(this);
67 CCECParser::~CCECParser(void)
70 m_communication
->Close();
71 delete m_communication
;
74 bool CCECParser::Open(const char *strPort
, int iTimeoutMs
/* = 10000 */)
79 if (m_communication
->IsOpen())
81 AddLog(CEC_LOG_ERROR
, "connection already open");
85 if (!m_communication
->Open(strPort
, 38400, iTimeoutMs
))
87 AddLog(CEC_LOG_ERROR
, "could not open a connection");
91 if (!SetLogicalAddress(m_iLogicalAddress
))
93 AddLog(CEC_LOG_ERROR
, "could not set the logical address");
97 if (pthread_create(&m_thread
, NULL
, (void *(*) (void *))&CCECParser::ThreadHandler
, (void *)this) == 0)
100 AddLog(CEC_LOG_DEBUG
, "processor thread created");
101 pthread_detach(m_thread
);
106 AddLog(CEC_LOG_ERROR
, "could not create a processor thread");
113 bool CCECParser::Close(int iTimeoutMs
/* = 2000 */)
119 bExit
= m_exitCondition
.Wait(&m_mutex
, iTimeoutMs
);
124 pthread_join(m_thread
, NULL
);
131 void *CCECParser::ThreadHandler(CCECParser
*parser
)
138 bool CCECParser::Process(void)
140 int64_t now
= GetTimeMs();
144 while (m_bRunning
&& m_communication
->IsOpen() && m_communication
->Read(msg
, CEC_BUTTON_TIMEOUT
))
148 CheckKeypressTimeout(now
);
149 CCondition::Sleep(50);
152 AddLog(CEC_LOG_DEBUG
, "processor thread terminated");
154 m_exitCondition
.Signal();
158 bool CCECParser::Ping(void)
163 AddLog(CEC_LOG_DEBUG
, "sending ping");
165 output
.push_back(MSGSTART
);
166 PushEscaped(output
, MSGCODE_PING
);
167 output
.push_back(MSGEND
);
169 if (!TransmitFormatted(output
, false))
171 AddLog(CEC_LOG_ERROR
, "could not send ping command");
175 AddLog(CEC_LOG_DEBUG
, "ping tranmitted");
177 // TODO check for pong
181 bool CCECParser::StartBootloader(void)
186 AddLog(CEC_LOG_DEBUG
, "starting the bootloader");
188 output
.push_back(MSGSTART
);
189 PushEscaped(output
, MSGCODE_START_BOOTLOADER
);
190 output
.push_back(MSGEND
);
192 if (!TransmitFormatted(output
, false))
194 AddLog(CEC_LOG_ERROR
, "could not start the bootloader");
198 AddLog(CEC_LOG_DEBUG
, "bootloader start command transmitted");
202 uint8_t CCECParser::GetSourceDestination(cec_logical_address destination
/* = CECDEVICE_BROADCAST */)
204 return ((uint8_t)m_iLogicalAddress
<< 4) + (uint8_t)destination
;
207 bool CCECParser::PowerOffDevices(cec_logical_address address
/* = CECDEVICE_BROADCAST */)
209 return StandbyDevices(address
);
212 bool CCECParser::PowerOnDevices(cec_logical_address address
/* = CECDEVICE_TV */)
218 strLog
.Format("powering on devices with logical address %d", (int8_t)address
);
219 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
221 frame
.push_back(GetSourceDestination(address
));
222 frame
.push_back(CEC_OPCODE_TEXT_VIEW_ON
);
223 return Transmit(frame
);
226 bool CCECParser::StandbyDevices(cec_logical_address address
/* = CECDEVICE_BROADCAST */)
232 strLog
.Format("putting all devices with logical address %d in standby mode", (int8_t)address
);
233 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
235 frame
.push_back(GetSourceDestination(address
));
236 frame
.push_back(CEC_OPCODE_STANDBY
);
237 return Transmit(frame
);
240 bool CCECParser::SetActiveView(void)
245 AddLog(CEC_LOG_DEBUG
, "setting active view");
247 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
248 frame
.push_back(CEC_OPCODE_ACTIVE_SOURCE
);
249 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
250 frame
.push_back(m_physicaladdress
& 0xFF);
251 return Transmit(frame
);
254 bool CCECParser::SetInactiveView(void)
259 AddLog(CEC_LOG_DEBUG
, "setting inactive view");
261 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
262 frame
.push_back(CEC_OPCODE_INACTIVE_SOURCE
);
263 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
264 frame
.push_back(m_physicaladdress
& 0xFF);
265 return Transmit(frame
);
268 bool CCECParser::GetNextLogMessage(cec_log_message
*message
)
270 return m_logBuffer
.Pop(*message
);
273 bool CCECParser::GetNextKeypress(cec_keypress
*key
)
275 return m_bRunning
? m_keyBuffer
.Pop(*key
) : false;
278 bool CCECParser::GetNextCommand(cec_command
*command
)
280 return m_bRunning
? m_commandBuffer
.Pop(*command
) : false;
284 void CCECParser::TransmitAbort(cec_logical_address address
, cec_opcode opcode
, ECecAbortReason reason
/* = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE */)
286 AddLog(CEC_LOG_DEBUG
, "transmitting abort message");
288 frame
.push_back(GetSourceDestination(address
));
289 frame
.push_back(CEC_OPCODE_FEATURE_ABORT
);
290 frame
.push_back(opcode
);
291 frame
.push_back(reason
);
295 void CCECParser::ReportCECVersion(cec_logical_address address
/* = CECDEVICE_TV */)
298 AddLog(CEC_LOG_NOTICE
, "reporting CEC version as 1.3a");
299 frame
.push_back(GetSourceDestination(address
));
300 frame
.push_back(CEC_OPCODE_CEC_VERSION
);
301 frame
.push_back(CEC_VERSION_1_3A
);
305 void CCECParser::ReportPowerState(cec_logical_address address
/*= CECDEVICE_TV */, bool bOn
/* = true */)
309 AddLog(CEC_LOG_NOTICE
, "reporting \"On\" power status");
311 AddLog(CEC_LOG_NOTICE
, "reporting \"Off\" power status");
313 frame
.push_back(GetSourceDestination(address
));
314 frame
.push_back(CEC_OPCODE_REPORT_POWER_STATUS
);
315 frame
.push_back(bOn
? CEC_POWER_STATUS_ON
: CEC_POWER_STATUS_STANDBY
);
319 void CCECParser::ReportMenuState(cec_logical_address address
/* = CECDEVICE_TV */, bool bActive
/* = true */)
323 AddLog(CEC_LOG_NOTICE
, "reporting menu state as active");
325 AddLog(CEC_LOG_NOTICE
, "reporting menu state as inactive");
327 frame
.push_back(GetSourceDestination(address
));
328 frame
.push_back(CEC_OPCODE_MENU_STATUS
);
329 frame
.push_back(bActive
? CEC_MENU_STATE_ACTIVATED
: CEC_MENU_STATE_DEACTIVATED
);
333 void CCECParser::ReportVendorID(cec_logical_address address
/* = CECDEVICE_TV */)
335 AddLog(CEC_LOG_NOTICE
, "vendor ID requested, feature abort");
336 TransmitAbort(address
, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
);
339 void CCECParser::ReportOSDName(cec_logical_address address
/* = CECDEVICE_TV */)
342 const char *osdname
= m_strDeviceName
.c_str();
344 strLog
.Format("reporting OSD name as %s", osdname
);
345 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
346 frame
.push_back(GetSourceDestination(address
));
347 frame
.push_back(CEC_OPCODE_SET_OSD_NAME
);
349 for (unsigned int i
= 0; i
< strlen(osdname
); i
++)
350 frame
.push_back(osdname
[i
]);
355 void CCECParser::ReportPhysicalAddress(void)
359 strLog
.Format("reporting physical address as %04x", m_physicaladdress
);
360 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
361 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
362 frame
.push_back(CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
);
363 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
364 frame
.push_back(m_physicaladdress
& 0xFF);
365 frame
.push_back(CEC_DEVICE_TYPE_PLAYBACK_DEVICE
);
369 void CCECParser::BroadcastActiveSource(void)
372 AddLog(CEC_LOG_NOTICE
, "broadcasting active source");
373 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
374 frame
.push_back(CEC_OPCODE_ACTIVE_SOURCE
);
375 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
376 frame
.push_back(m_physicaladdress
& 0xFF);
380 bool CCECParser::TransmitFormatted(const cec_frame
&data
, bool bWaitForAck
/* = true */)
382 if (!m_communication
|| !m_communication
->Write(data
))
385 CCondition::Sleep((int) data
.size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 50 /* to be on the safe side */);
386 if (bWaitForAck
&& !WaitForAck())
388 AddLog(CEC_LOG_DEBUG
, "did not receive ACK");
395 bool CCECParser::Transmit(const cec_frame
&data
, bool bWaitForAck
/* = true */)
397 CStdString txStr
= "transmit ";
398 for (unsigned int i
= 0; i
< data
.size(); i
++)
399 txStr
.AppendFormat(" %02x", data
[i
]);
400 AddLog(CEC_LOG_DEBUG
, txStr
.c_str());
404 AddLog(CEC_LOG_WARNING
, "transmit buffer is empty");
410 //set ack polarity to high when transmitting to the broadcast address
411 //set ack polarity low when transmitting to any other address
412 output
.push_back(MSGSTART
);
413 PushEscaped(output
, MSGCODE_TRANSMIT_ACK_POLARITY
);
415 if ((data
[0] & 0xF) == 0xF)
416 PushEscaped(output
, CEC_TRUE
);
418 PushEscaped(output
, CEC_FALSE
);
420 output
.push_back(MSGEND
);
422 for (unsigned int i
= 0; i
< data
.size(); i
++)
424 output
.push_back(MSGSTART
);
426 if (i
== data
.size() - 1)
427 PushEscaped(output
, MSGCODE_TRANSMIT_EOM
);
429 PushEscaped(output
, MSGCODE_TRANSMIT
);
431 PushEscaped(output
, data
[i
]);
433 output
.push_back(MSGEND
);
436 return TransmitFormatted(output
, bWaitForAck
);
439 bool CCECParser::WaitForAck(int iTimeout
/* = 1000 */)
444 int64_t iNow
= GetTimeMs();
445 int64_t iTargetTime
= iNow
+ (int64_t) iTimeout
;
447 while (!bGotAck
&& !bError
&& (iTimeout
<= 0 || iNow
< iTargetTime
))
450 while (!bGotAck
&& !bError
&& m_communication
->Read(msg
, iTimeout
))
452 uint8_t iCode
= msg
[0] & ~(MSGCODE_FRAME_EOM
| MSGCODE_FRAME_ACK
);
456 case MSGCODE_COMMAND_ACCEPTED
:
457 AddLog(CEC_LOG_DEBUG
, "MSGCODE_COMMAND_ACCEPTED");
459 case MSGCODE_TRANSMIT_SUCCEEDED
:
460 AddLog(CEC_LOG_DEBUG
, "MSGCODE_TRANSMIT_SUCCEEDED");
464 case MSGCODE_RECEIVE_FAILED
:
465 AddLog(CEC_LOG_WARNING
, "MSGCODE_RECEIVE_FAILED");
468 case MSGCODE_COMMAND_REJECTED
:
469 AddLog(CEC_LOG_WARNING
, "MSGCODE_COMMAND_REJECTED");
472 case MSGCODE_TRANSMIT_FAILED_LINE
:
473 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_LINE");
476 case MSGCODE_TRANSMIT_FAILED_ACK
:
477 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_ACK");
480 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA
:
481 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA");
484 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE
:
485 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE");
489 m_frameBuffer
.Push(msg
);
490 bGotAck
= (msg
[0] & MSGCODE_FRAME_ACK
) != 0;
497 return bGotAck
&& !bError
;
500 void CCECParser::ParseMessage(cec_frame
&msg
)
506 uint8_t iCode
= msg
[0] & ~(MSGCODE_FRAME_EOM
| MSGCODE_FRAME_ACK
);
507 bool bEom
= (msg
[0] & MSGCODE_FRAME_EOM
) != 0;
508 bool bAck
= (msg
[0] & MSGCODE_FRAME_ACK
) != 0;
512 case MSGCODE_NOTHING
:
513 AddLog(CEC_LOG_DEBUG
, "MSGCODE_NOTHING");
515 case MSGCODE_TIMEOUT_ERROR
:
516 case MSGCODE_HIGH_ERROR
:
517 case MSGCODE_LOW_ERROR
:
519 if (iCode
== MSGCODE_TIMEOUT_ERROR
)
520 logStr
= "MSGCODE_TIMEOUT";
521 else if (iCode
== MSGCODE_HIGH_ERROR
)
522 logStr
= "MSGCODE_HIGH_ERROR";
524 logStr
= "MSGCODE_LOW_ERROR";
526 int iLine
= (msg
.size() >= 3) ? (msg
[1] << 8) | (msg
[2]) : 0;
527 uint32_t iTime
= (msg
.size() >= 7) ? (msg
[3] << 24) | (msg
[4] << 16) | (msg
[5] << 8) | (msg
[6]) : 0;
528 logStr
.AppendFormat(" line:%i", iLine
);
529 logStr
.AppendFormat(" time:%u", iTime
);
530 AddLog(CEC_LOG_WARNING
, logStr
.c_str());
533 case MSGCODE_FRAME_START
:
535 logStr
= "MSGCODE_FRAME_START";
536 m_currentframe
.clear();
539 int iInitiator
= msg
[1] >> 4;
540 int iDestination
= msg
[1] & 0xF;
541 logStr
.AppendFormat(" initiator:%u destination:%u ack:%s %s", iInitiator
, iDestination
, bAck
? "high" : "low", bEom
? "eom" : "");
543 m_currentframe
.push_back(msg
[1]);
545 AddLog(CEC_LOG_DEBUG
, logStr
.c_str());
548 case MSGCODE_FRAME_DATA
:
550 logStr
= "MSGCODE_FRAME_DATA";
553 uint8_t iData
= msg
[1];
554 logStr
.AppendFormat(" %02x", iData
);
555 m_currentframe
.push_back(iData
);
557 AddLog(CEC_LOG_DEBUG
, logStr
.c_str());
567 void CCECParser::ParseCurrentFrame(void)
569 uint8_t initiator
= m_currentframe
[0] >> 4;
570 uint8_t destination
= m_currentframe
[0] & 0xF;
573 dataStr
.Format("received frame: initiator: %u destination: %u", initiator
, destination
);
575 if (m_currentframe
.size() > 1)
578 for (unsigned int i
= 1; i
< m_currentframe
.size(); i
++)
579 dataStr
.AppendFormat(" %02x", m_currentframe
[i
]);
581 AddLog(CEC_LOG_DEBUG
, dataStr
.c_str());
583 if (m_currentframe
.size() <= 1)
587 cec_opcode opCode
= (cec_opcode
) m_currentframe
[1];
588 if (destination
== (uint16_t) m_iLogicalAddress
)
592 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
593 ReportPhysicalAddress();
596 case CEC_OPCODE_GIVE_OSD_NAME
:
597 ReportOSDName((cec_logical_address
)initiator
);
599 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
600 ReportVendorID((cec_logical_address
)initiator
);
602 case CEC_OPCODE_MENU_REQUEST
:
603 ReportMenuState((cec_logical_address
)initiator
);
605 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
606 ReportPowerState((cec_logical_address
)initiator
);
608 case CEC_OPCODE_GET_CEC_VERSION
:
609 ReportCECVersion((cec_logical_address
)initiator
);
611 case CEC_OPCODE_USER_CONTROL_PRESSED
:
612 if (m_currentframe
.size() > 2)
616 if (m_currentframe
[2] <= CEC_USER_CONTROL_CODE_MAX
)
618 m_iCurrentButton
= (cec_user_control_code
) m_currentframe
[2];
619 m_buttontime
= GetTimeMs();
623 case CEC_OPCODE_USER_CONTROL_RELEASE
:
627 cec_frame params
= m_currentframe
;
628 params
.erase(params
.begin(), params
.begin() + 2);
629 AddCommand((cec_logical_address
) initiator
, (cec_logical_address
) destination
, opCode
, ¶ms
);
633 else if (destination
== (uint8_t) CECDEVICE_BROADCAST
)
635 if (opCode
== CEC_OPCODE_REQUEST_ACTIVE_SOURCE
)
637 BroadcastActiveSource();
639 else if (opCode
== CEC_OPCODE_SET_STREAM_PATH
)
641 if (m_currentframe
.size() >= 4)
643 int streamaddr
= ((int)m_currentframe
[2] << 8) | ((int)m_currentframe
[3]);
645 strLog
.Format("%i requests stream path from physical address %04x", initiator
, streamaddr
);
646 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
647 if (streamaddr
== m_physicaladdress
)
648 BroadcastActiveSource();
653 cec_frame params
= m_currentframe
;
654 params
.erase(params
.begin(), params
.begin() + 2);
655 AddCommand((cec_logical_address
) initiator
, (cec_logical_address
) destination
, opCode
, ¶ms
);
661 strLog
.Format("ignoring frame: destination: %u != %u", destination
, (uint16_t)m_iLogicalAddress
);
662 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
666 void CCECParser::PushEscaped(cec_frame
&vec
, uint8_t byte
)
668 if (byte
>= MSGESC
&& byte
!= MSGSTART
)
670 vec
.push_back(MSGESC
);
671 vec
.push_back(byte
- ESCOFFSET
);
679 void CCECParser::CheckKeypressTimeout(int64_t now
)
681 if (m_iCurrentButton
!= CEC_USER_CONTROL_CODE_UNKNOWN
&& now
- m_buttontime
> CEC_BUTTON_TIMEOUT
)
684 m_iCurrentButton
= CEC_USER_CONTROL_CODE_UNKNOWN
;
688 bool CCECParser::SetLogicalAddress(cec_logical_address iLogicalAddress
)
691 strLog
.Format("setting logical address to %d", iLogicalAddress
);
692 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
694 m_iLogicalAddress
= iLogicalAddress
;
695 return SetAckMask(0x1 << (uint8_t)m_iLogicalAddress
);
698 bool CCECParser::SetAckMask(uint16_t iMask
)
701 strLog
.Format("setting ackmask to %2x", iMask
);
702 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
706 output
.push_back(MSGSTART
);
707 PushEscaped(output
, MSGCODE_SET_ACK_MASK
);
708 PushEscaped(output
, iMask
>> 8);
709 PushEscaped(output
, (uint8_t)iMask
);
710 output
.push_back(MSGEND
);
712 if (!m_communication
->Write(output
))
714 AddLog(CEC_LOG_ERROR
, "could not set the ackmask");
721 void CCECParser::AddLog(cec_log_level level
, const string
&strMessage
)
723 cec_log_message message
;
724 message
.level
= level
;
725 message
.message
.assign(strMessage
.c_str());
726 m_logBuffer
.Push(message
);
729 void CCECParser::AddKey(void)
731 if (m_iCurrentButton
!= CEC_USER_CONTROL_CODE_UNKNOWN
)
734 key
.duration
= (unsigned int) (GetTimeMs() - m_buttontime
);
735 key
.keycode
= m_iCurrentButton
;
736 m_keyBuffer
.Push(key
);
737 m_iCurrentButton
= CEC_USER_CONTROL_CODE_UNKNOWN
;
742 void CCECParser::AddCommand(cec_logical_address source
, cec_logical_address destination
, cec_opcode opcode
, cec_frame
*parameters
)
745 command
.source
= source
;
746 command
.destination
= destination
;
747 command
.opcode
= opcode
;
749 command
.parameters
= *parameters
;
750 if (m_commandBuffer
.Push(command
))
753 strDebug
.Format("stored command '%d' in the command buffer. buffer size = %d", opcode
, m_commandBuffer
.Size());
754 AddLog(CEC_LOG_DEBUG
, strDebug
);
758 AddLog(CEC_LOG_WARNING
, "command buffer is full");
762 int CCECParser::GetMinVersion(void)
764 return CEC_MIN_VERSION
;
767 int CCECParser::GetLibVersion(void)
769 return CEC_LIB_VERSION
;
772 int CCECParser::FindDevices(std::vector
<cec_device
> &deviceList
, const char *strDevicePath
/* = NULL */)
776 strDebug
.Format("trying to autodetect the com port for device path '%s'", strDevicePath
);
778 strDebug
.Format("trying to autodetect all CEC adapters");
779 AddLog(CEC_LOG_DEBUG
, strDebug
);
781 return CCECDetect::FindDevices(deviceList
, strDevicePath
);
784 DECLSPEC
void * CECCreate(const char *strDeviceName
, CEC::cec_logical_address iLogicalAddress
/*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, int iPhysicalAddress
/* = CEC_DEFAULT_PHYSICAL_ADDRESS */)
786 return static_cast< void* > (new CCECParser(strDeviceName
, iLogicalAddress
, iPhysicalAddress
));