| 259 | } |
| 260 | |
| 261 | bool 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 | |
| 293 | uint16_t CRPiCECAdapterCommunication::GetPhysicalAddress(void) |
| 294 | { |