| 269 | } |
| 270 | |
| 271 | void *CUSBCECAdapterCommunication::Process(void) |
| 272 | { |
| 273 | LIB_CEC->AddLog(CEC_LOG_DEBUG, "communication thread started"); |
| 274 | |
| 275 | while (!IsStopped()) |
| 276 | { |
| 277 | /* read from the serial port */ |
| 278 | if (!ReadFromDevice(50, 5)) |
| 279 | { |
| 280 | libcec_parameter param; |
| 281 | param.paramData = NULL; param.paramType = CEC_PARAMETER_TYPE_UNKOWN; |
| 282 | LIB_CEC->Alert(CEC_ALERT_CONNECTION_LOST, param); |
| 283 | |
| 284 | break; |
| 285 | } |
| 286 | |
| 287 | /* TODO sleep 5 ms so other threads can get a lock */ |
| 288 | if (!IsStopped()) |
| 289 | Sleep(5); |
| 290 | } |
| 291 | |
| 292 | m_adapterMessageQueue->Clear(); |
| 293 | LIB_CEC->AddLog(CEC_LOG_DEBUG, "communication thread ended"); |
| 294 | return NULL; |
| 295 | } |
| 296 | |
| 297 | bool CUSBCECAdapterCommunication::HandlePoll(const CCECAdapterMessage &msg) |
| 298 | { |
nothing calls this directly
no test coverage detected