Changeset 100

Show
Ignore:
Timestamp:
05/16/05 09:15:28 (19 years ago)
Author:
wagi
Message:

- all feature implemented (get and set of frequency)

Files:

Legend:

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

    r98 r100  
    2222#include <libraw1394/raw1394.h> 
    2323 
     24#include <argp.h> 
    2425#include <stdio.h> 
    2526#include <string.h> 
     
    3132#include <iostream> 
    3233#include <iomanip> 
     34#include <iterator> 
    3335 
    3436using namespace std; 
     
    140142}; 
    141143 
     144ostream& operator<<( ostream& stream, ESamplingFrequency freq ) 
     145{ 
     146    char* str; 
     147    switch ( freq ) { 
     148    case eSF_22050Hz: 
     149        str = "22050"; 
     150        break; 
     151    case eSF_24000Hz: 
     152        str = "24000"; 
     153        break; 
     154    case eSF_32000Hz: 
     155        str = "32000"; 
     156        break; 
     157    case eSF_44100Hz: 
     158        str = "44100"; 
     159        break; 
     160    case eSF_48000Hz: 
     161        str = "48000"; 
     162        break; 
     163    case eSF_88200Hz: 
     164        str = "88200"; 
     165        break; 
     166    case eSF_96000Hz: 
     167        str = "96000"; 
     168        break; 
     169    case eSF_176400Hz: 
     170        str = "176400"; 
     171        break; 
     172    case eSF_192000Hz: 
     173        str = "192000"; 
     174        break; 
     175    case eSF_DontCare: 
     176    default: 
     177        str = "unknown"; 
     178    } 
     179    return stream << str; 
     180}; 
     181 
    142182enum ERateControl { 
    143183    eRC_Supported = 0x00, 
    144184    eRC_DontCare  = 0x01, 
    145185}; 
     186 
     187 
     188//////////////////////////////////////////////// 
     189// arg parsing 
     190//////////////////////////////////////////////// 
     191const char *argp_program_version = "stream_format 0.1"; 
     192const char *argp_program_bug_address = "<freebob-devel@lists.sf.net>"; 
     193static char doc[] = "stream_format -- get/set test program for FreeBob"; 
     194static char args_doc[] = "NODE_ID PLUG_ID"; 
     195static struct argp_option options[] = { 
     196    {"verbose",   'v', 0,           0,            "Produce verbose output" }, 
     197    {"test",      't', 0,           0,            "Do tests instead get/set action" }, 
     198    {"frequency", 'f', "FREQUENCY", 0,  "Set frequency" }, 
     199    { 0 } 
     200}; 
     201 
     202struct arguments 
     203{ 
     204    arguments() 
     205        : verbose( false ) 
     206        , test( false ) 
     207        , frequency( 0 ) 
     208        { 
     209            args[0] = 0; 
     210            args[1] = 0; 
     211        } 
     212 
     213    char* args[2]; 
     214    bool  verbose; 
     215    bool  test; 
     216    int   frequency; 
     217} arguments; 
     218 
     219// Parse a single option. 
     220static error_t 
     221parse_opt( int key, char* arg, struct argp_state* state ) 
     222{ 
     223    // Get the input argument from `argp_parse', which we 
     224    // know is a pointer to our arguments structure. 
     225    struct arguments* arguments = ( struct arguments* ) state->input; 
     226 
     227    char* tail; 
     228    switch (key) { 
     229    case 'v': 
     230        arguments->verbose = true; 
     231        break; 
     232    case 't': 
     233        arguments->test = true; 
     234        break; 
     235    case 'f': 
     236        errno = 0; 
     237        arguments->frequency = strtol(arg, &tail, 0); 
     238        if (errno) { 
     239            perror("argument parsing failed:"); 
     240            return errno; 
     241        } 
     242    case ARGP_KEY_ARG: 
     243        if (state->arg_num >= 2) { 
     244            // Too many arguments. 
     245            argp_usage (state); 
     246        } 
     247        arguments->args[state->arg_num] = arg; 
     248        break; 
     249    case ARGP_KEY_END: 
     250        if (state->arg_num < 2) { 
     251            // Not enough arguments. 
     252            argp_usage (state); 
     253        } 
     254        break; 
     255    default: 
     256        return ARGP_ERR_UNKNOWN; 
     257    } 
     258    return 0; 
     259} 
     260 
     261static struct argp argp = { options, parse_opt, args_doc, doc }; 
     262 
     263//////////////////////////////////////////////// 
    146264 
    147265 
     
    539657 
    540658    number_of_channels_t m_numberOfChannels; 
    541     stream_format_t m_streamFormat; 
     659    stream_format_t      m_streamFormat; 
    542660}; 
    543661 
     
    591709    virtual FormatInformationStreamsSync* clone() const; 
    592710 
    593  
    594     reserved_t m_reserved0; 
     711    reserved_t           m_reserved0; 
    595712    sampling_frequency_t m_samplingFrequency; 
    596     rate_control_t m_rateControl; 
    597     reserved_t m_reserved1; 
     713    rate_control_t       m_rateControl; 
     714    reserved_t           m_reserved1; 
    598715}; 
    599716 
     
    656773    virtual FormatInformationStreamsCompound* clone() const; 
    657774 
    658     sampling_frequency_t m_samplingFrequency; 
    659     rate_control_t m_rateControl; 
    660     number_of_stream_format_infos_t m_numberOfStreamFormatInfos; 
     775    sampling_frequency_t                     m_samplingFrequency; 
     776    rate_control_t                           m_rateControl; 
     777    number_of_stream_format_infos_t          m_numberOfStreamFormatInfos; 
     778 
    661779    typedef std::vector< StreamFormatInfo* > StreamFormatInfoVector; 
    662     StreamFormatInfoVector m_streamFormatInfos; 
     780    StreamFormatInfoVector                   m_streamFormatInfos; 
    663781}; 
    664782 
     
    835953 
    836954            if (m_level2 == eFHL2_AM824_SYNC_STREAM ) { 
    837                 printf( "+-------------------+\n" ); 
    838                 printf( "|  sync stream      |\n" ); 
    839                 printf( "+-------------------+\n" ); 
     955                if ( arguments.verbose ) { 
     956                    printf( "+-------------------+\n" ); 
     957                    printf( "|  sync stream      |\n" ); 
     958                    printf( "+-------------------+\n" ); 
     959                } 
    840960                m_streams = new FormatInformationStreamsSync(); 
    841961                result = m_streams->deserialize( de ); 
     
    848968        case  eFHL1_AUDIOMUSIC_AM824_COMPOUND: 
    849969        { 
    850             printf( "+-------------------+\n" ); 
    851             printf( "|  compound stream  |\n" ); 
    852             printf( "+-------------------+\n" ); 
     970            if ( arguments.verbose ) { 
     971                printf( "+-------------------+\n" ); 
     972                printf( "|  compound stream  |\n" ); 
     973                printf( "+-------------------+\n" ); 
     974            } 
    853975            m_streams = new FormatInformationStreamsCompound(); 
    854976            result = m_streams->deserialize( de ); 
     
    9811103        eS_NotUsed        = AVC1394_EXTENDED_STREAM_FORMAT_INFO_STATUS_NOT_USED, 
    9821104    }; 
    983  
    984     ExtendedStreamFormatCmd( ESubFunction eSubFunction ); 
     1105    typedef byte_t status_t; 
     1106    typedef byte_t index_in_stream_format_t; 
     1107 
     1108    ExtendedStreamFormatCmd( ESubFunction eSubFunction = eSF_ExtendedStreamFormatInformationCommand ); 
    9851109    virtual ~ExtendedStreamFormatCmd(); 
    9861110 
    9871111    bool setPlugAddress( const PlugAddress& plugAddress ); 
    9881112    bool setIndexInStreamFormat( const int index ); 
     1113    bool setSubFunction( ESubFunction subFunction ); 
    9891114 
    9901115    virtual bool serialize( IOSSerialize& se ); 
     
    9951120                       unsigned int node_id ); 
    9961121 
     1122    inline status_t getStatus(); 
     1123    FormatInformation* getFormatInformation(); 
     1124    inline index_in_stream_format_t getIndex(); 
     1125 
    9971126protected: 
    998     typedef byte_t index_in_stream_format_t; 
    999     typedef byte_t status_t; 
    1000  
    10011127    opcode_t m_opcode; 
    10021128    subfunction_t m_subFunction; 
     
    11051231    } 
    11061232 
    1107     // debug output 
    1108     puts("request:"); 
    1109     for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) { 
    1110           printf("  %2d: 0x%08x\n", i, req.quadlet[i]); 
     1233    if ( arguments.verbose ) { 
     1234        // debug output 
     1235        puts("request:"); 
     1236        for (int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i) { 
     1237            printf("  %2d: 0x%08x\n", i, req.quadlet[i]); 
     1238        } 
    11111239    } 
    11121240 
    11131241    resp = reinterpret_cast<packet_t*> ( avc1394_transaction_block( handle, node_id, req.quadlet, STREAM_FORMAT_REQUEST_SIZE,  1 ) ); 
    11141242    if ( resp ) { 
    1115         // debug output 
    1116         puts("response:"); 
    1117         for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) { 
    1118             printf( "  %2d: 0x%08x\n", i, resp->quadlet[i] ); 
    1119         } 
     1243        if ( arguments.verbose ) { 
     1244            // debug output 
     1245            puts("response:"); 
     1246            for ( int i = 0; i < STREAM_FORMAT_REQUEST_SIZE; ++i ) { 
     1247                printf( "  %2d: 0x%08x\n", i, resp->quadlet[i] ); 
     1248            } 
     1249        } 
    11201250 
    11211251        // reorder the bytes to the correct layout 
     
    11241254        } 
    11251255 
    1126         // a more detailed debug output 
    1127         printf( "\n" ); 
    1128         printf( " idx type                       value\n" ); 
    1129         printf( "-------------------------------------\n" ); 
    1130         printf( "  %02d                     ctype: 0x%02x\n", 0, resp->byte[0] ); 
    1131         printf( "  %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] ); 
    1132         printf( "  %02d                    opcode: 0x%02x\n", 2, resp->byte[2] ); 
    1133  
    1134         for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) { 
    1135             printf( "  %02d                operand %2d: 0x%02x\n", i, i-3, resp->byte[i] ); 
     1256        if ( arguments.verbose ) { 
     1257            // a more detailed debug output 
     1258            printf( "\n" ); 
     1259            printf( " idx type                       value\n" ); 
     1260            printf( "-------------------------------------\n" ); 
     1261            printf( "  %02d                     ctype: 0x%02x\n", 0, resp->byte[0] ); 
     1262            printf( "  %02d subunit_type + subunit_id: 0x%02x\n", 1, resp->byte[1] ); 
     1263            printf( "  %02d                    opcode: 0x%02x\n", 2, resp->byte[2] ); 
     1264 
     1265            for ( int i = 3; i < STREAM_FORMAT_REQUEST_SIZE * 4; ++i ) { 
     1266                printf( "  %02d                operand %2d: 0x%02x\n", i, i-3, resp->byte[i] ); 
     1267            } 
    11361268        } 
    11371269 
     
    11491281            case eR_Rejected: 
    11501282                if ( m_subFunction == eSF_ExtendedStreamFormatInformationCommandList ) { 
    1151                     printf( "no futher stream formats defined\n" ); 
     1283                    if ( arguments.verbose ) { 
     1284                        printf( "no futher stream formats defined\n" ); 
     1285                    } 
    11521286                    result = true; 
    11531287                } else { 
     
    11651299} 
    11661300 
     1301status_t 
     1302ExtendedStreamFormatCmd::getStatus() 
     1303{ 
     1304    return m_status; 
     1305} 
     1306 
     1307FormatInformation* 
     1308ExtendedStreamFormatCmd::getFormatInformation() 
     1309{ 
     1310    return m_formatInformation; 
     1311} 
     1312 
     1313ExtendedStreamFormatCmd::index_in_stream_format_t 
     1314ExtendedStreamFormatCmd::getIndex() 
     1315{ 
     1316    return m_indexInStreamFormat; 
     1317} 
     1318 
     1319bool 
     1320ExtendedStreamFormatCmd::setSubFunction( ESubFunction subFunction ) 
     1321{ 
     1322    m_subFunction = subFunction; 
     1323    return true; 
     1324} 
    11671325 
    11681326//////////////////////////////////////// 
     
    11701328//////////////////////////////////////// 
    11711329void 
    1172 doTests(raw1394handle_t handle, int node_id, int plug_id) 
     1330doTest(raw1394handle_t handle, int node_id, int plug_id) 
    11731331{ 
    11741332 
     
    11891347    extendedStreamFormatCmd.fire( AVCCommand::eCT_Status, handle, node_id ); 
    11901348 
    1191     ExtendedStreamFormatCmd extendedStreamFormatCmdS = ExtendedStreamFormatCmd( ExtendedStreamFormatCmd::eSF_ExtendedStreamFormatInformationCommand ); 
     1349    ExtendedStreamFormatCmd extendedStreamFormatCmdS = ExtendedStreamFormatCmd(); 
    11921350    extendedStreamFormatCmdS.setPlugAddress( PlugAddress( PlugAddress::eM_Subunit, 
    11931351                                                          PlugAddress::ePD_Input, 
     
    12011359} 
    12021360 
     1361//////////////////////////////////////// 
     1362// Main application 
     1363//////////////////////////////////////// 
     1364struct FormatInfo { 
     1365    FormatInfo() 
     1366        : m_freq( eSF_DontCare ) 
     1367        , m_format( 0 ) 
     1368        , m_audioChannels( 0 ) 
     1369        , m_midiChannels( 0 ) 
     1370        , m_index( 0 ) 
     1371        {} 
     1372 
     1373    ESamplingFrequency m_freq; 
     1374    int                m_format; // 0 = compound, 1 = sync 
     1375    int                m_audioChannels; 
     1376    int                m_midiChannels; 
     1377    int                m_index; 
     1378}; 
     1379typedef vector< struct FormatInfo > FormatInfoVector; 
     1380 
     1381ostream& operator<<( ostream& stream, FormatInfo info ) 
     1382{ 
     1383    stream << info.m_freq << " Hz ("; 
     1384    if ( info.m_format ) { 
     1385            stream << "sync "; 
     1386    } else { 
     1387        stream << "compound "; 
     1388    } 
     1389    stream << "stream, "; 
     1390    stream << "audio channels: " << info.m_audioChannels 
     1391           << ", midi channels: " << info.m_midiChannels << ")"; 
     1392    return stream; 
     1393} 
     1394 
     1395 
     1396FormatInfo 
     1397createFormatInfo( ExtendedStreamFormatCmd& cmd ) 
     1398{ 
     1399    FormatInfo fi; 
     1400 
     1401    FormatInformationStreamsSync* syncStream 
     1402        = dynamic_cast< FormatInformationStreamsSync* > ( cmd.getFormatInformation()->m_streams ); 
     1403    if ( syncStream ) { 
     1404        fi.m_freq = static_cast<ESamplingFrequency>( syncStream->m_samplingFrequency ); 
     1405        fi.m_format = 1; 
     1406    } 
     1407 
     1408    FormatInformationStreamsCompound* compoundStream 
     1409        = dynamic_cast< FormatInformationStreamsCompound* > ( cmd.getFormatInformation()->m_streams ); 
     1410    if ( compoundStream ) { 
     1411        fi.m_freq = static_cast<ESamplingFrequency>( compoundStream->m_samplingFrequency ); 
     1412        fi.m_format = 0; 
     1413        for ( int j = 0; j < compoundStream->m_numberOfStreamFormatInfos; ++j ) 
     1414        { 
     1415            switch ( compoundStream->m_streamFormatInfos[j]->m_streamFormat ) { 
     1416            case AVC1394_STREAM_FORMAT_AM824_MULTI_BIT_LINEAR_AUDIO_RAW: 
     1417                fi.m_audioChannels += compoundStream->m_streamFormatInfos[j]->m_numberOfChannels; 
     1418                break; 
     1419            case AVC1394_STREAM_FORMAT_AM824_MIDI_CONFORMANT: 
     1420                fi.m_midiChannels += compoundStream->m_streamFormatInfos[j]->m_numberOfChannels; 
     1421                break; 
     1422            default: 
     1423                cout << "addStreamFormat: unknown stream format for channel" << endl; 
     1424            } 
     1425        } 
     1426    } 
     1427    fi.m_index = cmd.getIndex(); 
     1428    return fi; 
     1429} 
     1430 
     1431 
     1432bool 
     1433doApp(raw1394handle_t handle, int node_id, int plug_id, ESamplingFrequency frequency = eSF_DontCare) 
     1434{ 
     1435    ExtendedStreamFormatCmd extendedStreamFormatCmd = ExtendedStreamFormatCmd( ExtendedStreamFormatCmd::eSF_ExtendedStreamFormatInformationCommandList ); 
     1436    UnitPlugAddress unitPlugAddress( 0x00,  plug_id ); 
     1437    extendedStreamFormatCmd.setPlugAddress( PlugAddress( PlugAddress::eM_Subunit, 
     1438                                                         PlugAddress::ePD_Input, 
     1439                                                         unitPlugAddress ) ); 
     1440 
     1441    int i = 0; 
     1442    FormatInfoVector supportedFormatInfos; 
     1443    bool cmdSuccess = false; 
     1444 
     1445    do { 
     1446        extendedStreamFormatCmd.setIndexInStreamFormat( i ); 
     1447        cmdSuccess = extendedStreamFormatCmd.fire( AVCCommand::eCT_Status, handle,  node_id ); 
     1448        if ( cmdSuccess 
     1449             && ( extendedStreamFormatCmd.getResponse() == AVCCommand::eR_Implemented ) ) 
     1450        { 
     1451            supportedFormatInfos.push_back( createFormatInfo( extendedStreamFormatCmd ) ); 
     1452        } 
     1453        ++i; 
     1454    } while ( cmdSuccess && ( extendedStreamFormatCmd.getResponse() ==  ExtendedStreamFormatCmd::eR_Implemented ) ); 
     1455 
     1456    if ( !cmdSuccess ) { 
     1457        cerr << "Failed to retrieve format infos" << endl; 
     1458        return false; 
     1459    } 
     1460 
     1461    cout << "Supported frequencies:" << endl; 
     1462    for ( FormatInfoVector::iterator it = supportedFormatInfos.begin(); 
     1463          it != supportedFormatInfos.end(); 
     1464          ++it ) 
     1465    { 
     1466        cout << "  " << *it << endl; 
     1467    } 
     1468 
     1469    if ( frequency != eSF_DontCare ) { 
     1470        cout << "Trying to set frequency (" << frequency << "): " << endl; 
     1471 
     1472        FormatInfoVector::iterator it; 
     1473        for ( it = supportedFormatInfos.begin(); 
     1474              it != supportedFormatInfos.end(); 
     1475              ++it ) 
     1476        { 
     1477            if ( it->m_freq == frequency ) { 
     1478                cout << "  - frequency " << frequency << " is supported" << endl; 
     1479 
     1480                ExtendedStreamFormatCmd setFormatCmd = ExtendedStreamFormatCmd( ExtendedStreamFormatCmd::eSF_ExtendedStreamFormatInformationCommandList ); 
     1481                setFormatCmd.setPlugAddress( PlugAddress( PlugAddress::eM_Subunit, 
     1482                                                          PlugAddress::ePD_Input, 
     1483                                                          unitPlugAddress ) ); 
     1484 
     1485                setFormatCmd.setIndexInStreamFormat( it->m_index ); 
     1486                if ( !setFormatCmd.fire( AVCCommand::eCT_Status, handle,  node_id ) ) { 
     1487                    cout << "  - failed to retrieve format for index " << it->m_index << endl; 
     1488                    return false; 
     1489                } 
     1490 
     1491                cout << "  - " << createFormatInfo( setFormatCmd ) << endl; 
     1492 
     1493                setFormatCmd.setSubFunction( ExtendedStreamFormatCmd::eSF_ExtendedStreamFormatInformationCommand ); 
     1494                if ( !setFormatCmd.fire( AVCCommand::eCT_Control,  handle,  node_id ) ) { 
     1495                    cout << "  - failed to set new format" << endl; 
     1496                    return false; 
     1497                } 
     1498                cout << "  - configuration operation succedded" << endl; 
     1499                break; 
     1500            } 
     1501        } 
     1502        if ( it == supportedFormatInfos.end() ) { 
     1503            cout << "  - frequency not supported by device. Operation failed" << endl; 
     1504        } 
     1505    } 
     1506 
     1507    ExtendedStreamFormatCmd currentFormat = ExtendedStreamFormatCmd(); 
     1508    currentFormat.setPlugAddress( PlugAddress( PlugAddress::eM_Subunit, 
     1509                                               PlugAddress::ePD_Input, 
     1510                                               unitPlugAddress ) ); 
     1511 
     1512    if ( currentFormat.fire( AVCCommand::eCT_Status, handle, node_id ) ) { 
     1513        cout << "Configured frequency: " << createFormatInfo( currentFormat ) << endl; 
     1514    } 
     1515 
     1516    return true; 
     1517} 
     1518 
    12031519/////////////////////////////////////////////////////////////// 
     1520ESamplingFrequency 
     1521parseFrequencyString( int frequency ) 
     1522{ 
     1523    ESamplingFrequency efreq; 
     1524    switch ( frequency ) { 
     1525    case 22050: 
     1526        efreq = eSF_22050Hz; 
     1527        break; 
     1528    case 24000: 
     1529        efreq = eSF_24000Hz; 
     1530        break; 
     1531    case 32000: 
     1532        efreq = eSF_32000Hz; 
     1533        break; 
     1534    case 44100: 
     1535        efreq = eSF_44100Hz; 
     1536        break; 
     1537    case 48000: 
     1538        efreq = eSF_48000Hz; 
     1539        break; 
     1540    case 88200: 
     1541        efreq = eSF_88200Hz; 
     1542        break; 
     1543    case 96000: 
     1544        efreq = eSF_96000Hz; 
     1545        break; 
     1546    case 176400: 
     1547        efreq = eSF_176400Hz; 
     1548        break; 
     1549    case 192000: 
     1550        efreq = eSF_192000Hz; 
     1551        break; 
     1552    default: 
     1553        efreq = eSF_DontCare; 
     1554    } 
     1555 
     1556    return efreq; 
     1557} 
    12041558 
    12051559int 
    12061560main(int argc, char **argv) 
    12071561{ 
    1208     if (argc < 3) { 
    1209         printf("usage: %s <NODE_ID> <PLUG_ID>\n", argv[0]); 
    1210         return 0; 
    1211     } 
     1562    // arg parsing 
     1563    argp_parse (&argp, argc, argv, 0, 0, &arguments); 
    12121564 
    12131565    errno = 0; 
    12141566    char* tail; 
    1215     int node_id = strtol(argv[1], &tail, 0); 
     1567    int node_id = strtol(arguments.args[0], &tail, 0); 
    12161568    if (errno) { 
    12171569        perror("argument parsing failed:"); 
    12181570        return -1; 
    12191571    } 
    1220     int plug_id = strtol(argv[2], &tail, 0); 
     1572    int plug_id = strtol(arguments.args[1], &tail, 0); 
    12211573    if (errno) { 
    12221574        perror("argument parsing failed:"); 
     
    12241576    } 
    12251577 
     1578    // create raw1394handle 
    12261579    raw1394handle_t handle; 
    12271580    handle = raw1394_new_handle (); 
     
    12421595    } 
    12431596 
    1244     doTests( handle, node_id,  plug_id ); 
     1597    if ( arguments.test ) { 
     1598        doTest( handle, node_id,  plug_id ); 
     1599    } else { 
     1600        ESamplingFrequency efreq = parseFrequencyString( arguments.frequency ); 
     1601        doApp( handle, node_id, plug_id, efreq ); 
     1602    } 
     1603 
    12451604    raw1394_destroy_handle( handle ); 
    12461605 
    12471606    return 0; 
    12481607} 
    1249  
    1250 /* random stuff which might be still useful 
    1251  
    1252             #define AVC_CMD_HEADER_SIZE 3 
    1253             #define EXTENDED_STREAM_FORMAT_OPERAND_POS_STATUS 6 
    1254             switch ( resp->byte[AVC_CMD_HEADER_SIZE + EXTENDED_STREAM_FORMAT_OPERAND_POS_STATUS] ) { 
    1255             case eS_Active: 
    1256                 printf( "format is set and a signal is streaming through or to the plug\n" ); 
    1257                 break; 
    1258             case eS_Inactive: 
    1259                 printf( "format is set but no signal is stremaing through the plug\n" ); 
    1260                 break; 
    1261             case eS_NoStreamFormat: 
    1262                 printf( "there is no stream format set, plug has no streaming capabilities\n" ); 
    1263                 break; 
    1264             case eS_NotUsed: 
    1265                 printf( "not used: used for specific inquiry response\n" ); 
    1266                 break; 
    1267             default: 
    1268                 printf( "unknown status\n" ); 
    1269             } 
    1270  
    1271 */