Changeset 1161

Show
Ignore:
Timestamp:
05/11/08 09:44:58 (13 years ago)
Author:
ppalmers
Message:

add busreset functionality

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libieee1394/CycleTimerHelper.cpp

    r1082 r1161  
    207207 
    208208    // register a bus reset handler 
    209     Util::Functor* m_busreset_functor = new Util::MemberFunctor0< CycleTimerHelper*, 
     209    m_busreset_functor = new Util::MemberFunctor0< CycleTimerHelper*, 
    210210                void (CycleTimerHelper::*)() > 
    211211                ( this, &CycleTimerHelper::busresetHandler, false ); 
  • trunk/libffado/src/libieee1394/ieee1394service.cpp

    r1136 r1161  
    151151    } 
    152152    return nb_detected_ports; 
     153} 
     154 
     155void 
     156Ieee1394Service::doBusReset() { 
     157    raw1394_reset_bus(m_handle); 
    153158} 
    154159 
  • trunk/libffado/src/libieee1394/ieee1394service.h

    r1136 r1161  
    234234    bool addBusResetHandler( Util::Functor* functor ); 
    235235    bool remBusResetHandler( Util::Functor* functor ); 
     236 
     237    void doBusReset(); 
    236238 
    237239    /** 
  • trunk/libffado/tests/test-ffado.cpp

    r1146 r1161  
    6565                    "           SetSamplerate samplerate\n" 
    6666                    "           SetClockSource [id]\n" 
     67                    "           BusReset\n" 
    6768                    ; 
    6869 
     
    215216} 
    216217 
     218void  
     219busreset(unsigned int port) 
     220{ 
     221    Ieee1394Service service; 
     222    // switch off all messages since they mess up the list 
     223    service.setVerboseLevel(0); 
     224    if ( !service.initialize( port ) ) { 
     225        printf("Could not initialize IEEE 1394 service on port %d\n", port); 
     226        exit(-1); 
     227    } 
     228 
     229    printf("Doing busreset on port %d\n", port); 
     230    service.doBusReset(); 
     231} 
    217232 
    218233int 
     
    268283        delete m_deviceManager; 
    269284        return exitfunction(0); 
     285    } else if ( strcmp( arguments.args[0], "BusReset" ) == 0 ) { 
     286        unsigned int nb_ports = Ieee1394Service::detectNbPorts(); 
     287         
     288 
    270289    } else if ( strcmp( arguments.args[0], "ListDevices" ) == 0 ) { 
    271290        unsigned int nb_ports = Ieee1394Service::detectNbPorts();