void CMTPPbcSetDevicePropValue::ServiceL()
    {
    OstTraceFunctionEntry0( CMTPPBCSETDEVICEPROPVALUE_SERVICEL_ENTRY );
    TMTPDevicePropertyCode propCode(static_cast<TMTPDevicePropertyCode>(Request().
                                    Uint32(TMTPTypeRequest::ERequestParameter1)));
    iData.iOptCode = EMTPOpCodeSetDevicePropValue;
    iData.iDevPropCode = propCode;
    switch(propCode)
        {
    case EMTPDevicePropCodePlaybackRate:
        {
        ReceiveDataL(iData.iPropValInt32);
        }
        break;
    case EMTPDevicePropCodeVolume:
    case EMTPDevicePropCodePlaybackObject:
    case EMTPDevicePropCodePlaybackContainerIndex:
    case EMTPDevicePropCodePlaybackPosition:
        {
        ReceiveDataL(iData.iPropValUint32);        
        }
        break;
        
    default:
        {
        SendResponseL(EMTPRespCodeDevicePropNotSupported);
        }
        break;             
        }
    OstTraceFunctionExit0( CMTPPBCSETDEVICEPROPVALUE_SERVICEL_EXIT );
    }
/**
SetObjectPropValue request handler
*/
void CMTPSetObjectPropValue::ServiceL()
{
    __ASSERT_DEBUG(iRequestChecker, Panic(EMTPDpRequestCheckNull));
    TUint32 handle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
    TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter2);

    iFramework.ObjectMgr().ObjectL(TMTPTypeUint32(handle), *iObjMeta);
    LEAVEIFERROR(iRfs.Entry(iObjMeta->DesC(CMTPObjectMetaData::ESuid), iFileEntry),
                 OstTraceExt1(TRACE_ERROR, CMTPSETOBJECTPROPVALUE_SERVICEL,
                              "can't get entry details for %S!", iObjMeta->DesC(CMTPObjectMetaData::ESuid)));

    delete iMTPTypeString;
    iMTPTypeString = NULL;
    iMTPTypeString = CMTPTypeString::NewL();
    switch(propCode)
    {
    case EMTPObjectPropCodeDateModified:
    case EMTPObjectPropCodeObjectFileName:
    case EMTPObjectPropCodeName:
        ReceiveDataL(*iMTPTypeString);
        break;
    case EMTPObjectPropCodeNonConsumable:
        ReceiveDataL(iMTPTypeUint8);
        break;
    case EMTPObjectPropCodeAssociationType:
    case EMTPObjectPropCodeHidden:
    {
        ReceiveDataL(iMTPTypeUint16);
    }
    break;
    case EMTPObjectPropCodeAssociationDesc:
    {
        ReceiveDataL(iMTPTypeUint32);
    }
    break;

    case EMTPObjectPropCodeStorageID:
    case EMTPObjectPropCodeObjectFormat:
    case EMTPObjectPropCodeProtectionStatus:
    case EMTPObjectPropCodeObjectSize:
    case EMTPObjectPropCodeParentObject:
    case EMTPObjectPropCodePersistentUniqueObjectIdentifier:
    {
        //!!! Never come here, it should be blocked on CheckRequestL()
        // and EMTPRespCodeAccessDenied will be reported.
        //No break sentance, goto Panic
    }
    default:
        OstTrace1( TRACE_ERROR, DUP1_CMTPSETOBJECTPROPVALUE_SERVICEL, "Invalid property code %d", propCode);
        User::Leave( KErrNotSupported );
        break;
    }
}
/**
Service the device friendly name property.
*/   
void CMTPSetDevicePropValue::ServiceDeviceFriendlyNameL()
    {
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICEDEVICEFRIENDLYNAMEL_ENTRY );
    iString->SetL(KNullDesC);
    ReceiveDataL(*iString); 
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICEDEVICEFRIENDLYNAMEL_EXIT );
    }
/*
*ServiceSupportedFormatsOrdered property. it is get only type.
*/
void CMTPSetDevicePropValue::ServiceSupportedFormatsOrderedL()
    {	 
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICESUPPORTEDFORMATSORDEREDL_ENTRY );
    //no need to recive this data beacuse it is Get property
    ReceiveDataL(iUint8);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICESUPPORTEDFORMATSORDEREDL_EXIT );
    }
