typedef enum libcec_alert
{
CEC_ALERT_SERVICE_DEVICE,
- CEC_ALERT_CONNECTION_LOST
+ CEC_ALERT_CONNECTION_LOST,
+ CEC_ALERT_PERMISSION_ERROR,
+ CEC_ALERT_PORT_BUSY
} libcec_alert;
typedef enum libcec_parameter_type
if (!bConnectionOpened)
{
LIB_CEC->AddLog(CEC_LOG_ERROR, strError);
+
+ if (m_port->GetErrorNumber() == EACCES)
+ {
+ libcec_parameter param;
+ param.paramType = CEC_PARAMETER_TYPE_STRING;
+ param.paramData = (void*)"No permission to open the device";
+ LIB_CEC->Alert(CEC_ALERT_PERMISSION_ERROR, param);
+ }
+ else if (m_port->GetErrorNumber() == EBUSY)
+ {
+ libcec_parameter param;
+ param.paramType = CEC_PARAMETER_TYPE_STRING;
+ param.paramData = (void*)"The serial port is busy. Only one program can access the device directly.";
+ LIB_CEC->Alert(CEC_ALERT_PORT_BUSY, param);
+ }
return false;
}