Changeset 847

Show
Ignore:
Timestamp:
08/25/08 13:58:20 (5 months ago)
Author:
liamstask
Message:

Adding in EBo's patch for Linux USB enumeration

Location:
mchelper/branches/v25
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • mchelper/branches/v25/mchelper.pro

    r844 r847  
    1010 
    1111HEADERS = include/MainWindow.h \ 
    12           # src/bonjour/BonjourRecord.h \ 
    13           # src/bonjour/BonjourServiceBrowser.h \ 
    14           # src/bonjour/BonjourServiceRegister.h \ 
    15           # src/bonjour/BonjourServiceResolver.h \ 
    1612          include/OscXmlServer.h \ 
    1713          include/Osc.h \ 
     
    3127SOURCES = src/main.cpp \ 
    3228          src/MainWindow.cpp \ 
    33           # src/bonjour/BonjourServiceBrowser.cpp \ 
    34           # src/bonjour/BonjourServiceRegister.cpp \ 
    35           # src/bonjour/BonjourServiceResolver.cpp \ 
    3629          src/OscXmlServer.cpp \ 
    3730          src/Osc.cpp \ 
     
    6457} 
    6558 
    66 # OS X links Bonjour all by itself 
    67 # !mac:LIBS += -ldns_sd 
    68  
    6959# ******************************************* 
    7060#              qextserialport 
     
    8373unix:DEFINES  += _TTY_POSIX_ 
    8474macx: LIBS += -framework IOKit # use IOKit on OS X 
    85 unix{ !macx: LIBS += -lusb } # use libusb on other unices 
     75unix{  
     76  !macx{ 
     77    CONFIG += link_pkgconfig 
     78    PKGCONFIG += dbus-1 hal 
     79  } 
     80} 
    8681 
    8782win32:HEADERS += src/qextserialport/win_qextserialport.h 
  • mchelper/branches/v25/src/MainWindow.cpp

    r831 r847  
    174174  board->setIcon(QIcon(":icons/network_icon.gif")); 
    175175  board->setToolTip("Ethernet Device: " + pi->key()); 
     176   
    176177  if(noUi()) 
    177178  { 
     
    179180    out << "network device discovered: " + pi->key() << endl; 
    180181  } 
    181   deviceList->addItem(board); 
     182   
    182183  boardInit(board); 
    183184  boardList.append(board); 
     
    206207      board->setToolTip("USB Serial Device: " + key); 
    207208      noUiString = "usb device discovered: " + key; 
     209      actionUpload->setEnabled(false); 
    208210    } 
    209211    else if(type == BoardType::UsbSamba) 
     
    214216      board->setToolTip("Unprogrammed device"); 
    215217      noUiString = "sam-ba device discovered: " + key; 
     218      actionUpload->setEnabled(true); 
    216219    } 
    217220     
     
    221224      out << noUiString << endl; 
    222225    } 
    223     deviceList->addItem(board); 
     226     
    224227    boardInit(board); 
    225228    boardList.append(board); 
     
    238241  if( placeholderRow >= 0 ) 
    239242    deviceList->takeItem( placeholderRow ); 
     243  deviceList->addItem(board); 
     244  // if no other boards are selected, select this new one 
     245  if( !getCurrentBoard() ) 
     246    deviceList->setCurrentRow (deviceList->count()-1); 
     247  board->sendMessage("/system/info-internal"); // get the board's info 
    240248} 
    241249 
     
    356364} 
    357365 
     366/* 
     367  Return the currently selected board in the UI list of boards, 
     368  or NULL if none are selected. 
     369*/ 
    358370Board* MainWindow::getCurrentBoard( ) 
    359371{ 
  • mchelper/branches/v25/src/UsbMonitor.cpp

    r588 r847  
    1919#include "PacketUsbSerial.h" 
    2020#include "qextserialenumerator.h" 
     21 
     22#define MAKE_CONTROLLER_VID 0xEB03 
     23#define MAKE_CONTROLLER_PID 0x0920 
     24#define SAM_BA_VID          0xEB03 
     25#define SAM_BA_PID          0x6124 
    2126 
    2227/* 
     
    5055    foreach(QextPortInfo port, ports) 
    5156    { 
    52       if(!usbSerialList.contains(port.portName) && port.friendName.startsWith("Make Controller Ki")) 
     57      // the portname needs to be tweeked  
     58      if( !usbSerialList.contains(port.portName) ) 
    5359      { 
    54         usbSerialList.append(port.portName); // keep our internal list, the portName is the unique key 
    55         newSerialPorts.append(port.portName); // on the list to be posted to the UI 
     60        if( port.friendName.startsWith("Make Controller Ki") || 
     61           (port.vendorID == MAKE_CONTROLLER_VID && port.productID == MAKE_CONTROLLER_PID)) 
     62        { 
     63          usbSerialList.append(port.portName);  // keep our internal list, the portName is the unique key 
     64          newSerialPorts.append(port.portName); // on the list to be posted to the UI 
     65        } 
     66      } 
     67       
     68      if( !usbSambaList.contains(port.portName) ) 
     69      { 
     70        if( port.vendorID == SAM_BA_VID && port.productID == SAM_BA_PID ) 
     71        { 
     72          usbSambaList.append(port.portName);  // keep our internal list, the portName is the unique key 
     73          newSambaPorts.append(port.portName); // on the list to be posted to the UI 
     74        } 
    5675      } 
    5776      // check for samba boards... 
    5877      portNames << port.portName; 
    5978    } 
     79     
    6080    if(newSerialPorts.count()) 
    6181      emit newBoards(newSerialPorts, BoardType::UsbSerial); 
     
    7393    } 
    7494     
    75     // then check the samba boards 
     95    // same thing for the samba boards 
    7696    foreach(QString key, usbSambaList) 
    7797    {