bluetooth/btsdp/server/protocol/pduhandler.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 
       
    17 #ifndef PDUHANDLER_H
       
    18 #define PDUHANDLER_H
       
    19 
       
    20 #include <e32std.h>
       
    21 #include <es_sock.h>
       
    22 #include "sdpconsts.h"
       
    23 #include "ServiceSearchVisitor.h"
       
    24 #include "ExtractorVisitor.h"
       
    25 
       
    26 // 4 byte offset, 4 byte full length, 2 byte CRC
       
    27 #define KSdpContinuationStateLength 10
       
    28 
       
    29 #define KContStateHeader 1
       
    30 
       
    31 #define KRecHandleOffset 0
       
    32 #define KRecHandleCountSize 2
       
    33 #define KAttributeCountOffset 4
       
    34 #define KRecAttribListOffset 6
       
    35 
       
    36 #define KRspTotalCountOffset 0
       
    37 #define KRspHandleCountSize 2
       
    38 #define KRspHandleCountOffset 2
       
    39 #define KRspAttrCountOffset 0
       
    40 #define KRspAttributeCountSize 2
       
    41 #define KRspAttributeCountOffset 0
       
    42 #define KRspAttributeListOffset 2
       
    43 #define KContContOff 0
       
    44 #define KContTotOff 4
       
    45 #define KContCrcOff 8
       
    46 
       
    47 #define KAttributeIdSize 3
       
    48 #define KAttrIdHeader 0x09
       
    49 
       
    50 #define KMaxThreeByteDESSize 0xffff
       
    51 #define KMaxTwoByteDESSize 0xff
       
    52 #define KTwoByteDESSize 2
       
    53 #define KThreeByteDESSize 3
       
    54 #define KFiveByteDESSize 5
       
    55 
       
    56 //class CSdpListener;
       
    57 class CSdpConnection;
       
    58 class TSdpPdu;
       
    59 
       
    60 NONSHARABLE_CLASS(CSdpPDUHandler)
       
    61 {
       
    62 public:
       
    63 	CSdpPDUHandler(){iDesSize=0;}
       
    64 	static CSdpSearchPattern* UUIDListLC(const TDesC8& aPdu, const TInt aNextSize, TInt& aLen, TInt& aRem, TInt& aCount);
       
    65 	static CSdpAttrIdMatchList* AttrListLC(const TDesC8& aPdu, TInt& aRem);
       
    66 	TBool ContinuationL(const TDesC8& aPdu, const TInt aLen, const TInt aRem);
       
    67 	void CompleteOPL(TDes8& aPdu, const TDesC8& aWritePdu, const TInt aMaxAttrCount);
       
    68 	TUint32 ContinuationOffset();
       
    69 	TUint32 FullLength();
       
    70 	TUint16 ReqCRC();
       
    71 	static TInt DesSize(TUint aDataSize);
       
    72 private:
       
    73 	TUint iDesSize;
       
    74 	TUint iRespSize;	// continuation
       
    75 	TUint32 iContinuation;
       
    76 	TUint32 iLength;
       
    77 	TUint16 iCRC;	// I wish
       
    78 // epocsvr.cpp
       
    79 //  line 703 update database size when record added.
       
    80 // lines 730, update database when record deleted (this code is wrong, anyway)
       
    81 //	lines 781, 831, update database when attribute amended, deleted.
       
    82 //  
       
    83 };
       
    84 
       
    85 #endif