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
53 * ICECDevice implementation
56 CCECParser::CCECParser(const char *strDeviceName
, cec_logical_address iLogicalAddress
/* = CECDEVICE_PLAYBACKDEVICE1 */, int iPhysicalAddress
/* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) :
57 m_iCurrentButton(CEC_USER_CONTROL_CODE_UNKNOWN
),
58 m_physicaladdress(iPhysicalAddress
),
59 m_iLogicalAddress(iLogicalAddress
),
60 m_strDeviceName(strDeviceName
),
63 m_communication
= new CCommunication(this);
66 CCECParser::~CCECParser(void)
69 m_communication
->Close();
70 delete m_communication
;
73 bool CCECParser::Open(const char *strPort
, int iTimeoutMs
/* = 10000 */)
78 if (m_communication
->IsOpen())
80 AddLog(CEC_LOG_ERROR
, "connection already open");
84 if (!m_communication
->Open(strPort
, 38400, iTimeoutMs
))
86 AddLog(CEC_LOG_ERROR
, "could not open a connection");
90 if (!SetLogicalAddress(m_iLogicalAddress
))
92 AddLog(CEC_LOG_ERROR
, "could not set the logical address");
96 if (pthread_create(&m_thread
, NULL
, (void *(*) (void *))&CCECParser::ThreadHandler
, (void *)this) == 0)
99 AddLog(CEC_LOG_DEBUG
, "processor thread created");
100 pthread_detach(m_thread
);
105 AddLog(CEC_LOG_ERROR
, "could not create a processor thread");
112 bool CCECParser::Close(int iTimeoutMs
/* = 2000 */)
118 bExit
= m_exitCondition
.Wait(&m_mutex
, iTimeoutMs
);
123 pthread_join(m_thread
, NULL
);
130 void *CCECParser::ThreadHandler(CCECParser
*parser
)
137 bool CCECParser::Process(void)
139 int64_t now
= GetTimeMs();
143 while (m_bRunning
&& m_communication
->IsOpen() && m_communication
->Read(msg
, 500))
147 CheckKeypressTimeout(now
);
148 CCondition::Sleep(50);
151 AddLog(CEC_LOG_DEBUG
, "processor thread terminated");
153 m_exitCondition
.Signal();
157 bool CCECParser::Ping(void)
162 AddLog(CEC_LOG_DEBUG
, "sending ping");
164 output
.push_back(MSGSTART
);
165 PushEscaped(output
, MSGCODE_PING
);
166 output
.push_back(MSGEND
);
168 if (!TransmitFormatted(output
, false, (int64_t) 5000))
170 AddLog(CEC_LOG_ERROR
, "could not send ping command");
174 AddLog(CEC_LOG_DEBUG
, "ping tranmitted");
176 // TODO check for pong
180 bool CCECParser::StartBootloader(void)
185 AddLog(CEC_LOG_DEBUG
, "starting the bootloader");
187 output
.push_back(MSGSTART
);
188 PushEscaped(output
, MSGCODE_START_BOOTLOADER
);
189 output
.push_back(MSGEND
);
191 if (!TransmitFormatted(output
, false, (int64_t) 5000))
193 AddLog(CEC_LOG_ERROR
, "could not start the bootloader");
197 AddLog(CEC_LOG_DEBUG
, "bootloader start command transmitted");
201 uint8_t CCECParser::GetSourceDestination(cec_logical_address destination
/* = CECDEVICE_BROADCAST */)
203 return ((uint8_t)m_iLogicalAddress
<< 4) + (uint8_t)destination
;
206 bool CCECParser::PowerOffDevices(cec_logical_address address
/* = CECDEVICE_BROADCAST */)
208 return StandbyDevices(address
);
211 bool CCECParser::PowerOnDevices(cec_logical_address address
/* = CECDEVICE_TV */)
217 strLog
.Format("powering on devices with logical address %d", (int8_t)address
);
218 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
220 frame
.push_back(GetSourceDestination(address
));
221 frame
.push_back(CEC_OPCODE_TEXT_VIEW_ON
);
222 return Transmit(frame
);
225 bool CCECParser::StandbyDevices(cec_logical_address address
/* = CECDEVICE_BROADCAST */)
231 strLog
.Format("putting all devices with logical address %d in standby mode", (int8_t)address
);
232 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
234 frame
.push_back(GetSourceDestination(address
));
235 frame
.push_back(CEC_OPCODE_STANDBY
);
236 return Transmit(frame
);
239 bool CCECParser::SetActiveView(void)
244 AddLog(CEC_LOG_DEBUG
, "setting active view");
246 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
247 frame
.push_back(CEC_OPCODE_ACTIVE_SOURCE
);
248 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
249 frame
.push_back(m_physicaladdress
& 0xFF);
250 return Transmit(frame
);
253 bool CCECParser::SetInactiveView(void)
258 AddLog(CEC_LOG_DEBUG
, "setting inactive view");
260 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
261 frame
.push_back(CEC_OPCODE_INACTIVE_SOURCE
);
262 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
263 frame
.push_back(m_physicaladdress
& 0xFF);
264 return Transmit(frame
);
267 bool CCECParser::GetNextLogMessage(cec_log_message
*message
)
269 return m_logBuffer
.Pop(*message
);
272 bool CCECParser::GetNextKeypress(cec_keypress
*key
)
274 return m_bRunning
? m_keyBuffer
.Pop(*key
) : false;
277 bool CCECParser::GetNextCommand(cec_command
*command
)
279 return m_bRunning
? m_commandBuffer
.Pop(*command
) : false;
283 void CCECParser::TransmitAbort(cec_logical_address address
, cec_opcode opcode
, ECecAbortReason reason
/* = CEC_ABORT_REASON_UNRECOGNIZED_OPCODE */)
285 AddLog(CEC_LOG_DEBUG
, "transmitting abort message");
287 frame
.push_back(GetSourceDestination(address
));
288 frame
.push_back(CEC_OPCODE_FEATURE_ABORT
);
289 frame
.push_back(opcode
);
290 frame
.push_back(reason
);
294 void CCECParser::ReportCECVersion(cec_logical_address address
/* = CECDEVICE_TV */)
297 AddLog(CEC_LOG_NOTICE
, "reporting CEC version as 1.3a");
298 frame
.push_back(GetSourceDestination(address
));
299 frame
.push_back(CEC_OPCODE_CEC_VERSION
);
300 frame
.push_back(CEC_VERSION_1_3A
);
304 void CCECParser::ReportPowerState(cec_logical_address address
/*= CECDEVICE_TV */, bool bOn
/* = true */)
308 AddLog(CEC_LOG_NOTICE
, "reporting \"On\" power status");
310 AddLog(CEC_LOG_NOTICE
, "reporting \"Off\" power status");
312 frame
.push_back(GetSourceDestination(address
));
313 frame
.push_back(CEC_OPCODE_REPORT_POWER_STATUS
);
314 frame
.push_back(bOn
? CEC_POWER_STATUS_ON
: CEC_POWER_STATUS_STANDBY
);
318 void CCECParser::ReportMenuState(cec_logical_address address
/* = CECDEVICE_TV */, bool bActive
/* = true */)
322 AddLog(CEC_LOG_NOTICE
, "reporting menu state as active");
324 AddLog(CEC_LOG_NOTICE
, "reporting menu state as inactive");
326 frame
.push_back(GetSourceDestination(address
));
327 frame
.push_back(CEC_OPCODE_MENU_STATUS
);
328 frame
.push_back(bActive
? CEC_MENU_STATE_ACTIVATED
: CEC_MENU_STATE_DEACTIVATED
);
332 void CCECParser::ReportVendorID(cec_logical_address address
/* = CECDEVICE_TV */)
334 AddLog(CEC_LOG_NOTICE
, "vendor ID requested, feature abort");
335 TransmitAbort(address
, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
);
338 void CCECParser::ReportOSDName(cec_logical_address address
/* = CECDEVICE_TV */)
341 const char *osdname
= m_strDeviceName
.c_str();
343 strLog
.Format("reporting OSD name as %s", osdname
);
344 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
345 frame
.push_back(GetSourceDestination(address
));
346 frame
.push_back(CEC_OPCODE_SET_OSD_NAME
);
348 for (unsigned int i
= 0; i
< strlen(osdname
); i
++)
349 frame
.push_back(osdname
[i
]);
354 void CCECParser::ReportPhysicalAddress(void)
358 strLog
.Format("reporting physical address as %04x", m_physicaladdress
);
359 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
360 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
361 frame
.push_back(CEC_OPCODE_REPORT_PHYSICAL_ADDRESS
);
362 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
363 frame
.push_back(m_physicaladdress
& 0xFF);
364 frame
.push_back(CEC_DEVICE_TYPE_PLAYBACK_DEVICE
);
368 void CCECParser::BroadcastActiveSource(void)
371 AddLog(CEC_LOG_NOTICE
, "broadcasting active source");
372 frame
.push_back(GetSourceDestination(CECDEVICE_BROADCAST
));
373 frame
.push_back(CEC_OPCODE_ACTIVE_SOURCE
);
374 frame
.push_back((m_physicaladdress
>> 8) & 0xFF);
375 frame
.push_back(m_physicaladdress
& 0xFF);
379 bool CCECParser::TransmitFormatted(const cec_frame
&data
, bool bWaitForAck
/* = true */, int64_t iTimeout
/* = 2000 */)
381 if (!m_communication
|| m_communication
->Write(data
) != data
.size())
384 CCondition::Sleep((int) data
.size() * 24 /*data*/ + 5 /*start bit (4.5 ms)*/ + 50 /* to be on the safe side */);
385 if (bWaitForAck
&& !WaitForAck())
387 AddLog(CEC_LOG_DEBUG
, "did not receive ACK");
394 bool CCECParser::Transmit(const cec_frame
&data
, bool bWaitForAck
/* = true */, int64_t iTimeout
/* = 5000 */)
396 CStdString txStr
= "transmit ";
397 for (unsigned int i
= 0; i
< data
.size(); i
++)
398 txStr
.AppendFormat(" %02x", data
[i
]);
399 AddLog(CEC_LOG_DEBUG
, txStr
.c_str());
403 AddLog(CEC_LOG_WARNING
, "transmit buffer is empty");
409 //set ack polarity to high when transmitting to the broadcast address
410 //set ack polarity low when transmitting to any other address
411 output
.push_back(MSGSTART
);
412 PushEscaped(output
, MSGCODE_TRANSMIT_ACK_POLARITY
);
414 if ((data
[0] & 0xF) == 0xF)
415 PushEscaped(output
, CEC_TRUE
);
417 PushEscaped(output
, CEC_FALSE
);
419 output
.push_back(MSGEND
);
421 for (unsigned int i
= 0; i
< data
.size(); i
++)
423 output
.push_back(MSGSTART
);
425 if (i
== data
.size() - 1)
426 PushEscaped(output
, MSGCODE_TRANSMIT_EOM
);
428 PushEscaped(output
, MSGCODE_TRANSMIT
);
430 PushEscaped(output
, data
[i
]);
432 output
.push_back(MSGEND
);
435 return TransmitFormatted(output
, bWaitForAck
, iTimeout
);
438 bool CCECParser::WaitForAck(int64_t iTimeout
/* = 1000 */)
443 int64_t iNow
= GetTimeMs();
444 int64_t iTargetTime
= iNow
+ iTimeout
;
446 while (!bGotAck
&& !bError
&& (iTimeout
<= 0 || iNow
< iTargetTime
))
449 while (!bGotAck
&& !bError
&& m_communication
->Read(msg
, iTimeout
))
451 uint8_t iCode
= msg
[0] & ~(MSGCODE_FRAME_EOM
| MSGCODE_FRAME_ACK
);
455 case MSGCODE_COMMAND_ACCEPTED
:
456 AddLog(CEC_LOG_DEBUG
, "MSGCODE_COMMAND_ACCEPTED");
458 case MSGCODE_TRANSMIT_SUCCEEDED
:
459 AddLog(CEC_LOG_DEBUG
, "MSGCODE_TRANSMIT_SUCCEEDED");
463 case MSGCODE_RECEIVE_FAILED
:
464 AddLog(CEC_LOG_WARNING
, "MSGCODE_RECEIVE_FAILED");
467 case MSGCODE_COMMAND_REJECTED
:
468 AddLog(CEC_LOG_WARNING
, "MSGCODE_COMMAND_REJECTED");
471 case MSGCODE_TRANSMIT_FAILED_LINE
:
472 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_LINE");
475 case MSGCODE_TRANSMIT_FAILED_ACK
:
476 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_ACK");
479 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA
:
480 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA");
483 case MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE
:
484 AddLog(CEC_LOG_WARNING
, "MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE");
488 m_frameBuffer
.Push(msg
);
489 bGotAck
= (msg
[0] & MSGCODE_FRAME_ACK
) != 0;
496 return bGotAck
&& !bError
;
499 void CCECParser::ParseMessage(cec_frame
&msg
)
505 uint8_t iCode
= msg
[0] & ~(MSGCODE_FRAME_EOM
| MSGCODE_FRAME_ACK
);
506 bool bEom
= (msg
[0] & MSGCODE_FRAME_EOM
) != 0;
507 bool bAck
= (msg
[0] & MSGCODE_FRAME_ACK
) != 0;
511 case MSGCODE_NOTHING
:
512 AddLog(CEC_LOG_DEBUG
, "MSGCODE_NOTHING");
514 case MSGCODE_TIMEOUT_ERROR
:
515 case MSGCODE_HIGH_ERROR
:
516 case MSGCODE_LOW_ERROR
:
518 if (iCode
== MSGCODE_TIMEOUT_ERROR
)
519 logStr
= "MSGCODE_TIMEOUT";
520 else if (iCode
== MSGCODE_HIGH_ERROR
)
521 logStr
= "MSGCODE_HIGH_ERROR";
523 logStr
= "MSGCODE_LOW_ERROR";
525 int iLine
= (msg
.size() >= 3) ? (msg
[1] << 8) | (msg
[2]) : 0;
526 uint32_t iTime
= (msg
.size() >= 7) ? (msg
[3] << 24) | (msg
[4] << 16) | (msg
[5] << 8) | (msg
[6]) : 0;
527 logStr
.AppendFormat(" line:%i", iLine
);
528 logStr
.AppendFormat(" time:%u", iTime
);
529 AddLog(CEC_LOG_WARNING
, logStr
.c_str());
532 case MSGCODE_FRAME_START
:
534 logStr
= "MSGCODE_FRAME_START";
535 m_currentframe
.clear();
538 int iInitiator
= msg
[1] >> 4;
539 int iDestination
= msg
[1] & 0xF;
540 logStr
.AppendFormat(" initiator:%u destination:%u ack:%s %s", iInitiator
, iDestination
, bAck
? "high" : "low", bEom
? "eom" : "");
542 m_currentframe
.push_back(msg
[1]);
544 AddLog(CEC_LOG_DEBUG
, logStr
.c_str());
547 case MSGCODE_FRAME_DATA
:
549 logStr
= "MSGCODE_FRAME_DATA";
552 uint8_t iData
= msg
[1];
553 logStr
.AppendFormat(" %02x", iData
);
554 m_currentframe
.push_back(iData
);
556 AddLog(CEC_LOG_DEBUG
, logStr
.c_str());
566 void CCECParser::ParseCurrentFrame(void)
568 uint8_t initiator
= m_currentframe
[0] >> 4;
569 uint8_t destination
= m_currentframe
[0] & 0xF;
572 dataStr
.Format("received frame: initiator: %u destination: %u", initiator
, destination
);
574 if (m_currentframe
.size() > 1)
577 for (unsigned int i
= 1; i
< m_currentframe
.size(); i
++)
578 dataStr
.AppendFormat(" %02x", m_currentframe
[i
]);
580 AddLog(CEC_LOG_DEBUG
, dataStr
.c_str());
582 if (m_currentframe
.size() <= 1)
586 cec_opcode opCode
= (cec_opcode
) m_currentframe
[1];
587 if (destination
== (uint16_t) m_iLogicalAddress
)
591 case CEC_OPCODE_GIVE_PHYSICAL_ADDRESS
:
592 ReportPhysicalAddress();
595 case CEC_OPCODE_GIVE_OSD_NAME
:
596 ReportOSDName((cec_logical_address
)initiator
);
598 case CEC_OPCODE_GIVE_DEVICE_VENDOR_ID
:
599 ReportVendorID((cec_logical_address
)initiator
);
601 case CEC_OPCODE_MENU_REQUEST
:
602 ReportMenuState((cec_logical_address
)initiator
);
604 case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS
:
605 ReportPowerState((cec_logical_address
)initiator
);
607 case CEC_OPCODE_GET_CEC_VERSION
:
608 ReportCECVersion((cec_logical_address
)initiator
);
610 case CEC_OPCODE_USER_CONTROL_PRESSED
:
611 if (m_currentframe
.size() > 2)
615 if (m_currentframe
[2] <= CEC_USER_CONTROL_CODE_MAX
)
617 m_iCurrentButton
= (cec_user_control_code
) m_currentframe
[2];
618 m_buttontime
= GetTimeMs();
622 case CEC_OPCODE_USER_CONTROL_RELEASE
:
626 cec_frame params
= m_currentframe
;
627 params
.erase(params
.begin(), params
.begin() + 2);
628 AddCommand((cec_logical_address
) initiator
, (cec_logical_address
) destination
, opCode
, ¶ms
);
632 else if (destination
== (uint8_t) CECDEVICE_BROADCAST
)
634 if (opCode
== CEC_OPCODE_REQUEST_ACTIVE_SOURCE
)
636 BroadcastActiveSource();
638 else if (opCode
== CEC_OPCODE_SET_STREAM_PATH
)
640 if (m_currentframe
.size() >= 4)
642 int streamaddr
= ((int)m_currentframe
[2] << 8) | ((int)m_currentframe
[3]);
644 strLog
.Format("%i requests stream path from physical address %04x", initiator
, streamaddr
);
645 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
646 if (streamaddr
== m_physicaladdress
)
647 BroadcastActiveSource();
652 cec_frame params
= m_currentframe
;
653 params
.erase(params
.begin(), params
.begin() + 2);
654 AddCommand((cec_logical_address
) initiator
, (cec_logical_address
) destination
, opCode
, ¶ms
);
660 strLog
.Format("ignoring frame: destination: %u != %u", destination
, (uint16_t)m_iLogicalAddress
);
661 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
665 void CCECParser::PushEscaped(cec_frame
&vec
, uint8_t byte
)
667 if (byte
>= MSGESC
&& byte
!= MSGSTART
)
669 vec
.push_back(MSGESC
);
670 vec
.push_back(byte
- ESCOFFSET
);
678 void CCECParser::CheckKeypressTimeout(int64_t now
)
680 if (m_iCurrentButton
!= CEC_USER_CONTROL_CODE_UNKNOWN
&& now
- m_buttontime
> 500)
683 m_iCurrentButton
= CEC_USER_CONTROL_CODE_UNKNOWN
;
687 bool CCECParser::SetLogicalAddress(cec_logical_address iLogicalAddress
)
690 strLog
.Format("setting logical address to %d", iLogicalAddress
);
691 AddLog(CEC_LOG_NOTICE
, strLog
.c_str());
693 m_iLogicalAddress
= iLogicalAddress
;
694 return SetAckMask(0x1 << (uint8_t)m_iLogicalAddress
);
697 bool CCECParser::SetAckMask(uint16_t iMask
)
700 strLog
.Format("setting ackmask to %2x", iMask
);
701 AddLog(CEC_LOG_DEBUG
, strLog
.c_str());
705 output
.push_back(MSGSTART
);
706 PushEscaped(output
, MSGCODE_SET_ACK_MASK
);
707 PushEscaped(output
, iMask
>> 8);
708 PushEscaped(output
, (uint8_t)iMask
);
709 output
.push_back(MSGEND
);
711 if (m_communication
->Write(output
) == -1)
713 AddLog(CEC_LOG_ERROR
, "could not set the ackmask");
720 void CCECParser::AddLog(cec_log_level level
, const string
&strMessage
)
722 cec_log_message message
;
723 message
.level
= level
;
724 message
.message
.assign(strMessage
.c_str());
725 m_logBuffer
.Push(message
);
728 void CCECParser::AddKey(void)
730 if (m_iCurrentButton
!= CEC_USER_CONTROL_CODE_UNKNOWN
)
733 key
.duration
= (unsigned int) (GetTimeMs() - m_buttontime
);
734 key
.keycode
= m_iCurrentButton
;
735 m_keyBuffer
.Push(key
);
736 m_iCurrentButton
= CEC_USER_CONTROL_CODE_UNKNOWN
;
741 void CCECParser::AddCommand(cec_logical_address source
, cec_logical_address destination
, cec_opcode opcode
, cec_frame
*parameters
)
744 command
.source
= source
;
745 command
.destination
= destination
;
746 command
.opcode
= opcode
;
748 command
.parameters
= *parameters
;
749 if (m_commandBuffer
.Push(command
))
752 strDebug
.Format("stored command '%d' in the command buffer. buffer size = %d", opcode
, m_commandBuffer
.Size());
753 AddLog(CEC_LOG_DEBUG
, strDebug
);
757 AddLog(CEC_LOG_WARNING
, "command buffer is full");
761 int CCECParser::GetMinVersion(void)
763 return CEC_MIN_VERSION
;
766 int CCECParser::GetLibVersion(void)
768 return CEC_LIB_VERSION
;
771 int CCECParser::FindDevices(std::vector
<cec_device
> &deviceList
, const char *strDevicePath
/* = NULL */)
775 strDebug
.Format("trying to autodetect the com port for device path '%s'", strDevicePath
);
777 strDebug
.Format("trying to autodetect all CEC adapters");
778 AddLog(CEC_LOG_DEBUG
, strDebug
);
780 return CCECDetect::FindDevices(deviceList
, strDevicePath
);
783 DECLSPEC
void * CECCreate(const char *strDeviceName
, CEC::cec_logical_address iLogicalAddress
/*= CEC::CECDEVICE_PLAYBACKDEVICE1 */, int iPhysicalAddress
/* = CEC_DEFAULT_PHYSICAL_ADDRESS */)
785 return static_cast< void* > (new CCECParser(strDeviceName
, iLogicalAddress
, iPhysicalAddress
));