mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-16 02:30:45 +00:00
Dump some serialport scanning information to help get the CMS50xW ports detected
This commit is contained in:
parent
6fd823104d
commit
15de13f107
@ -429,9 +429,10 @@ void RecalcMAP::run()
|
|||||||
|
|
||||||
ChannelID prescode = CPAP_Pressure;
|
ChannelID prescode = CPAP_Pressure;
|
||||||
|
|
||||||
if (day->channelExists(CPAP_IPAP)) {
|
// if (day->channelExists(CPAP_IPAP)) {
|
||||||
prescode = CPAP_IPAP;
|
// prescode = CPAP_IPAP;
|
||||||
} else if (day->channelExists(CPAP_EPAP)) {
|
// } else
|
||||||
|
if (day->channelExists(CPAP_EPAP)) {
|
||||||
prescode = CPAP_EPAP;
|
prescode = CPAP_EPAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,14 @@ CMS50F37Loader::~CMS50F37Loader()
|
|||||||
bool CMS50F37Loader::openDevice()
|
bool CMS50F37Loader::openDevice()
|
||||||
{
|
{
|
||||||
if (port.isEmpty()) {
|
if (port.isEmpty()) {
|
||||||
if (!scanDevice("",m_vendorID, m_productID))
|
bool b = scanDevice("",m_vendorID, m_productID);
|
||||||
|
if (!b) {
|
||||||
|
// b = scanDevice("", 0, 0);
|
||||||
|
}
|
||||||
|
if (!b) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
serial.setPortName(port);
|
serial.setPortName(port);
|
||||||
if (!serial.open(QSerialPort::ReadWrite))
|
if (!serial.open(QSerialPort::ReadWrite))
|
||||||
return false;
|
return false;
|
||||||
|
@ -34,24 +34,33 @@ bool SerialOximeter::scanDevice(QString keyword,quint16 vendor_id, quint16 produ
|
|||||||
|
|
||||||
// How does the mac detect this as a SPO2 device?
|
// How does the mac detect this as a SPO2 device?
|
||||||
for (int i=0;i<list.size();i++) {
|
for (int i=0;i<list.size();i++) {
|
||||||
const QSerialPortInfo * info=&list.at(i);
|
const QSerialPortInfo * info = &list.at(i);
|
||||||
QString name=info->portName();
|
QString name = info->portName();
|
||||||
QString desc=info->description();
|
QString desc = info->description();
|
||||||
|
|
||||||
if ((!keyword.isEmpty() && desc.contains(keyword)) ||
|
if ((!keyword.isEmpty() && desc.contains(keyword)) ||
|
||||||
((info->hasVendorIdentifier() && (info->vendorIdentifier()==vendor_id))
|
((info->hasVendorIdentifier() && (info->vendorIdentifier() == vendor_id))
|
||||||
&& (info->hasProductIdentifier() && (info->productIdentifier()==product_id))))
|
&& (info->hasProductIdentifier() && (info->productIdentifier() == product_id))))
|
||||||
{
|
{
|
||||||
ports.push_back(name);
|
ports.push_back(name);
|
||||||
QString dbg=QString("Found Serial Port: %1 %2 %3 %4").arg(name).arg(desc).arg(info->manufacturer()).arg(info->systemLocation());
|
QString dbg=QString("Found Serial Port: %1 %2 %3 %4").arg(name).arg(desc).arg(info->manufacturer()).arg(info->systemLocation());
|
||||||
|
|
||||||
if (info->hasProductIdentifier()) //60000
|
if (info->hasProductIdentifier()) //60000
|
||||||
dbg+=QString(" PID: %1").arg(info->productIdentifier());
|
dbg += QString(" PID: %1").arg(info->productIdentifier());
|
||||||
if (info->hasVendorIdentifier()) // 4292
|
if (info->hasVendorIdentifier()) // 4292
|
||||||
dbg+=QString(" VID: %1").arg(info->vendorIdentifier());
|
dbg += QString(" VID: %1").arg(info->vendorIdentifier());
|
||||||
|
|
||||||
qDebug() << dbg.toLocal8Bit().data();
|
qDebug() << dbg.toLocal8Bit().data();
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
QString dbg=QString("Other Serial Port: %1 %2 %3 %4").arg(name).arg(desc).arg(info->manufacturer()).arg(info->systemLocation());
|
||||||
|
|
||||||
|
if (info->hasProductIdentifier()) //60000
|
||||||
|
dbg += QString(" PID: %1").arg(info->productIdentifier());
|
||||||
|
if (info->hasVendorIdentifier()) // 4292
|
||||||
|
dbg += QString(" VID: %1").arg(info->vendorIdentifier());
|
||||||
|
|
||||||
|
qDebug() << dbg.toLocal8Bit().data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ports.isEmpty()) {
|
if (ports.isEmpty()) {
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="importTab">
|
<widget class="QWidget" name="importTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user