Changeset 102

Show
Ignore:
Timestamp:
05/16/05 11:38:47 (19 years ago)
Author:
pieterpalmers
Message:

- added command line option to specify the used firewire port.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freebob/tests/stream_format.cpp

    r100 r102  
    197197    {"test",      't', 0,           0,            "Do tests instead get/set action" }, 
    198198    {"frequency", 'f', "FREQUENCY", 0,  "Set frequency" }, 
    199     { 0 } 
     199    {"port",      'p', "PORT",      0,  "Set port" }, 
     200   { 0 } 
    200201}; 
    201202 
     
    206207        , test( false ) 
    207208        , frequency( 0 ) 
     209        , port( 0 ) 
    208210        { 
    209211            args[0] = 0; 
     
    215217    bool  test; 
    216218    int   frequency; 
     219    int   port; 
    217220} arguments; 
    218221 
     
    236239        errno = 0; 
    237240        arguments->frequency = strtol(arg, &tail, 0); 
     241        if (errno) { 
     242            perror("argument parsing failed:"); 
     243            return errno; 
     244        } 
     245    case 'p': 
     246        errno = 0; 
     247        arguments->port = strtol(arg, &tail, 0); 
    238248        if (errno) { 
    239249            perror("argument parsing failed:"); 
     
    15891599    } 
    15901600 
    1591     if (raw1394_set_port(handle, 0) < 0) { 
     1601    if (raw1394_set_port(handle, arguments.port) < 0) { 
    15921602        fprintf(stderr, "Could not set port"); 
    15931603        raw1394_destroy_handle (handle);