void SymbianIDeviceConfigurationWidget::updateDeviceInfo()
{
    setDeviceInfoLabel(tr("Connecting"));
    if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaSerialConnection) {
        const SymbianUtils::SymbianDevice commDev = currentRawDevice();
        m_codaInfoDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(commDev.portName());
        if (m_codaInfoDevice.isNull()) {
            setDeviceInfoLabel(tr("Unable to create CODA connection. Please try again."), true);
            return;
        }
        if (!m_codaInfoDevice->device()->isOpen()) {
            setDeviceInfoLabel(m_codaInfoDevice->device()->errorString(), true);
            return;
        }
        //TODO error handling - for now just throw the command at coda
        m_codaInfoDevice->sendSymbianOsDataGetQtVersionCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getQtVersionCommandResult));
        m_deviceInfoButton->setEnabled(false);
        m_codaTimeout->start(1000);
    } else if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection) {
        // collectingInfoFinished, which deletes m_codaDevice, can get called from within a coda callback, so need to use deleteLater
        m_codaInfoDevice =  QSharedPointer<Coda::CodaDevice>(new Coda::CodaDevice, &QObject::deleteLater);
        connect(m_codaInfoDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(codaEvent(Coda::CodaEvent)));

        const QSharedPointer<QTcpSocket> codaSocket(new QTcpSocket);
        m_codaInfoDevice->setDevice(codaSocket);
        codaSocket->connectToHost(symbianDevice()->address(),
                                  symbianDevice()->port().toInt());
        m_deviceInfoButton->setEnabled(false);
        m_codaTimeout->start(1500);
    } else
        setDeviceInfoLabel(tr("Currently there is no information about the device for this connection type."), true);
}
void SymbianIDeviceConfigurationWidget::cleanWlanAddress()
{
    if (!symbianDevice()->address().isEmpty())
        symbianDevice()->setAddress(QString());

    if (!symbianDevice()->port().isEmpty())
        symbianDevice()->setPort(QString());
}
void SymbianIDeviceConfigurationWidget::updateWlanAddress(const QString &address)
{
    QStringList addressList = address.split(QLatin1String(":"), QString::SkipEmptyParts);
    if (addressList.count() > 0) {
        symbianDevice()->setAddress(addressList.at(0));
        if (addressList.count() > 1)
            symbianDevice()->setPort(addressList.at(1));
        else
            symbianDevice()->setPort(QString());
    }
}
void SymbianIDeviceConfigurationWidget::updateCommunicationChannel()
{
    if (!m_wlanRadioButton->isChecked() && !m_serialRadioButton->isChecked())
        m_serialRadioButton->setChecked(true);

    if (m_wlanRadioButton->isChecked()) {
        m_ipAddress->setDisabled(false);
        m_serialPortsCombo->setDisabled(true);
        symbianDevice()->setCommunicationChannel(SymbianIDevice::CommunicationCodaTcpConnection);
        m_deviceInfoButton->setEnabled(true);
    } else {
        m_ipAddress->setDisabled(true);
        m_serialPortsCombo->setDisabled(false);
        symbianDevice()->setCommunicationChannel(SymbianIDevice::CommunicationCodaSerialConnection);
        updateSerialDevices();
    }
}
/**
Reconfigure from remote headset with valid configuration
*/
TVerdict CTestStep_MMF_A2DPBLUETOOTH_U_0231::DoTestStepL( void )
	{
	TVerdict verdict = EPass;
	TRequestStatus* status = &(iAsyncTestStepNotifier->RequestStatus());
	TAvdtpMediaTransportCapabilities* mediaTransportCaps = NULL;
	TSBCCodecCapabilities* SBCCodecCaps = NULL;
	
	iA2dpBTHeadsetAudioInterface->OpenDevice(*status);
	iAsyncTestStepNotifier->HandleAsyncRequest();
	if (iError != KErrNone)
		{
		INFO_PRINTF2(_L("Open error %d" ), iError);
		verdict = EInconclusive;
		}
	else
		{
		//now try to perform a valid reconfiguration
		MGavdpUser* gavdpUser = iA2dpBTHeadsetAudioInterface->TEST_MGavdpUser();
		//these TSEIDs should come from the iA2dpBTHeadsetAudioInterface
		//but this would need another TEST function to get them
		//the SEIDs below work ok on CSR and blueant but mght not work 
		//on all headsets
		TSEID symbianDevice(1,ETrue);
		TSEID headset(2,EFalse);
		iError = gavdpUser->GAVDP_SuspendIndication(symbianDevice);
		iTimer->StopAfter(TTimeIntervalMicroSeconds32(KTimeForEventsToRegister));//try 500mS
		CActiveScheduler::Current()->Start();
		if (iError != KErrNone)
			{
			INFO_PRINTF2(_L("error %d" ), iError);
			verdict = EFail;
			}
		else
			{
			//now send a valid configuration
			gavdpUser->GAVDP_ConfigurationStartIndication(symbianDevice, headset);
			iTimer->StopAfter(TTimeIntervalMicroSeconds32(KTimeForEventsToRegister));//try 500mS
			CActiveScheduler::Current()->Start();
			if (iError != KErrNone)
				{
				INFO_PRINTF2(_L("error on GAVDP_ConfigurationStartIndication %d" ), iError);
				verdict = EFail;
				}
			
			mediaTransportCaps = new TAvdtpMediaTransportCapabilities();
			iError = gavdpUser->GAVDP_ConfigurationIndication(mediaTransportCaps);
			if (iError != KErrNone)
				{
				INFO_PRINTF1(_L("error on valid transport config "));
				verdict = EFail;
				}
			SBCCodecCaps = new TSBCCodecCapabilities();
			SBCCodecCaps->SetSamplingFrequencies(E32kHz);
			SBCCodecCaps->SetChannelModes(EMono);
			SBCCodecCaps->SetBlockLengths(EBlockLenEight);
			SBCCodecCaps->SetSubbands(EEightSubbands);
			SBCCodecCaps->SetAllocationMethods(ELoudness);
			SBCCodecCaps->SetMinBitpoolValue(30);
			SBCCodecCaps->SetMaxBitpoolValue(44);
			iError = gavdpUser->GAVDP_ConfigurationIndication(SBCCodecCaps);
			if (iError != KErrNone)
				{
				INFO_PRINTF2(_L("error on codec GAVDP_ConfigurationIndication %d" ), iError);
				verdict = EFail;
				}
			iTimer->StopAfter(TTimeIntervalMicroSeconds32(KTimeForEventsToRegister));//try 500mS
			CActiveScheduler::Current()->Start();
			iError = gavdpUser->GAVDP_ConfigurationEndIndication();
			iTimer->StopAfter(TTimeIntervalMicroSeconds32(KTimeForEventsToRegister));//try 500mS
			CActiveScheduler::Current()->Start();
			iError = gavdpUser->GAVDP_StartIndication(symbianDevice);
			iTimer->StopAfter(TTimeIntervalMicroSeconds32(KTimeForEventsToRegister));//try 500mS
			CActiveScheduler::Current()->Start();
			if (iError != KErrNone)
				{
				INFO_PRINTF2(_L("error on GAVDP_StartIndication is %d" ), iError);
				verdict = EFail;
				}
			}
		}
	return verdict;
	}