/*
*Service the Device Icon property and CompleteDeviceIcon.
As of now implemented as device property of type get.
*/   
void CMTPSetDevicePropValue::ServiceDeviceIconL()
    {    
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICEDEVICEICONL_ENTRY );
    //no need to recive this data beacuse it is Get property
    ReceiveDataL(*iMtparray);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICEDEVICEICONL_EXIT );
    }
/**
Service session initiator property.
*/ 
void CMTPSetDevicePropValue::ServiceSessionInitiatorVersionInfoL()
	{	 
	OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICESESSIONINITIATORVERSIONINFOL_ENTRY );
	iString->SetL(KNullDesC);
	ReceiveDataL(*iString);
	OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICESESSIONINITIATORVERSIONINFOL_EXIT );
	}
/**
Service the synchronisation partner property.
*/ 
void CMTPSetDevicePropValue::ServiceSynchronisationPartnerL()
    {    
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICESYNCHRONISATIONPARTNERL_ENTRY );
    iString->SetL(KNullDesC);
    ReceiveDataL(*iString);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICESYNCHRONISATIONPARTNERL_EXIT );
    }
void CMTPSvcDeleteServicePropList::ServiceL()
	{
	OstTraceFunctionEntry0( CMTPSVCDELETESERVICEPROPLIST_SERVICEL_ENTRY );
	//Recieve the data from the property list
	ReceiveDataL(*iDeleteServicePropList);
	OstTraceFunctionExit0( CMTPSVCDELETESERVICEPROPLIST_SERVICEL_EXIT );
	}
/**
SetObjectPropList request handler
*/    
void CMTPSetObjectPropList::ServiceL()
    {
    delete iObjectPropList;
    iObjectPropList = NULL;
    iObjectPropList = CMTPTypeObjectPropList::NewL();
    ReceiveDataL(*iObjectPropList);    
    }
// -----------------------------------------------------------------------------
// CSendObject::ServiceObjectL
// SendObject
// -----------------------------------------------------------------------------
//
void CSendObject::ServiceObjectL()
    {
    PRINT( _L( "MM MTP => CSendObject::ServiceObjectL" ) );
    ReceiveDataL( *iFileReceived );
    iProgress = ESendObjectInProgress;

    PRINT( _L( "MM MTP <= CSendObject::ServiceObjectL" ) );
    }
/**
GetReferences request handler
*/    
void CMTPImageDpSetObjectReferences::ServiceL()
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPSETOBJECTREFERENCES_SERVICEL_ENTRY );
    delete iReferences;
    iReferences = NULL;
    iReferences = CMTPTypeArray::NewL(EMTPTypeAUINT32);
    ReceiveDataL(*iReferences);
    OstTraceFunctionExit0( CMTPIMAGEDPSETOBJECTREFERENCES_SERVICEL_EXIT );
    }
// -----------------------------------------------------------------------------
// CSendObject::ServicePropListL
// SendObjectPropList
// -----------------------------------------------------------------------------
//
void CSendObject::ServicePropListL()
    {
    PRINT( _L( "MM MTP => CSendObject::ServicePropListL" ) );

    iObjectPropList = CMTPTypeObjectPropList::NewL();
    ReceiveDataL( *iObjectPropList );
    iProgress = EObjectInfoInProgress;

    PRINT( _L( "MM MTP <= CSendObject::ServicePropListL" ) );
    }
// -----------------------------------------------------------------------------
// CSendObject::ServiceInfoL
// ServiceL - Recieves the objectinfo data
// -----------------------------------------------------------------------------
//
void CSendObject::ServiceInfoL()
    {
    PRINT( _L( "MM MTP => CSendObject::ServiceInfoL" ) );

    iObjectInfo = CMTPTypeObjectInfo::NewL();
    ReceiveDataL( *iObjectInfo );
    iProgress = EObjectInfoInProgress;

    PRINT( _L( "MM MTP <= CSendObject::ServiceInfoL" ) );
    }
/**
GetReferences request handler
*/    
void CMTPCommonRequestProcessor ::ServiceL()
    {
    if (HasDataphase())
        {
        __ASSERT_DEBUG(iIToRData, Panic(EMTPDpObjectNull));
        ReceiveDataL(*iIToRData);
        }
    else
        {
        SendResponseL(iResponseCode);
        }
    }
