-CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, cec_logical_address iLogicalAddress /* = CECDEVICE_PLAYBACKDEVICE1 */, uint16_t iPhysicalAddress /* = CEC_DEFAULT_PHYSICAL_ADDRESS*/) :
- m_bStarted(false),
- m_strDeviceName(strDeviceName),
- m_communication(serComm),
- m_controller(controller),
- m_bMonitor(false)
-{
- m_logicalAddresses.clear();
- m_logicalAddresses.set(iLogicalAddress);
- m_types.clear();
- for (int iPtr = 0; iPtr < 16; iPtr++)
- m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
-}
-
-CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm, const char *strDeviceName, const cec_device_type_list &types) :
- m_bStarted(false),
- m_strDeviceName(strDeviceName),
- m_types(types),
- m_communication(serComm),
- m_controller(controller),
- m_bMonitor(false)
-{
- m_logicalAddresses.clear();
- for (int iPtr = 0; iPtr < 16; iPtr++)
- {
- switch(iPtr)
- {
- case CECDEVICE_AUDIOSYSTEM:
- m_busDevices[iPtr] = new CCECAudioSystem(this, (cec_logical_address) iPtr, 0xFFFF);
- break;
- case CECDEVICE_PLAYBACKDEVICE1:
- case CECDEVICE_PLAYBACKDEVICE2:
- case CECDEVICE_PLAYBACKDEVICE3:
- m_busDevices[iPtr] = new CCECPlaybackDevice(this, (cec_logical_address) iPtr, 0xFFFF);
- break;
- case CECDEVICE_RECORDINGDEVICE1:
- case CECDEVICE_RECORDINGDEVICE2:
- case CECDEVICE_RECORDINGDEVICE3:
- m_busDevices[iPtr] = new CCECRecordingDevice(this, (cec_logical_address) iPtr, 0xFFFF);
- break;
- case CECDEVICE_TUNER1:
- case CECDEVICE_TUNER2:
- case CECDEVICE_TUNER3:
- case CECDEVICE_TUNER4:
- m_busDevices[iPtr] = new CCECTuner(this, (cec_logical_address) iPtr, 0xFFFF);
- break;
- case CECDEVICE_TV:
- m_busDevices[iPtr] = new CCECTV(this, (cec_logical_address) iPtr, 0);
- break;
- default:
- m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, 0xFFFF);
- break;
- }
- }
+#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000
+
+#define ToString(x) m_libcec->ToString(x)
+
+CCECProcessor::CCECProcessor(CLibCEC *libcec) :
+ m_bInitialised(false),
+ m_communication(NULL),
+ m_libcec(libcec),
+ m_bMonitor(false),
+ m_iPreviousAckMask(0),
+ m_iStandardLineTimeout(3),
+ m_iRetryLineTimeout(3),
+ m_iLastTransmission(0)
+{
+ m_busDevices = new CCECDeviceMap(this);