diff options
Diffstat (limited to 'tools/runonphone')
33 files changed, 57 insertions, 38 deletions
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index 93b087b..9390fb4 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/ossignalconverter.cpp b/tools/runonphone/ossignalconverter.cpp index 8566458..71e705f 100644 --- a/tools/runonphone/ossignalconverter.cpp +++ b/tools/runonphone/ossignalconverter.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/ossignalconverter.h b/tools/runonphone/ossignalconverter.h index 398d0f6..7c69a4b 100644 --- a/tools/runonphone/ossignalconverter.h +++ b/tools/runonphone/ossignalconverter.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/ossignalconverter_p.h b/tools/runonphone/ossignalconverter_p.h index dddc9ca..b7991c8 100644 --- a/tools/runonphone/ossignalconverter_p.h +++ b/tools/runonphone/ossignalconverter_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/serenum.h b/tools/runonphone/serenum.h index a65c8cb..4ed7d4d 100644 --- a/tools/runonphone/serenum.h +++ b/tools/runonphone/serenum.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/serenum_stub.cpp b/tools/runonphone/serenum_stub.cpp index 6f0e1ef..08b0fab 100644 --- a/tools/runonphone/serenum_stub.cpp +++ b/tools/runonphone/serenum_stub.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index f5b2521..8cc0b82 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -82,7 +82,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) for (struct usb_bus *bus = usb_get_busses(); bus; bus = bus->next) { for (struct usb_device *device = bus->devices; device; device = device->next) { - for (int n = 0; n < device->descriptor.bNumConfigurations; ++n) { + for (int n = 0; n < device->descriptor.bNumConfigurations && device->config; ++n) { struct usb_config_descriptor &usbConfig =device->config[n]; QList<int> usableInterfaces; for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { @@ -146,6 +146,10 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) // second loop to find the actual data interface. foreach (int i, usableInterfaces) { +#ifdef Q_OS_MAC + eligibleInterfaces << QString("^cu\\.usbmodem.*%1$") + .arg(QString("%1").arg(descriptor.bInterfaceNumber, 1, 16).toUpper()); +#else // ### manufacturer and product strings are only readable as root :( if (!manufacturerString.isEmpty() && !productString.isEmpty()) { eligibleInterfaces << QString("usb-%1_%2-if%3") @@ -155,6 +159,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) } else { eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } +#endif } eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } @@ -164,14 +169,24 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) if (loglevel > 1) qDebug() << " searching for interfaces:" << eligibleInterfaces; +#ifdef Q_OS_MAC + QDir dir("/dev/"); + bool allowAny = false; +#else QDir dir("/dev/serial/by-id/"); - foreach (const QFileInfo &info, dir.entryInfoList()) { + bool allowAny = eligibleInterfaces.isEmpty(); +#endif + foreach (const QFileInfo &info, dir.entryInfoList(QDir::System)) { if (!info.isDir()) { - bool usable = eligibleInterfaces.isEmpty(); + bool usable = allowAny; + QString friendlyName = info.fileName(); foreach (const QString &iface, eligibleInterfaces) { - if (info.fileName().contains(iface)) { + if (info.fileName().contains(QRegExp(iface))) { if (loglevel > 1) qDebug() << " found device file:" << info.fileName() << endl; +#ifdef Q_OS_MAC + friendlyName = eligibleInterfacesInfo[eligibleInterfaces.indexOf(iface)].product; +#endif usable = true; break; } @@ -180,7 +195,7 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) continue; SerialPortId id; - id.friendlyName = info.fileName(); + id.friendlyName = friendlyName; id.portName = info.canonicalFilePath(); list << id; } @@ -193,11 +208,15 @@ QList<SerialPortId> enumerateSerialPorts(int loglevel) << iface.manufacturer << "Product:" << iface.product +#ifdef Q_OS_LINUX << endl << " Load generic driver using:" << QString("sudo modprobe usbserial vendor=0x%1 product=0x%2") .arg(iface.manufacturerid, 4, 16, QChar('0')) .arg(iface.productid, 4, 16, QChar('0')); +#else + ; +#endif } } return list; diff --git a/tools/runonphone/serenum_win.cpp b/tools/runonphone/serenum_win.cpp index 070cac2..7cc9d52 100644 --- a/tools/runonphone/serenum_win.cpp +++ b/tools/runonphone/serenum_win.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/bluetoothlistener.cpp b/tools/runonphone/symbianutils/bluetoothlistener.cpp index df04288..be232db 100644 --- a/tools/runonphone/symbianutils/bluetoothlistener.cpp +++ b/tools/runonphone/symbianutils/bluetoothlistener.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/bluetoothlistener.h b/tools/runonphone/symbianutils/bluetoothlistener.h index 36894e7..3875727 100644 --- a/tools/runonphone/symbianutils/bluetoothlistener.h +++ b/tools/runonphone/symbianutils/bluetoothlistener.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/bluetoothlistener_gui.cpp b/tools/runonphone/symbianutils/bluetoothlistener_gui.cpp index 5994eb5..c3f36b2 100644 --- a/tools/runonphone/symbianutils/bluetoothlistener_gui.cpp +++ b/tools/runonphone/symbianutils/bluetoothlistener_gui.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/bluetoothlistener_gui.h b/tools/runonphone/symbianutils/bluetoothlistener_gui.h index 10e7145..d0edc7a 100644 --- a/tools/runonphone/symbianutils/bluetoothlistener_gui.h +++ b/tools/runonphone/symbianutils/bluetoothlistener_gui.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/callback.h b/tools/runonphone/symbianutils/callback.h index 3996d73..4ee77ea 100644 --- a/tools/runonphone/symbianutils/callback.h +++ b/tools/runonphone/symbianutils/callback.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/communicationstarter.cpp b/tools/runonphone/symbianutils/communicationstarter.cpp index cdee49f..602786b 100644 --- a/tools/runonphone/symbianutils/communicationstarter.cpp +++ b/tools/runonphone/symbianutils/communicationstarter.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/communicationstarter.h b/tools/runonphone/symbianutils/communicationstarter.h index 0a060ee..9fec589 100644 --- a/tools/runonphone/symbianutils/communicationstarter.h +++ b/tools/runonphone/symbianutils/communicationstarter.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/json.cpp b/tools/runonphone/symbianutils/json.cpp index 2d58824..755df5e 100644 --- a/tools/runonphone/symbianutils/json.cpp +++ b/tools/runonphone/symbianutils/json.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/json.h b/tools/runonphone/symbianutils/json.h index ffcb7ab..a9190f8 100644 --- a/tools/runonphone/symbianutils/json.h +++ b/tools/runonphone/symbianutils/json.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/launcher.cpp b/tools/runonphone/symbianutils/launcher.cpp index ee87480..a5d3d68 100644 --- a/tools/runonphone/symbianutils/launcher.cpp +++ b/tools/runonphone/symbianutils/launcher.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/launcher.h b/tools/runonphone/symbianutils/launcher.h index 230a122..fac65b5 100644 --- a/tools/runonphone/symbianutils/launcher.h +++ b/tools/runonphone/symbianutils/launcher.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/symbiandevicemanager.cpp b/tools/runonphone/symbianutils/symbiandevicemanager.cpp index 8877ea1..8d65d18 100644 --- a/tools/runonphone/symbianutils/symbiandevicemanager.cpp +++ b/tools/runonphone/symbianutils/symbiandevicemanager.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/symbiandevicemanager.h b/tools/runonphone/symbianutils/symbiandevicemanager.h index 180173d..b4edd78 100644 --- a/tools/runonphone/symbianutils/symbiandevicemanager.h +++ b/tools/runonphone/symbianutils/symbiandevicemanager.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/symbianutils_global.h b/tools/runonphone/symbianutils/symbianutils_global.h index a6ffbe7..d7acabf 100644 --- a/tools/runonphone/symbianutils/symbianutils_global.h +++ b/tools/runonphone/symbianutils/symbianutils_global.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/tcftrkdevice.cpp b/tools/runonphone/symbianutils/tcftrkdevice.cpp index 50e3937..5b923ee 100644 --- a/tools/runonphone/symbianutils/tcftrkdevice.cpp +++ b/tools/runonphone/symbianutils/tcftrkdevice.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/tcftrkdevice.h b/tools/runonphone/symbianutils/tcftrkdevice.h index f56a86e..d42f3f3 100644 --- a/tools/runonphone/symbianutils/tcftrkdevice.h +++ b/tools/runonphone/symbianutils/tcftrkdevice.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/tcftrkmessage.cpp b/tools/runonphone/symbianutils/tcftrkmessage.cpp index 06035ab..8d62dec 100644 --- a/tools/runonphone/symbianutils/tcftrkmessage.cpp +++ b/tools/runonphone/symbianutils/tcftrkmessage.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/tcftrkmessage.h b/tools/runonphone/symbianutils/tcftrkmessage.h index 929a9e6..f2c8022 100644 --- a/tools/runonphone/symbianutils/tcftrkmessage.h +++ b/tools/runonphone/symbianutils/tcftrkmessage.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/trkdevice.cpp b/tools/runonphone/symbianutils/trkdevice.cpp index 9039184..2825b5f 100644 --- a/tools/runonphone/symbianutils/trkdevice.cpp +++ b/tools/runonphone/symbianutils/trkdevice.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/trkdevice.h b/tools/runonphone/symbianutils/trkdevice.h index 1021a7d..bb54be5 100644 --- a/tools/runonphone/symbianutils/trkdevice.h +++ b/tools/runonphone/symbianutils/trkdevice.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/trkutils.cpp b/tools/runonphone/symbianutils/trkutils.cpp index d89da20..168f539 100644 --- a/tools/runonphone/symbianutils/trkutils.cpp +++ b/tools/runonphone/symbianutils/trkutils.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/trkutils.h b/tools/runonphone/symbianutils/trkutils.h index d365f0d..c22df86 100644 --- a/tools/runonphone/symbianutils/trkutils.h +++ b/tools/runonphone/symbianutils/trkutils.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/symbianutils/trkutils_p.h b/tools/runonphone/symbianutils/trkutils_p.h index 05df83a..df9504c 100644 --- a/tools/runonphone/symbianutils/trkutils_p.h +++ b/tools/runonphone/symbianutils/trkutils_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/trksignalhandler.cpp b/tools/runonphone/trksignalhandler.cpp index 898692a..a2b8f6f 100644 --- a/tools/runonphone/trksignalhandler.cpp +++ b/tools/runonphone/trksignalhandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** diff --git a/tools/runonphone/trksignalhandler.h b/tools/runonphone/trksignalhandler.h index bfe2c3e..f833180 100644 --- a/tools/runonphone/trksignalhandler.h +++ b/tools/runonphone/trksignalhandler.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** |