bluetoothappprofiles/avrcp/absolutevolumeapi/src/absolutevolumeutils.cpp
changeset 70 f5508c13dfe0
parent 67 16e4b9007960
child 71 083fd884d7dd
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedPartner
       
    21  @released
       
    22 */
       
    23 
       
    24 #include <absolutevolumeutils.h>
       
    25 
       
    26 EXPORT_C
       
    27 void RRemConAbsoluteVolume::Close()
       
    28 	{
       
    29 	iStream.Close();
       
    30 	iReadStream.Close();
       
    31 	}
       
    32 
       
    33 EXPORT_C 
       
    34 void RRemConAbsoluteVolumeRequest::ReadL(const TDesC8& aData)
       
    35 	{
       
    36 	iReadStream.Open(aData);
       
    37 	iVolume = iReadStream.ReadUint32L();
       
    38 	iMaxVolume = iReadStream.ReadUint32L();
       
    39 	iReadStream.ReadUint32L();
       
    40 	iReadStream.Close();
       
    41 	}
       
    42 
       
    43 EXPORT_C
       
    44 void RRemConAbsoluteVolumeRequest::WriteL(TDes8& aOutData)
       
    45 	{
       
    46 	aOutData.Zero();
       
    47 	iStream.Open(aOutData);
       
    48 	iStream.WriteUint32L(iVolume);
       
    49 	iStream.WriteUint32L(iMaxVolume);
       
    50 	iStream.WriteUint32L(NULL);
       
    51 	iStream.CommitL();
       
    52 	}
       
    53 
       
    54 EXPORT_C
       
    55 void RRemConAbsoluteVolumeResponse::ReadL(const TDesC8& aData)
       
    56 	{
       
    57 	iReadStream.Open(aData);
       
    58 	iError = iReadStream.ReadInt32L();
       
    59 	if (iError == KErrNone)
       
    60 	    {
       
    61 	    iVolume = iReadStream.ReadUint32L();
       
    62 	    iMaxVolume = iReadStream.ReadUint32L();
       
    63 	    }
       
    64 	iReadStream.Close();
       
    65 	}
       
    66 
       
    67 EXPORT_C
       
    68 void RRemConAbsoluteVolumeResponse::WriteL(TDes8& aOutData)
       
    69 	{
       
    70 	aOutData.Zero();
       
    71 	iStream.Open(aOutData);
       
    72 	iStream.WriteInt32L(iError);
       
    73 	if (KErrNone == iError)
       
    74 		{
       
    75 		iStream.WriteUint32L(iVolume);
       
    76 		iStream.WriteUint32L(iMaxVolume);
       
    77 		}
       
    78 	iStream.CommitL();
       
    79 	}