Changeset 1717

Show
Ignore:
Timestamp:
11/16/09 14:37:28 (14 years ago)
Author:
arnonym
Message:

Make reading the whole application space its own special thing.

Files:

Legend:

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

    r1713 r1717  
    461461    } 
    462462 
    463     printMessage("--- Application space ---\n"); 
    464     fb_quadlet_t* tmp = (fb_quadlet_t *)calloc(128, sizeof(fb_quadlet_t)); 
    465     unsigned int appsize = 512; //m_app_size; /// m_app_size is rather big. Start with the first four block of 128 quadlets... 
    466     unsigned int offset = 0; 
    467     while ( appsize > 0 ) { 
    468         if ( ! readRegBlock( eRT_Application, offset, tmp, (appsize<128)?appsize:128 ) ) 
    469             appsize = 0; 
    470         else { 
    471             hexDumpQuadlets(tmp, 128); 
    472             offset += 128; 
    473             appsize -= 128; 
    474         } 
    475     } 
    476  
    477463// fixme 
    478464//     size_t len = 0x1000; 
     
    484470//     } 
    485471 
     472} 
     473void 
     474Device::EAP::showApplication() 
     475{ 
     476    printMessage("--- Application space ---\n"); 
     477    fb_quadlet_t* tmp = (fb_quadlet_t *)calloc(128, sizeof(fb_quadlet_t)); 
     478    unsigned int appsize = m_app_size; /// m_app_size is rather big. Start with the first four block of 128 quadlets... 
     479    unsigned int offset = 0; 
     480    while ( appsize > 0 ) { 
     481        if ( ! readRegBlock( eRT_Application, offset, tmp, ((appsize<128)?appsize:128)*sizeof(fb_quadlet_t) ) ) 
     482            appsize = 0; 
     483        else { 
     484            hexDumpQuadlets(tmp, 128); 
     485            offset += 128*sizeof(fb_quadlet_t); 
     486            appsize -= 128*sizeof(fb_quadlet_t); 
     487        } 
     488    } 
    486489} 
    487490 
  • trunk/libffado/tests/test-dice-eap.cpp

    r1630 r1717  
    6565const char *argp_program_version = "test-dice-eap 0.1"; 
    6666const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 
    67 static char doc[] = "test-avccmd -- test program to examine the DICE EAP code."; 
     67static char doc[] = "test-dice-eap -- test program to examine the DICE EAP code."; 
    6868static char args_doc[] = "NODE_ID"; 
    6969static struct argp_option options[] = { 
     
    7171    {"port",      'p', "PORT",      0,  "Set port" }, 
    7272    {"node",      'n', "NODE",      0,  "Set node" }, 
     73    {"application",'a',  NULL,      0,  "Show the application space"}, 
     74    {"counts",    'c', "COUNTS",    0,  "Number of runs to do. -1 means to run forever."}, 
    7375   { 0 } 
    7476}; 
     
    8284        , port( -1 ) 
    8385        , node( -1 ) 
     86        , application( false ) 
     87        , counts( -1 ) 
    8488        { 
    8589            args[0] = 0; 
     
    8892    char* args[MAX_ARGS]; 
    8993    int   nargs; 
    90     int  verbose; 
     94    int  verbose; 
    9195    bool  test; 
    9296    int   port; 
    9397    int   node; 
     98    bool  application; 
     99    int   counts; 
    94100} arguments; 
    95101 
     
    111117        arguments->test = true; 
    112118        break; 
     119    case 'a': 
     120        arguments->application = true; 
     121        break; 
    113122    case 'p': 
    114123        arguments->port = strtol(arg, &tail, 0); 
     
    120129    case 'n': 
    121130        arguments->node = strtol(arg, &tail, 0); 
     131        if (errno) { 
     132            perror("argument parsing failed:"); 
     133            return errno; 
     134        } 
     135        break; 
     136    case 'c': 
     137        arguments->counts = strtol(arg, &tail, 0); 
    122138        if (errno) { 
    123139            perror("argument parsing failed:"); 
     
    220236 
    221237    // now play 
    222     avDevice->setVerboseLevel(DEBUG_LEVEL_VERY_VERBOSE); 
     238    //avDevice->setVerboseLevel(DEBUG_LEVEL_VERY_VERBOSE); 
    223239 
    224240    bool supports_eap = Device::EAP::supportsEAP(*avDevice); 
     
    232248    Device::EAP &eap = *(avDevice->getEAP()); 
    233249 
    234     eap.show(); 
     250    if (arguments.application) 
     251        eap.showApplication(); 
     252    else 
     253        eap.show(); 
    235254    eap.lockControl(); 
    236255    Control::Element *e = eap.getElementByName("MatrixMixer"); 
     
    255274    int cnt = 0; 
    256275 
    257     while(run) { 
     276    while(run && arguments.counts != 0) { 
    258277        eap.lockControl(); 
    259278        Control::Element *e = eap.getElementByName("Router"); 
     
    295314        eap.unlockControl(); 
    296315        sleep(1); 
     316        arguments.counts--; 
    297317    } 
    298318