bluetoothappprofiles/avrcp/common/avrcpipc.h
changeset 70 f5508c13dfe0
parent 67 16e4b9007960
child 71 083fd884d7dd
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
     1 // Copyright (c) 2007-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 // This file contains structures shared by the AVRCP API with the AVRCP bearer.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef AVRCPIPC_H
       
    25 #define AVRCPIPC_H
       
    26 
       
    27 #include <s32mem.h>
       
    28 #include <remcon/avrcpspec.h>
       
    29 
       
    30 // Structure of commands for AVRCP player information requests via IPC
       
    31 class RAvrcpIPC
       
    32 {
       
    33 public:
       
    34 	IMPORT_C static TMetadataTransferPDU GetPDUIdFromIPCOperationId(TInt aOperationId);
       
    35 	IMPORT_C static TRegisterNotificationEvent GetEventIdFromIPCOperationId(TInt aOperationId);
       
    36 	IMPORT_C static TInt SetIPCOperationIdFromEventId(TRegisterNotificationEvent aEventId);
       
    37 	IMPORT_C static TUint8 SymbianErrToStatus(TInt aErr);
       
    38     IMPORT_C static TInt SymbianErrorCheck(TInt aError);
       
    39 	
       
    40 public:
       
    41 	virtual void ReadL(const TDesC8& aData) = 0;
       
    42 	virtual void WriteL(TDes8& aOutData) = 0;
       
    43 	
       
    44 protected:
       
    45 	// Big-endian methods; Symbian native methods are little-endian
       
    46 	TUint8  Read8L();
       
    47 	TUint16 Read16L();
       
    48 	TUint32 Read32L();
       
    49 	TUint32 Read24L();   // Required for PDU 0x10
       
    50 	TUint64 Read64L();
       
    51 	void Write8L(TUint8 aVal);
       
    52 	void Write16L(TUint16 aVal);
       
    53 	void Write24L(TUint32 aVal); // Required for PDU 0x10
       
    54 	void Write32L(TUint32 aVal);
       
    55 	void Write64L(TUint64 aVal);
       
    56 	void Close();
       
    57 
       
    58 public:
       
    59 	RDesWriteStream iStream;
       
    60 	RDesReadStream iReadStream;
       
    61 };
       
    62 
       
    63 const TUint8 KLengthErrorResponse = 4;               // 4 bytes for errors returned via IPC
       
    64 class RAvrcpIPCError : public RAvrcpIPC
       
    65 {
       
    66 public:
       
    67 	IMPORT_C void ReadL(const TDesC8& aData);
       
    68 	IMPORT_C void WriteL(TDes8& aOutData);
       
    69 	
       
    70 public:
       
    71 	TInt iError;
       
    72 };
       
    73 
       
    74 #endif // AVRCPIPC_H