Changeset 42

Show
Ignore:
Timestamp:
12/05/04 14:36:17 (19 years ago)
Author:
wagi
Message:

Register/unregister AvDevice? in AvDevicePool? when detected/disappeared.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/src/avdevice.cpp

    r40 r42  
    2727#include "avdevicemusicsubunit.h" 
    2828 
    29 AvDevice::AvDevice(int port, int node
     29AvDevice::AvDevice(octlet_t oGuid
    3030{ 
    31         iNodeId=node; 
    32         m_iPort=port; 
    33  
    34         // check to see if a device is really present? 
    35  
    36         // probably initialisation would be better done here 
    37  
    38         // Port and node id are not distinct.  The node id 
    39         // can change after a bus reset, therefore the 
    40         // device id has to be taken for identifiction. 
     31    m_oGuid = oGuid; 
    4132} 
    4233 
    4334FBReturnCodes 
    44 AvDevice::Initialize() { 
    45          
    46         if (!m_bInitialised) { 
    47  
    48         m_handle = raw1394_new_handle(); 
     35AvDevice::initialize() { 
     36    if (!m_bInitialised) { 
     37        m_handle = raw1394_new_handle(); 
    4938        if ( !m_handle ) { 
    5039            if ( !errno ) { 
     
    161150                                                        tmpAvDeviceSubunit->unReserve(); 
    162151                                                        //setDebugLevel(DEBUG_LEVEL_MODERATE); 
    163                                                          
     152 
    164153 
    165154                                                } else { 
     
    208197        unsigned char *request_pos; 
    209198        unsigned int i; 
    210         response = avc1394_transaction_block(m_handle, iNodeId, request, request_len, 2); 
     199        response = avc1394_transaction_block(m_handle, m_iNodeId, request, request_len, 2); 
    211200        if (request != NULL) { 
    212201                debugPrint (DEBUG_LEVEL_TRANSFERS, "------- TRANSACTION START -------\n"); 
     
    275264        response = avcExecuteTransaction(request, 2, 2); 
    276265        if (response != NULL) { 
    277          
    278         } 
    279  
     266 
     267        } 
     268        return eFBRC_Success; 
    280269} 
    281270 
     
    292281                *fdf=response[1]& 0x00FFFFFF; 
    293282        } 
    294  
    295 
     283        return eFBRC_Success; 
     284
     285 
    296286FBReturnCodes AvDevice::setOutputPlugSignalFormat(unsigned char plug, unsigned char fmt, quadlet_t fdf) { 
    297287        quadlet_t request[6]; 
     
    303293        response = avcExecuteTransaction(request, 2, 2); 
    304294        if (response != NULL) { 
    305          
    306         } 
    307  
     295 
     296        } 
     297        return eFBRC_Success; 
    308298} 
    309299 
     
    320310                *fdf=response[1]& 0x00FFFFFF; 
    321311        } 
    322  
     312        return eFBRC_Success; 
    323313} 
    324314 
     
    340330        quadlet_t *response; 
    341331                        //setDebugLevel(DEBUG_LEVEL_ALL); 
    342                          
    343         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO source connections:\n");  
     332 
     333        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO source connections:\n"); 
    344334 
    345335        for (unsigned int i=0;i<getNbIsoSourcePlugs();i++) { 
     
    347337                                                | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 
    348338                request[1]=0xFFFEFF00 | ((i & 0xFF)); 
    349                  
     339 
    350340                response = avcExecuteTransaction(request, 2, 2); 
    351          
     341 
    352342                if (response != NULL) { 
    353343                        unsigned char output_status=(response[0]&0xE0) >> 5; 
    354344                        unsigned char conv=(response[0]&0x10) >> 4; 
    355345                        unsigned char signal_status=(response[0]&0x0F); 
    356                          
     346 
    357347                        unsigned int signal_source=((response[1]>>16)&0xFFFF); 
    358                          
     348 
    359349                        unsigned char source_subunit_type=(signal_source>>11)&0x1F; 
    360350                        unsigned char source_subunit_id=(signal_source>>8)&0x07; 
    361351                        unsigned char source_plug=signal_source&0xFF; 
    362                          
     352 
    363353                        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   OPCR 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 
    364                         // find the subunit this plug is connected to  
     354                        // find the subunit this plug is connected to 
    365355                        AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 
    366356                        if(tmpSubunit) { 
    367357                                tmpSubunit->printSourcePlugConnections(source_plug); 
    368358                        } 
    369                          
    370                 } 
    371         } 
    372          
    373         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External source connections:\n");     
     359 
     360                } 
     361        } 
     362 
     363        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External source connections:\n"); 
    374364 
    375365        for (unsigned int i=0;i<getNbExtSourcePlugs();i++) { 
     
    377367                                                | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 
    378368                request[1]=0xFFFEFF00 | ((i & 0xFF)|0x80); 
    379                  
     369 
    380370                response = avcExecuteTransaction(request, 2, 2); 
    381          
     371 
    382372                if (response != NULL) { 
    383373                        unsigned char output_status=(response[0]&0xE0) >> 5; 
    384374                        unsigned char conv=(response[0]&0x10) >> 4; 
    385375                        unsigned char signal_status=(response[0]&0x0F); 
    386                          
     376 
    387377                        unsigned int signal_source=((response[1]>>16)&0xFFFF); 
    388                          
     378 
    389379                        unsigned char source_subunit_type=(signal_source>>11)&0x1F; 
    390380                        unsigned char source_subunit_id=(signal_source>>8)&0x07; 
    391381                        unsigned char source_plug=signal_source&0xFF; 
    392                          
    393                         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status);     
    394                          
    395                         // find the subunit this plug is connected to  
     382 
     383                        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 
     384 
     385                        // find the subunit this plug is connected to 
    396386                        AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 
    397387                        if(tmpSubunit) { 
    398388                                tmpSubunit->printSourcePlugConnections(source_plug); 
    399                         }                       
    400                 } 
    401         } 
    402  
    403         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO sink connections:\n");    
     389                        } 
     390                } 
     391        } 
     392 
     393        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO sink connections:\n"); 
    404394 
    405395        for (unsigned int i=0;i<getNbIsoDestinationPlugs();i++) { 
     
    407397                                                | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 
    408398                request[1]=0xFFFEFF00 | ((i & 0xFF)); 
    409                  
     399 
    410400                response = avcExecuteTransaction(request, 2, 2); 
    411          
     401 
    412402                if (response != NULL) { 
    413403                        unsigned char output_status=(response[0]&0xE0) >> 5; 
    414404                        unsigned char conv=(response[0]&0x10) >> 4; 
    415405                        unsigned char signal_status=(response[0]&0x0F); 
    416                          
     406 
    417407                        unsigned int signal_source=((response[1]>>16)&0xFFFF); 
    418                          
     408 
    419409                        unsigned char source_subunit_type=(signal_source>>11)&0x1F; 
    420410                        unsigned char source_subunit_id=(signal_source>>8)&0x07; 
    421411                        unsigned char source_plug=signal_source&0xFF; 
    422                          
     412 
    423413                        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   OPCR 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 
    424                         // find the subunit this plug is connected to  
     414                        // find the subunit this plug is connected to 
    425415                        AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 
    426416                        if(tmpSubunit) { 
    427417                                //tmpSubunit->printDestinationPlugConnections(source_plug); 
    428418                        } 
    429                          
    430                 } 
    431         } 
    432          
    433         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External sink connections:\n");       
     419 
     420                } 
     421        } 
     422 
     423        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External sink connections:\n"); 
    434424 
    435425        for (unsigned int i=0;i<getNbExtDestinationPlugs();i++) { 
     
    437427                                                | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 
    438428                request[1]=0xFFFEFF00 | ((i & 0xFF)|0x80); 
    439                  
     429 
    440430                response = avcExecuteTransaction(request, 2, 2); 
    441          
     431 
    442432                if (response != NULL) { 
    443433                        unsigned char output_status=(response[0]&0xE0) >> 5; 
    444434                        unsigned char conv=(response[0]&0x10) >> 4; 
    445435                        unsigned char signal_status=(response[0]&0x0F); 
    446                          
     436 
    447437                        unsigned int signal_source=((response[1]>>16)&0xFFFF); 
    448                          
     438 
    449439                        unsigned char source_subunit_type=(signal_source>>11)&0x1F; 
    450440                        unsigned char source_subunit_id=(signal_source>>8)&0x07; 
    451441                        unsigned char source_plug=signal_source&0xFF; 
    452                          
    453                         debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status);     
    454                          
    455                         // find the subunit this plug is connected to  
     442 
     443                        debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice:   EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 
     444 
     445                        // find the subunit this plug is connected to 
    456446                        AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 
    457447                        if(tmpSubunit) { 
    458448                                //tmpSubunit->printDestinationPlugConnections(source_plug); 
    459                         }                       
    460                 } 
    461         } 
    462          
    463 } 
     449                        } 
     450                } 
     451        } 
     452 
     453} 
  • trunk/freebob/src/avdevice.h

    r40 r42  
    1919 * MA 02111-1307 USA. 
    2020 */ 
     21#ifndef AVDEVICE_H 
     22#define AVDEVICE_H 
    2123 
    2224#include "ieee1394service.h" 
     
    2527using std::vector; 
    2628 
    27  
    28 #ifndef AVDEVICE_H 
    29 #define AVDEVICE_H 
    30  
    3129class AvDeviceSubunit; 
    3230 
    3331class AvDevice { 
    3432 public: 
    35     AvDevice(int node,int port); 
     33    AvDevice( octlet_t oGuid ); 
    3634    virtual ~AvDevice(); 
    3735 
    38     quadlet_t * avcExecuteTransaction(quadlet_t *request, unsigned int request_len, unsigned int response_len); 
     36    void setNodeId( int iNodeId )  
     37        { m_iNodeId = iNodeId; } 
     38    int getNodeId() 
     39        { return m_iNodeId; } 
     40    void setPort( int iPort ) 
     41        { m_iPort = iPort; } 
     42    void setGeneration( unsigned int iGeneration ) 
     43        { m_iGeneration = iGeneration; } 
     44    unsigned int getGeneration() 
     45        { return m_iGeneration; } 
     46    octlet_t getGuid() 
     47        { return m_oGuid; } 
    3948 
    40     FBReturnCodes Initialize(); 
    41  
     49    quadlet_t * avcExecuteTransaction( quadlet_t *request,  
     50                                       unsigned int request_len,  
     51                                       unsigned int response_len ); 
     52     
     53    FBReturnCodes initialize(); 
    4254    bool isInitialised(); 
    4355 
     
    5668    unsigned char getNbExtSourcePlugs() { return iNbExtSourcePlugs; } ; 
    5769    unsigned char getNbExtDestinationPlugs() { return iNbExtDestinationPlugs; } ; 
    58      
    59     int getNodeId() { return iNodeId; } ; 
    6070 
    6171 protected: 
     
    6373  
    6474 private: 
    65         int iNodeId; 
    66         raw1394handle_t m_handle; 
    67         int m_iPort; 
    68         bool m_bInitialised; 
    69         vector<AvDeviceSubunit *> cSubUnits; 
    70  
    71         unsigned char iNbAsyncDestinationPlugs; 
    72         unsigned char iNbAsyncSourcePlugs; 
    73         unsigned char iNbIsoDestinationPlugs; 
    74         unsigned char iNbIsoSourcePlugs; 
    75         unsigned char iNbExtDestinationPlugs; 
    76         unsigned char iNbExtSourcePlugs; 
    77  
     75    int m_iNodeId; 
     76    raw1394handle_t m_handle; 
     77    int m_iPort; 
     78    bool m_bInitialised; 
     79    octlet_t m_oGuid; 
     80    unsigned int m_iGeneration;  //Which generation this device belongs to 
     81    vector< AvDeviceSubunit * > cSubUnits; 
     82     
     83    unsigned char iNbAsyncDestinationPlugs; 
     84    unsigned char iNbAsyncSourcePlugs; 
     85    unsigned char iNbIsoDestinationPlugs; 
     86    unsigned char iNbIsoSourcePlugs; 
     87    unsigned char iNbExtDestinationPlugs; 
     88    unsigned char iNbExtSourcePlugs; 
    7889}; 
    7990 
  • trunk/freebob/src/avdevicepool.cpp

    r16 r42  
    1919 */ 
    2020 
     21#include <queue> 
     22 
     23#include "avdevice.h" 
    2124#include "avdevicepool.h" 
     25 
     26AvDevicePool* AvDevicePool::m_pInstance = 0; 
    2227 
    2328AvDevicePool::AvDevicePool() 
     
    2732AvDevicePool::~AvDevicePool() 
    2833{ 
     34} 
     35 
     36AvDevicePool* 
     37AvDevicePool::instance() 
     38{ 
     39    if ( !m_pInstance ) { 
     40        m_pInstance = new AvDevicePool; 
     41    } 
     42    return m_pInstance; 
    2943} 
    3044 
     
    5872} 
    5973 
     74AvDevice* 
     75AvDevicePool::getAvDevice(octlet_t oGuid) 
     76{ 
     77    AvDevice* pAvDevice = 0; 
     78    for ( AvDeviceVector::iterator iter = m_avDevices.begin(); 
     79          iter != m_avDevices.end(); 
     80          ++iter ) 
     81    { 
     82        if ( ( *iter )->getGuid() == oGuid ) { 
     83            pAvDevice = *iter; 
     84            break; 
     85        } 
     86    } 
     87    return pAvDevice; 
     88} 
     89 
     90FBReturnCodes 
     91AvDevicePool::removeObsoleteDevices( unsigned int iGeneration ) 
     92{ 
     93    // XXX dw: removing elements can be done more elegant. 
     94    std::queue< AvDevice* > deleteQueue; 
     95 
     96    for ( AvDeviceVector::iterator iter = m_avDevices.begin(); 
     97          iter != m_avDevices.end(); 
     98          ++iter ) 
     99    { 
     100        if ( ( *iter )->getGeneration() < iGeneration ) { 
     101            deleteQueue.push( *iter ); 
     102        } 
     103    } 
     104 
     105    while ( !deleteQueue.empty() ) { 
     106        AvDevice* pAvDevice = deleteQueue.front(); 
     107        deleteQueue.pop(); 
     108        delete pAvDevice; 
     109    } 
     110 
     111    return eFBRC_Success; 
     112} 
  • trunk/freebob/src/avdevicepool.h

    r16 r42  
    2323#include "freebob.h" 
    2424#include <vector> 
     25#include <libraw1394/raw1394.h> // octlet_t 
    2526 
    2627class AvDevice; 
     
    2829class AvDevicePool { 
    2930 public: 
     31    static AvDevicePool* instance(); 
     32 
     33    FBReturnCodes registerAvDevice( AvDevice* pAvDevice ); 
     34    FBReturnCodes unregisterAvDevice( AvDevice* pAvDevice ); 
     35 
     36    AvDevice* getAvDevice( octlet_t oGuid ); 
     37 
     38    /** 
     39     * Remove devices in pool which where (physically) removed  
     40     * from the bus. 
     41     * 
     42     * All devices which have a lower generation count smaller 
     43     * than iGeneration are removed from the pool 
     44     * 
     45     * @param iGeneration Current generation count. 
     46     * @return see FBReturnCodes. 
     47     */ 
     48    FBReturnCodes removeObsoleteDevices( unsigned int iGeneration ); 
     49 private: 
    3050    AvDevicePool(); 
    3151    ~AvDevicePool(); 
    3252 
    33     FBReturnCodes registerAvDevice(AvDevice* pAvDevice); 
    34     FBReturnCodes unregisterAvDevice(AvDevice* pAvDevice); 
    35  private: 
    36     typedef std::vector<AvDevice*> AvDeviceVector; 
     53    static AvDevicePool* m_pInstance; 
     54 
     55    typedef std::vector< AvDevice* > AvDeviceVector; 
    3756    AvDeviceVector m_avDevices; 
    3857}; 
  • trunk/freebob/src/ieee1394service.cpp

    r40 r42  
    2424#include <libiec61883/iec61883.h> 
    2525 
    26  
    2726#include "ieee1394service.h" 
     27#include "threads.h" 
    2828#include "debugmodule.h" 
     29#include "avdevicepool.h" 
    2930 
    3031#include "avdevice.h" 
     
    104105        startRHThread(); 
    105106 
    106         discoveryDevices(); 
    107107        m_bInitialised = true; 
     108 
     109        asyncCall( this, &Ieee1394Service::discoveryDevices, 
     110                   m_iGenerationCount); 
    108111    } 
    109112    return eFBRC_Success; 
     
    126129 
    127130FBReturnCodes 
    128 Ieee1394Service::discoveryDevices(
     131Ieee1394Service::discoveryDevices( unsigned int iGeneration
    129132{ 
    130133    //scan bus 
     
    152155                                             AVC1394_SUBUNIT_TYPE_AUDIO ) ) { 
    153156 
    154                 // XXX 
    155                 // create avcDevice which discovers itself :) 
    156  
    157                 // PP: just a static try, don't want to mess with the device manager yet... 
    158                 // Remark: the AvDevice and AvDescriptor aren't debugged thouroughly yet! 
    159                 //         the following code is the only debug I had time for... to be continued! (later this week) 
    160                 debugPrint (DEBUG_LEVEL_INFO, "  Trying to create an AvDevice...\n"); 
    161  
    162                 AvDevice *test=new AvDevice(m_iPort, iNodeId); 
    163                 debugPrint (DEBUG_LEVEL_INFO, "   Created...\n"); 
    164                 test->Initialize(); 
    165                 if (test->isInitialised()) { 
    166                         unsigned char fmt; 
    167                         quadlet_t fdf; 
    168                         test->getInputPlugSignalFormat(0,&fmt,&fdf); 
    169                         debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
    170                         test->getInputPlugSignalFormat(1,&fmt,&fdf); 
    171                         debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
    172                         test->getOutputPlugSignalFormat(0,&fmt,&fdf); 
    173                         debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
    174                         test->getOutputPlugSignalFormat(1,&fmt,&fdf); 
    175                         debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
    176                         test->printConnections(); 
    177                 } 
    178                  
    179                 debugPrint (DEBUG_LEVEL_INFO, "   Deleting AvDevice...\n"); 
    180                 delete test; 
    181  
     157                octlet_t oGuid = rom1394_get_guid( m_handle, iNodeId ); 
     158                AvDevice* pAvDevice 
     159                    = AvDevicePool::instance()->getAvDevice( oGuid ); 
     160                if ( !pAvDevice ) { 
     161                    pAvDevice = new AvDevice( oGuid ); 
     162                } 
     163                pAvDevice->setNodeId( iNodeId ); 
     164                pAvDevice->setPort( m_iPort ); 
     165 
     166                if ( !pAvDevice->isInitialised() ) { 
     167                    FBReturnCodes eStatus = pAvDevice->initialize(); 
     168                    if ( eStatus != eFBRC_Success ) { 
     169                        debugError( "AvDevice with GUID 0x%08x%08x could " 
     170                                    "not be initialized\n", 
     171                                    (quadlet_t) (oGuid>>32), 
     172                                    (quadlet_t) (oGuid & 0xffffffff) ); 
     173 
     174                        delete pAvDevice; 
     175                        return eStatus; 
     176                    } 
     177                } 
     178 
     179                // XXX Pieter's test code. 
     180                avDeviceTests( oGuid, m_iPort, iNodeId ); 
    182181            } 
    183182            break; 
     
    195194        } 
    196195    } 
     196 
     197    AvDevicePool::instance()->removeObsoleteDevices( iGeneration ); 
    197198    return eFBRC_Success; 
    198199} 
     200 
     201 
     202void 
     203Ieee1394Service::avDeviceTests(octlet_t oGuid, int iPort, int iNodeId) 
     204{ 
     205    // PP: just a static try, don't want to mess with the device manager yet... 
     206    // Remark: the AvDevice and AvDescriptor aren't debugged thouroughly yet! 
     207    //         the following code is the only debug I had time for... to be continued! (later this week) 
     208                debugPrint (DEBUG_LEVEL_INFO, "  Trying to create an AvDevice...\n"); 
     209 
     210                AvDevice *test=new AvDevice(oGuid); 
     211                test->setNodeId( iNodeId ); 
     212                test->setPort( iPort ); 
     213                debugPrint (DEBUG_LEVEL_INFO, "   Created...\n"); 
     214                test->initialize(); 
     215                if (test->isInitialised()) { 
     216                        unsigned char fmt; 
     217                        quadlet_t fdf; 
     218                        test->getInputPlugSignalFormat(0,&fmt,&fdf); 
     219                        debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
     220                        test->getInputPlugSignalFormat(1,&fmt,&fdf); 
     221                        debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
     222                        test->getOutputPlugSignalFormat(0,&fmt,&fdf); 
     223                        debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
     224                        test->getOutputPlugSignalFormat(1,&fmt,&fdf); 
     225                        debugPrint (DEBUG_LEVEL_INFO, "   fmt=%02X fdf=%08X\n",fmt,fdf); 
     226                        test->printConnections(); 
     227                } 
     228 
     229                debugPrint (DEBUG_LEVEL_INFO, "   Deleting AvDevice...\n"); 
     230                delete test; 
     231} 
     232 
    199233 
    200234void 
     
    309343        = (Ieee1394Service*) raw1394_get_userdata (handle); 
    310344    pInstance->setGenerationCount( iGeneration ); 
     345 
     346    // dw: let's rescan the bus.  this might not the correct order 
     347    // of commands. 
     348    asyncCall( pInstance, &Ieee1394Service::discoveryDevices, iGeneration ); 
    311349    return 0; 
    312350} 
  • trunk/freebob/src/ieee1394service.h

    r31 r42  
    5757 
    5858    static Ieee1394Service* instance(); 
    59     FBReturnCodes discoveryDevices(); 
     59    FBReturnCodes discoveryDevices( unsigned int iGenerationCount ); 
    6060 
    6161    unsigned int getGenerationCount(); 
     
    7272    void printAvcUnitInfo( int iNodeId ); 
    7373    void printRomDirectory( int iNodeId,  rom1394_directory* pRomDir ); 
     74 
     75    void avDeviceTests( octlet_t oGuid, int iPort, int iNodeId ); 
    7476 private: 
    7577    Ieee1394Service(); 
     
    7981    raw1394handle_t m_handle; 
    8082    raw1394handle_t m_rhHandle; 
    81     int m_iPort; 
     83    int m_iPort;                  // XXX dw: port in 1394 service makes no sense 
    8284    bool m_bInitialised; 
    8385    pthread_t m_thread;