mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Remove openDevice
This commit is contained in:
parent
f7c6c13f2a
commit
040b45d7ea
@ -50,27 +50,19 @@ bool ProviderFtdi::init(const QJsonObject &deviceConfig)
|
|||||||
return isInitOK;
|
return isInitOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProviderFtdi::openDevice()
|
int ProviderFtdi::open()
|
||||||
{
|
{
|
||||||
_ftdic = ftdi_new();
|
int rc = 0;
|
||||||
|
|
||||||
Debug(_log, "Opening FTDI device=%s", QSTRING_CSTR(_deviceName));
|
_ftdic = ftdi_new();
|
||||||
|
|
||||||
|
Debug(_log, "Opening FTDI device=%s", QSTRING_CSTR(_deviceName));
|
||||||
|
|
||||||
if (ftdi_usb_open_string(_ftdic, QSTRING_CSTR(_deviceName)) < 0)
|
if (ftdi_usb_open_string(_ftdic, QSTRING_CSTR(_deviceName)) < 0)
|
||||||
{
|
{
|
||||||
setInError(ftdi_get_error_string(_ftdic));
|
setInError(ftdi_get_error_string(_ftdic));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
int ProviderFtdi::open()
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if ((rc = openDevice()) != 1)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* doing this disable resets things if they were in a bad state */
|
/* doing this disable resets things if they were in a bad state */
|
||||||
if ((rc = ftdi_disable_bitbang(_ftdic)) < 0)
|
if ((rc = ftdi_disable_bitbang(_ftdic)) < 0)
|
||||||
|
@ -71,9 +71,6 @@ protected slots:
|
|||||||
/// @param errorMsg The error message to be logged
|
/// @param errorMsg The error message to be logged
|
||||||
///
|
///
|
||||||
void setInError(const QString& errorMsg, bool isRecoverable=true) override;
|
void setInError(const QString& errorMsg, bool isRecoverable=true) override;
|
||||||
|
|
||||||
private:
|
|
||||||
int openDevice();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PROVIDERFtdi_H
|
#endif // PROVIDERFtdi_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user