Changeset 2096

Show
Ignore:
Timestamp:
03/29/12 13:29:11 (11 years ago)
Author:
adi
Message:

DICE-EAP Mute rather than remove route when disabling a destination

By Philippe Carriere:

Really removing a route is not fully supported by all devices; then
muting is preferable when one just want to set a different connection
state (as part of a modification of one source for another one for a
given destination).

A getMuteId() function is introduced so as to be easily customized for
specific devices, if necessary.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_eap.cpp

    r2095 r2096  
    278278EAP::setupSources_high() { 
    279279    setupSources_low(); 
     280} 
     281 
     282unsigned int 
     283EAP::getSMuteId() { 
     284    return m_router->getSourceIndex("Mute:00"); 
    280285} 
    281286 
     
    15071512        ret = rcfg->setupRoute(source, dest); 
    15081513    } else { 
    1509         ret = rcfg->removeRoute(source, dest); 
     1514        ret = rcfg->muteRoute(dest); 
     1515        // FixMe: 
     1516        //   Not all devices are intended to work correctly with a variable number of router entries 
     1517        //     so muting the destination is preferable 
     1518        //   Now, this might be useful for some other ones, but is it the right place for this ? 
     1519        //   ret = rcfg->removeRoute(source, dest); 
    15101520    } 
    15111521    m_eap.updateCurrentRouterConfig(*rcfg); 
     
    17231733} 
    17241734 
     1735 
    17251736bool 
    17261737EAP::RouterConfig::removeRoute(unsigned char src, unsigned char dest) { 
     
    17311742            return false; 
    17321743          } 
    1733           return removeRoute(dest); 
    1734         } 
    1735     } 
    1736     return true; 
     1744          m_routes2.erase(it); 
     1745          return true; 
     1746        } 
     1747    } 
     1748    return false; 
     1749
     1750 
     1751bool 
     1752EAP::RouterConfig::muteRoute(unsigned char dest) { 
     1753    for (RouteVectorV2::iterator it=m_routes2.begin(); it!=m_routes2.end(); ++it) { 
     1754        if (it->first == dest) { 
     1755          it->second = m_eap.getSMuteId(); 
     1756          return true; 
     1757        } 
     1758    } 
     1759    return false; 
    17371760} 
    17381761 
  • trunk/libffado/src/dice/dice_eap.h

    r2095 r2096  
    220220          */ 
    221221        bool setupRoute(unsigned char src, unsigned char dest); 
     222 
     223        /** 
     224          @brief Mute a route for dest 
     225 
     226          All EAP devices will support muting. 
     227          Not all of them support (at least full support) removing a dest (see comment below) 
     228          */ 
     229        bool muteRoute(unsigned char dest); 
     230 
    222231        /** 
    223232          @brief Remove a route 
     
    529538    virtual void setupSources_mid(); 
    530539    virtual void setupSources_high(); 
     540    virtual unsigned int getSMuteId(); 
    531541    /** 
    532542      @brief Setup all the available destinations