MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / Open

Method Open

src/libcec/adapter/RPi/RPiCECAdapterCommunication.cpp:261–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261bool CRPiCECAdapterCommunication::Open(uint32_t iTimeoutMs /* = CEC_DEFAULT_CONNECT_TIMEOUT */, bool UNUSED(bSkipChecks) /* = false */, bool bStartListening)
262{
263 Close();
264
265 InitHost();
266
267 if (bStartListening)
268 {
269 // enable passive mode
270 vc_cec_set_passive(true);
271
272 // register the callbacks
273 vc_cec_register_callback(rpi_cec_callback, (void*)this);
274 vc_tv_register_callback(rpi_tv_callback, (void*)this);
275
276 // register LA "freeuse"
277 if (RegisterLogicalAddress(CECDEVICE_FREEUSE, iTimeoutMs))
278 {
279 LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s - vc_cec initialised", __FUNCTION__);
280 CLockObject lock(m_mutex);
281 m_bInitialised = true;
282 }
283 else
284 {
285 LIB_CEC->AddLog(CEC_LOG_ERROR, "%s - vc_cec could not be initialised", __FUNCTION__);
286 return false;
287 }
288 }
289
290 return true;
291}
292
293uint16_t CRPiCECAdapterCommunication::GetPhysicalAddress(void)
294{

Callers

nothing calls this directly

Calls 2

CloseFunction · 0.85
AddLogMethod · 0.45

Tested by

no test coverage detected