bluetooth/btstack/sdp/sdppdu.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2000-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 #ifndef SDPPDU_H
       
    17 #define SDPPDU_H
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "sdpconsts.h"
       
    21 #include "sdpclient.h"
       
    22 
       
    23 /**
       
    24    Encapsulates an Sdp pdu.
       
    25 
       
    26    All SDP PDUs have the following format:
       
    27    @verbatim
       
    28    Field  |  PDU Id  |  Trans Id  |  ParamLength  |      Params...     |
       
    29    Length |  1 byte  |  2 bytes   |    2 bytes    | ParamLength bytes  | 
       
    30    @endverbatim
       
    31 
       
    32 **/
       
    33 NONSHARABLE_CLASS(CSdpPdu) : public CBase
       
    34 	{
       
    35 friend class CSdpClient;
       
    36 public:
       
    37 	CSdpPdu(CSdpNetDbProvider*	aSdpNetDbProv);
       
    38 	virtual ~CSdpPdu();
       
    39 	void SetPduId(TUint8 aPduId);
       
    40 	TUint8 PduId();
       
    41 	void SetTransid(TUint16 aTransId);
       
    42 	TUint16 TransId();
       
    43 	void SetLength();
       
    44 	void PutByte(TUint8 aByte);
       
    45 	void PutBigEndian16(TUint16 aShort);
       
    46 	void PutBigEndian32(TUint32 aLong);
       
    47 	void PutData(const TDesC8& aDes);
       
    48 	TDesC8& Data();
       
    49 	CSdpNetDbProvider*	NetDbProvider();
       
    50 protected:
       
    51 	// Fixme : this is the max packet size outbound
       
    52 	TBuf8<KSdpMaxPduSize> iBuf;
       
    53 	CSdpNetDbProvider*	iNetDbProvider;
       
    54 	TDblQueLink iLink;
       
    55 	};
       
    56 
       
    57 #endif