From db5bb323db276bfc60f5b16c22054dbd8b2f18a0 Mon Sep 17 00:00:00 2001
From: Mark Watkins <jedimark@users.sourceforge.net>
Date: Sun, 7 Aug 2011 13:22:09 +1000
Subject: [PATCH] Mac Serial port detection stuff

---
 oximetry.cpp | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/oximetry.cpp b/oximetry.cpp
index 2baf9895..cb139df2 100644
--- a/oximetry.cpp
+++ b/oximetry.cpp
@@ -115,11 +115,20 @@ void Oximetry::on_RefreshPortsButton_clicked()
 #define qesPORTNAME physName
 #endif
     for (int i = 0; i < ports.size(); i++) {
-        if (ports.at(i).friendName.toUpper().contains("USB")) {
-            if (firstport.isEmpty()) firstport=ports.at(i). qesPORTNAME;
-            if (!portname.isEmpty() && ports.at(i).qesPORTNAME==portname) current_found=true;
-            ui->SerialPortsCombo->addItem(ports.at(i).qesPORTNAME);
-            z++;
+        if (!ports.at(i).friendName.isEmpty()) {
+            if (ports.at(i).friendName.toUpper().contains("USB")) {
+                if (firstport.isEmpty()) firstport=ports.at(i). qesPORTNAME;
+                if (!portname.isEmpty() && ports.at(i).qesPORTNAME==portname) current_found=true;
+                ui->SerialPortsCombo->addItem(ports.at(i).qesPORTNAME);
+                z++;
+            }
+        } else { // Mac stuff.
+            if (ports.at(i).portName.toUpper().contains("USB") || ports.at(i).portName.toUpper().contains("SPO2")) {
+                if (firstport.isEmpty()) firstport=ports.at(i).portName;
+                if (!portname.isEmpty() && ports.at(i).portName==portname) current_found=true;
+                ui->SerialPortsCombo->addItem(ports.at(i).portName);
+                z++;
+            }
         }
         //qDebug() << "Serial Port:" << ports.at(i).qesPORTNAME << ports.at(i).friendName;
         qDebug() << "port name:" << ports.at(i).portName;