void CMTPSetDevicePropValue::HandleExtnServiceL(TInt aPropCode, MExtnDevicePropDp* aExtnDevplugin)
	{
	OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_HANDLEEXTNSERVICEL_ENTRY );
	MMTPType* ammtptype = NULL;
	aExtnDevplugin->GetDevicePropertyContainerL((TMTPDevicePropertyCode)aPropCode, &ammtptype);	
	if(ammtptype != NULL)
	{
	ReceiveDataL(*ammtptype);
	}
	else
	{
	SendResponseL(EMTPRespCodeDevicePropNotSupported);	
	}
	OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_HANDLEEXTNSERVICEL_EXIT );
	}
/**
Initiates an USB MTP device class specific request request processing sequence.
@param aData The control request setup data sink buffer.
@leave One of the system wide error codes, if a processing failure occurs.
*/
void CMTPUsbEpControl::ReceiveControlRequestSetupL(MMTPType& aData)
    {
    OstTraceFunctionEntry0( CMTPUSBEPCONTROL_RECEIVECONTROLREQUESTSETUPL_ENTRY );
    OstTrace1( TRACE_NORMAL, CMTPUSBEPCONTROL_RECEIVECONTROLREQUESTSETUPL, 
            "CMTPUsbEpControl state on entry = %d", iState );
    
    __ASSERT_DEBUG((iState == EIdle), Panic(EMTPUsbBadState));
    
    // Pass the bulk data sink buffer to the base class and update state.
    ReceiveDataL(aData);
    SetState(EControlRequestSetupPending);

    OstTrace1( TRACE_NORMAL, DUP1_CMTPUSBEPCONTROL_RECEIVECONTROLREQUESTSETUPL, 
            "CMTPUsbEpControl state on entry = %d", iState );
    OstTraceFunctionExit0( CMTPUSBEPCONTROL_RECEIVECONTROLREQUESTSETUPL_EXIT );
    }
void
ES_RemoteDebugConnection::ReceiveMoreL()
{
	while (TRUE)
	{
		if (!ReceiveDataL())
			return;

		if (!receive_message)
		{
			if (receive_buffer_used < 12)
				return;

			receive_tail = TRUE;
			receive_item = receive_item_offset = 0;

			if (!ES_RemoteStringIsHex(receive_buffer, 12))
			{
				CloseL();
				return;
			}

			receive_message_size = ES_RemoteStringToUnsigned8(receive_buffer);
			receive_message_length = ES_RemoteStringToUnsigned4(receive_buffer + 8);
			receive_message_buffer = new (ELeave) char[receive_message_size];
			receive_message = new (ELeave) ES_DebugMessage;

			receive_buffer_used = 0;
			receive_message_received = 0;
			continue;
		}
		else if (receive_message_received < receive_message_size)
			continue;
		else
		{
			receive_message->ParseL(receive_message_buffer, receive_message_size, receive_message_length);
			LEAVE_IF_ERROR(Received(receive_message));

			delete[] receive_message_buffer;
			receive_message_buffer = NULL;

			receive_message = NULL;
		}
	}
}
/*
*UseDeviceStage property. 
*/
void CMTPSetDevicePropValue::ServiceUseDeviceStageL()
    {	 
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICEUSEDEVICESTAGEL_ENTRY );
    ReceiveDataL(iUint8);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICEUSEDEVICESTAGEL_EXIT );
    }
/**
Initiates the receiving of the event data on the event channel. 
@param aEvent The buffer containing the event received from the initiator
*/
void CPTPIPEventHandler::ReceiveEventL(MMTPType& aEvent)
    {
	OstTraceFunctionEntry0( CPTPIPEVENTHANDLER_RECEIVEEVENTL_ENTRY );
    ReceiveDataL(aEvent);
    OstTraceFunctionExit0( CPTPIPEVENTHANDLER_RECEIVEEVENTL_EXIT );
    }
/**
*Service the PerceivedDeviceType property.
*it is not set type it should be removed 
**/
void CMTPSetDevicePropValue::ServicePerceivedDeviceTypeL()
    {	 
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICEPERCEIVEDDEVICETYPEL_ENTRY );
    ReceiveDataL(iUint32);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICEPERCEIVEDDEVICETYPEL_EXIT );
    }
/*
*ModelID property. 
*/
void CMTPSetDevicePropValue::ServiceModelIDL()
    {	 
    OstTraceFunctionEntry0( CMTPSETDEVICEPROPVALUE_SERVICEMODELIDL_ENTRY );	
    ReceiveDataL(*iData);
    OstTraceFunctionExit0( CMTPSETDEVICEPROPVALUE_SERVICEMODELIDL_EXIT );
    }