// ---------------------------------------------------------------------------
// Data request from CatalogsPCConnectivityPlugin
// First ask the size from server, then give correct size CBufFlat
// ---------------------------------------------------------------------------
//
void RCatalogsPCConnectivityClient::GetDataL( 
    TDataType& aMimeType, CBufFlat& aData )
    {
    TPckgBuf<TInt> pckgSize;
    TPckgBuf<TDataType> pckgMIME;
    
    User::LeaveIfError( SendReceive( 
            ECatalogsPCConnectivityGetSize, 
            TIpcArgs( &pckgMIME, &pckgSize ) ) );
    
    TInt size = pckgSize();
    aMimeType = pckgMIME();
    
    RBuf8 desData;
    desData.CreateL( size );
    desData.CleanupClosePushL();
    
    User::LeaveIfError( SendReceive( 
            ECatalogsPCConnectivityGetData, 
            TIpcArgs( &desData ) ) );
    
    aData.Reset();
    aData.ExpandL( 0, size );
    aData.Write( 0, desData, size );        
            
    CleanupStack::Pop(); //desData
    desData.Close();
    }
void CBlueJackImpl::SendMessageL(const TBTDevAddr& aToAddress,
	const TDesC& aWithDeviceName,
	const TDesC& aWithMessageName,
	const TDesC8& aMessage,
	TInt	aConnectCount)
{
	CALLSTACKITEM_N(_CL("CBlueJackImpl"), _CL("SendMessageL"));

#ifndef NO_BT
	iSettings->SetLocalBTName(aWithDeviceName);
#endif

	iBuffer->Reset();
	iBuffer->InsertL(0, aMessage);
	iObject->SetTypeL(_L8("text/plain"));
	iObject->SetNameL(aWithMessageName);
	iObject->SetDescriptionL(_L("description of message"));

	iObex->SendMessage(aToAddress, iObject, aConnectCount);
}