Show
Ignore:
Timestamp:
09/23/08 03:42:04 (16 years ago)
Author:
ppalmers
Message:

Bring trunk up to date with branches/libffado-2.0:

"""
svn merge -r 1254:1299 svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0
svn merge -r 1301:1320 svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0
svn merge -r 1322:1323 svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0
svn merge -r 1329:HEAD svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0
"""

Add getSupportedSamplingFrequencies() to DICE, RME and Metric Halo AvDevices?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/firmware/bridgeco-downloader.cpp

    r1234 r1336  
    4242const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 
    4343const char *doc = "bridgeco-downloader -- firmware downloader application for BridgeCo devices\n\n" 
    44                     "OPERATION: display\n" 
    45                     "           setguid GUID\n" 
    46                     "           firmware FILE\n" 
    47                     "           cne FILE\n" 
    48                     "           bcd FILE\n"; 
     44                    "OPERATION: GUID display\n" 
     45                    "           GUID setguid NEW_GUID\n" 
     46                    "           GUID firmware FILE\n" 
     47                    "           GUID cne FILE\n" 
     48                    "           GUID bcd FILE\n"; 
    4949static struct argp_option _options[] = { 
    5050    {"verbose",   'v', "level",     0,  "Produce verbose output" }, 
     
    8888        ConfigRom configRom(service, i); 
    8989        configRom.initialize(); 
    90          
     90 
    9191        if (configRom.getGuid() == guid) 
    9292            node_id = configRom.getNodeId(); 
     
    135135        } else { 
    136136            cout << "Firmware download was successful" << endl; 
     137            cout << "Please reboot the device by removing the power and firewire connections." << endl; 
    137138        } 
    138139    } else if ( strcmp( args->args[1], "cne" ) == 0 ) { 
     
    148149        } else { 
    149150            cout << "CnE download was successful" << endl; 
     151            cout << "Please reboot the device by removing the power and firewire connections." << endl; 
    150152        } 
    151153    } else if ( strcmp( args->args[1], "display" ) == 0 ) { 
  • trunk/libffado/support/firmware/fireworks-downloader.cpp

    r1234 r1336  
    2525#include "downloader.h" 
    2626 
     27#include "config.h" 
     28 
    2729#include "src/fireworks/fireworks_device.h" 
    2830#include "src/fireworks/fireworks_firmware.h" 
     31#include "src/fireworks/fireworks_session_block.h" 
    2932 
    3033#include "libieee1394/configrom.h" 
    3134#include "libieee1394/ieee1394service.h" 
     35#include "libutil/Configuration.h" 
    3236 
    3337#include "debugmodule/debugmodule.h" 
     
    4953// arg parsing 
    5054//////////////////////////////////////////////// 
    51 const char *argp_program_version = "fireworks-downloader 0.2"; 
     55const char *argp_program_version = "fireworks-downloader 0.3"; 
    5256const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 
    5357const char *doc = "fireworks-downloader -- firmware downloader application for ECHO Fireworks devices\n\n" 
     
    6771                    "              Verify that the firmware contained in the device corresponds\n" 
    6872                    "              to the one contained in FILE\n" 
     73                    "           session_display\n" 
     74                    "              show information about the session on the device\n" 
     75                    "           session_info FILE\n" 
     76                    "              show information about the session in FILE\n" 
     77                    "           session_download FILE\n" 
     78                    "              Download the session content from the device to FILE\n" 
     79                    "           session_upload FILE\n" 
     80                    "              Upload the session from FILE to the device\n" 
    6981                    ; 
    7082 
     
    148160        f.dumpData(); 
    149161        return 0; 
     162    } else if ( strcmp( args->args[0], "session_info" ) == 0 ) { 
     163        if (!args->args[1] ) { 
     164            printMessage("FILE argument is missing\n"); 
     165            return -1; 
     166        } 
     167        std::string str( args->args[1] ); 
     168 
     169        // load the file 
     170        Session s = Session(); 
     171        s.setVerboseLevel( args->verbose ); 
     172 
     173        if (!s.loadFromFile(str)) { 
     174            printMessage("Could not load session\n"); 
     175            return -1; 
     176        } 
     177        s.show(); 
     178        return 0; 
    150179    } else if ( strcmp( args->args[0], "list" ) == 0 ) { 
    151180        printDeviceList(); 
     
    169198        ConfigRom configRom(service, i); 
    170199        configRom.initialize(); 
    171          
    172200        if (configRom.getGuid() == guid) { 
    173201            node_id = configRom.getNodeId(); 
     
    195223    } 
    196224 
    197     if ( !FireWorks::Device::probe(*configRom) ) { 
     225    Util::Configuration c; 
     226    c.openFile( USER_CONFIG_FILE, Util::Configuration::eFM_ReadOnly ); 
     227    c.openFile( SYSTEM_CONFIG_FILE, Util::Configuration::eFM_ReadOnly ); 
     228 
     229    if ( !FireWorks::Device::probe(c, *configRom) ) { 
    198230        printMessage( "Device with node id %d is not an ECHO FireWorks device.\n", 
    199231                    node_id ); 
     
    201233        return -1; 
    202234    } 
    203      
     235 
    204236    DeviceManager d = DeviceManager(); 
    205237    Device *dev = new Device(d, std::auto_ptr<ConfigRom>(configRom) ); 
     
    382414            printMessage(" => Verify successful. Firmware upload successful.\n"); 
    383415        } 
     416    } else if ( strcmp( args->args[0], "session_display" ) == 0 ) { 
     417        // load the session 
     418        Session s = Session(); 
     419        s.setVerboseLevel( args->verbose ); 
     420 
     421        if (!s.loadFromDevice(*dev)) { 
     422            printMessage("Could not load session\n"); 
     423            return -1; 
     424        } 
     425        s.show(); 
     426    } else if ( strcmp( args->args[0], "session_download" ) == 0 ) { 
     427        if (!args->args[1] ) { 
     428            printMessage("FILE argument is missing\n"); 
     429            delete dev; 
     430            return -1; 
     431        } 
     432        std::string str( args->args[1] ); 
     433 
     434        printMessage("Downloading session to file: %s\n", str.c_str()); 
     435 
     436        printMessage(" loading session...\n"); 
     437        // load the session 
     438        Session s = Session(); 
     439        s.setVerboseLevel( args->verbose ); 
     440 
     441        if (!s.loadFromDevice(*dev)) { 
     442            printMessage("Could not load session from device\n"); 
     443            return -1; 
     444        } 
     445 
     446        printMessage(" saving session...\n"); 
     447        if (!s.saveToFile(str)) { 
     448            printMessage("Could not save session to file\n"); 
     449            return -1; 
     450        } 
     451    } else if ( strcmp( args->args[0], "session_upload" ) == 0 ) { 
     452        if (!args->args[1] ) { 
     453            printMessage("FILE argument is missing\n"); 
     454            delete dev; 
     455            return -1; 
     456        } 
     457        std::string str( args->args[1] ); 
     458 
     459        printMessage("Uploading session from file: %s\n", str.c_str()); 
     460 
     461        printMessage(" loading session...\n"); 
     462        // load the session 
     463        Session s = Session(); 
     464        s.setVerboseLevel( args->verbose ); 
     465        if (!s.loadFromFile(str)) { 
     466            printMessage("Could not load session from file\n"); 
     467            return -1; 
     468        } 
     469 
     470        printMessage(" saving session...\n"); 
     471        if (!s.saveToDevice(*dev)) { 
     472            printMessage("Could not save session to device\n"); 
     473            return -1; 
     474        } 
     475 
    384476    }  else { 
    385477        printMessage("Unknown operation\n");