comparison host/tools/ecostest/common/ResetAttributes.cpp @ 84:489eb5632bc3 ecos-sw-2000-04-28

Merge from eCos master repository on 2000-04-28-18:44:39-BST
author jlarmour
date Fri, 28 Apr 2000 18:18:36 +0000
parents 6736c52df507
children
comparison
equal deleted inserted replaced
83:1094d5fdd3e0 84:489eb5632bc3
338 // 0. Port 338 // 0. Port
339 // 1. Baud 339 // 1. Baud
340 // 2. Read timeout 340 // 2. Read timeout
341 StringArray ar; 341 StringArray ar;
342 int nArgs=strArg.Chop(ar,ARGSEP,true); 342 int nArgs=strArg.Chop(ar,ARGSEP,true);
343 if(nArgs>0 && ar[0].size()){ 343 if(nArgs>0){
344 m_strAuxPort=ar[0]; 344 m_strAuxPort=ar[0];
345 } 345 }
346 if(nArgs>1 && ar[1].size()){ 346 if(nArgs>1){
347 m_nBaud=_ttoi(ar[1]); 347 m_nBaud=_ttoi(ar[1]);
348 } 348 }
349 if(nArgs>2 && ar[2].size()){ 349 if(nArgs>2){
350 m_nReadTimeout=_ttoi(ar[2]); 350 m_nReadTimeout=_ttoi(ar[2]);
351 } 351 }
352 } else if (_T("off")==strID || _T("on")==strID || _T("on_off")==strID || _T("off_on")==strID) { 352 } else if (_T("off")==strID || _T("on")==strID || _T("on_off")==strID || _T("off_on")==strID) {
353 // Action information. e.g. off(ginga:500,A4,com1,38400,10000,1000) 353 // Action information. e.g. off(ginga:500,A4,com1,38400,10000,1000)
354 // Specifically args are: 354 // Specifically args are:
358 // 3. Baud 358 // 3. Baud
359 // 4. Read timeout 359 // 4. Read timeout
360 // 5. Delay 360 // 5. Delay
361 StringArray ar; 361 StringArray ar;
362 int nArgs=strArg.Chop(ar,ARGSEP,true); 362 int nArgs=strArg.Chop(ar,ARGSEP,true);
363 if(nArgs>0 && ar[0].size()){ 363 if(nArgs>0){
364 m_strHostPort=ar[0]; 364 m_strHostPort=ar[0];
365 } 365 }
366 if(nArgs>1 && ar[1].size()){ 366 if(nArgs>1){
367 m_strControl=ar[1]; 367 m_strControl=ar[1];
368 } 368 }
369 if(nArgs>2 && ar[2].size()){ 369 if(nArgs>2){
370 m_strAuxPort=ar[2]; 370 m_strAuxPort=ar[2];
371 } 371 }
372 if(nArgs>3 && ar[3].size()){ 372 if(nArgs>3){
373 m_nBaud=_ttoi(ar[3]); 373 m_nBaud=_ttoi(ar[3]);
374 } 374 }
375 if(nArgs>4 && ar[4].size()){ 375 if(nArgs>4){
376 m_nReadTimeout=_ttoi(ar[4]); 376 m_nReadTimeout=_ttoi(ar[4]);
377 } 377 }
378 if(nArgs>5 && ar[5].size()){ 378 if(nArgs>5){
379 m_nDelay=_ttoi(ar[5]); 379 m_nDelay=_ttoi(ar[5]);
380 } 380 }
381 381
382 if(0==m_strHostPort.size()){ 382 if(0==m_strHostPort.size()){
383 ResetLog(_T("Failed to specify reset host:port")); 383 ResetLog(_T("Failed to specify reset host:port"));