// **** INQUIRY ****
void TScsiClientInquiryResp::DecodeInquiry(const TDesC8& aPtr)
    {
	__MSFNSLOG
    iPeripheralInfo.iRemovable = (aPtr[1] & 0x80) ? ETrue : EFalse;

    iPeripheralInfo.iPeripheralQualifier = aPtr[0] >> 5;
    iPeripheralInfo.iPeripheralDeviceType = aPtr[0] & 0x1F;
    iPeripheralInfo.iVersion = aPtr[2];
    iPeripheralInfo.iResponseDataFormat = aPtr[3] & 0x0F;

    TPtrC8 vendorId(&aPtr[8], 8);
    iPeripheralInfo.iIdentification.iVendorId.Copy(vendorId);

    TPtrC8 productId(&aPtr[16], 16);
    iPeripheralInfo.iIdentification.iProductId.Copy(productId);

    TPtrC8 productRev(&aPtr[32], 4);
    iPeripheralInfo.iIdentification.iProductRev.Copy(productRev);
    }
Example #2
0
QString QSystemDeviceInfoLinuxCommonPrivate::manufacturer()
{
    QFile vendorId("/sys/devices/virtual/dmi/id/board_vendor");
    if (vendorId.open(QIODevice::ReadOnly)) {
        QTextStream cpuinfo(&vendorId);
        return cpuinfo.readLine().trimmed();
    } else {
        QFile file("/proc/cpuinfo");
        if (!file.open(QIODevice::ReadOnly)) {
            qDebug() << "Could not open /proc/cpuinfo";
        } else {
            QTextStream cpuinfo(&file);
            QString line = cpuinfo.readLine();
            while (!line.isNull()) {
                line = cpuinfo.readLine();
                if (line.contains("vendor_id"))
                    return line.split(": ").at(1).trimmed();
            }
        }
    }

    return QString();
}
//
// ----------------------------------------------------------------------------------
// CEventChannel::RunL()
// ----------------------------------------------------------------------------------
//  
void CEventChannel::RunL()
    {
    TBuf<16> location;
    location.Copy( iChannelInfo.iLocation );
    COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - %S" ), &location ) );
    
    switch( iChannelState )
        {
        case EChannelOpening:
            {
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - EChannelOpening" ) ) );
            TInt err( KErrNone );    
            if( iStatus.Int() == KErrNone )
                {
                COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() iChannelState = EChannelOpen" ) ) );
                iChannelState = EChannelOpen;
                
                // Find data channel
                CSensrvChannelFinder* channelFinder = CSensrvChannelFinder::NewLC();
                
                TBufC8<KSensrvLocationLength> location( _L8("First0") );
                TBufC8<KSensrvVendorIdLength> vendorId( _L8( "VendorFirst" ) );
                TSensrvChannelInfo channelInfo( 0, ESensrvContextTypeNotDefined, ESensrvQuantityNotdefined, 0, location, vendorId, 0, 0 );
                RSensrvChannelInfoList channelList(10);
                
                TRAP( err, channelFinder->FindChannelsL( channelList, channelInfo ) );
                
                if( !err && channelList.Count() > 0 )
                    {
                    iChannel = CSensrvChannel::NewL( channelList[ 0 ] );
                    TRAP( err, iChannel->OpenChannelL() );
                    }
                
                CleanupStack::PopAndDestroy( channelFinder );   
                channelList.Reset();                              
                }
            if( err || iStatus.Int() != KErrNone )
                {
                COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() iChannelState = EChannelIdle" ) ) );
                iChannelState = EChannelIdle;
                if( !err )
                    {
                    err = iStatus.Int();
                    }                
                }
                
            iSsyCallback->ChannelOpened( iChannelInfo.iChannelId, err, this, iPropertyProvider );
            break;
            }
        case EChannelClosing:
            {
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - EChannelClosing" ) ) );
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() iChannelState = EChannelIdle" ) ) );
            
            iChannelState = EChannelIdle;
            if( iChannel )
                {
                iChannel->CloseChannel();
                delete iChannel;
                iChannel = NULL;
                }
            iSsyCallback->ChannelClosed( iChannelInfo.iChannelId );
            break;
            }
        case EChannelOpen:
            {
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - EChannelOpen" ) ) );
            break;
            }
        case EChannelListening:
            {
           
            break;
            }
        case EChannelStopListening:
            {
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - EChannelStopListening" ) ) );
            
           
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() iChannelState = EChannelOpen" ) ) );
            iChannelState = EChannelOpen;
            break;
            }
        case EChannelBufferFilled:
        case EChannelForceBufferFilled:
            {
             
            
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() - EChannelForceBufferFilled" ) ) );
            iSsyCallback->BufferFilled( iChannelInfo.iChannelId, iCounter, iDataBuffer, iMaxDataCount );
            iCounter = 0;
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() iChannelState = EChannelListening" ) ) );
            iChannelState = EChannelListening;
            IssueRequest();
            break;
            }
        default:
            {
            COMPONENT_TRACE( ( _L( "EventSsyStub - CEventChannel::RunL() unknown channel state" ) ) );
            }
        }

            
    }
Example #4
0
QString USBDevice::vendorIdString() const
{
    return QString("0x%1").arg(vendorId(), 4, 16, QChar('0'));
}