Changeset 1717
- Timestamp:
- 11/16/09 14:37:28 (14 years ago)
- Files:
-
- trunk/libffado/src/dice/dice_eap.cpp (modified) (2 diffs)
- trunk/libffado/tests/test-dice-eap.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/dice/dice_eap.cpp
r1713 r1717 461 461 } 462 462 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 477 463 // fixme 478 464 // size_t len = 0x1000; … … 484 470 // } 485 471 472 } 473 void 474 Device::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 } 486 489 } 487 490 trunk/libffado/tests/test-dice-eap.cpp
r1630 r1717 65 65 const char *argp_program_version = "test-dice-eap 0.1"; 66 66 const char *argp_program_bug_address = "<ffado-devel@lists.sf.net>"; 67 static char doc[] = "test- avccmd-- test program to examine the DICE EAP code.";67 static char doc[] = "test-dice-eap -- test program to examine the DICE EAP code."; 68 68 static char args_doc[] = "NODE_ID"; 69 69 static struct argp_option options[] = { … … 71 71 {"port", 'p', "PORT", 0, "Set port" }, 72 72 {"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."}, 73 75 { 0 } 74 76 }; … … 82 84 , port( -1 ) 83 85 , node( -1 ) 86 , application( false ) 87 , counts( -1 ) 84 88 { 85 89 args[0] = 0; … … 88 92 char* args[MAX_ARGS]; 89 93 int nargs; 90 int verbose;94 int verbose; 91 95 bool test; 92 96 int port; 93 97 int node; 98 bool application; 99 int counts; 94 100 } arguments; 95 101 … … 111 117 arguments->test = true; 112 118 break; 119 case 'a': 120 arguments->application = true; 121 break; 113 122 case 'p': 114 123 arguments->port = strtol(arg, &tail, 0); … … 120 129 case 'n': 121 130 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); 122 138 if (errno) { 123 139 perror("argument parsing failed:"); … … 220 236 221 237 // now play 222 avDevice->setVerboseLevel(DEBUG_LEVEL_VERY_VERBOSE);238 //avDevice->setVerboseLevel(DEBUG_LEVEL_VERY_VERBOSE); 223 239 224 240 bool supports_eap = Device::EAP::supportsEAP(*avDevice); … … 232 248 Device::EAP &eap = *(avDevice->getEAP()); 233 249 234 eap.show(); 250 if (arguments.application) 251 eap.showApplication(); 252 else 253 eap.show(); 235 254 eap.lockControl(); 236 255 Control::Element *e = eap.getElementByName("MatrixMixer"); … … 255 274 int cnt = 0; 256 275 257 while(run ) {276 while(run && arguments.counts != 0) { 258 277 eap.lockControl(); 259 278 Control::Element *e = eap.getElementByName("Router"); … … 295 314 eap.unlockControl(); 296 315 sleep(1); 316 arguments.counts--; 297 317 } 298 318