bluetoothmgmt/btcommon/inc/sdpconsts.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 1999-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 // Constants for the SDP protocol.
       
    15 // Version for the SDP server
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef SDPCONSTS_H
       
    20 #define SDPCONSTS_H
       
    21 
       
    22 #include <btsdp.h>
       
    23 
       
    24 // The PSM on which SDP resides
       
    25 static const TInt KSDPPSM = 0x01;
       
    26 
       
    27 // Idle timer default value (seconds)
       
    28 static const TInt KSDPIdleTimeout = 5;
       
    29 
       
    30 // Client timeouts
       
    31 static const TInt KSDPClientTimeout = 120; // seconds
       
    32 
       
    33 // PDU Size
       
    34 static const TInt KSdpMaxPduSize = 250;
       
    35 
       
    36 //PDU Fields
       
    37 static const TInt KSdpPduHeaderSize = 5;
       
    38 static const TInt KSdpPduIdOffset   = 0;
       
    39 static const TInt KSdpPduTransIdOffset = 1;
       
    40 static const TInt KSdpPduParamLengthOffset = 3;
       
    41 
       
    42 // PDU Types
       
    43 enum TSdpPduId
       
    44 	{
       
    45 	EErrorResponse					= 0x01,
       
    46 	EServiceSearchRequest			= 0x02,
       
    47 	EServiceSearchResponse			= 0x03,
       
    48 	EServiceAttributeRequest		= 0x04,
       
    49 	EServiceAttributeResponse		= 0x05,
       
    50 	EServiceSearchAttributeRequest	= 0x06,
       
    51 	EServiceSearchAttributeResponse	= 0x07
       
    52 	};
       
    53 
       
    54 // Errors
       
    55 enum TSdpErrorCodes							// EPOC error that'll generate each code
       
    56 	{
       
    57 	EErrorReserved				= 0x00,
       
    58 	EInvalidSdpVersion			= 0x01,		// KErrNotSupported
       
    59 	EInvalidServiceRecordHandle = 0x02,		// KErrBadHandle 
       
    60 	EInvalidRequestSyntax		= 0x03,		// KErrCorrupt, KErrArgument
       
    61 	EInvalidPduSize				= 0x04,		// KErrOverflow, KErrUnderflow, KErrTooBig
       
    62 	EInvalidContinuationState	= 0x05,		// KErrNotReady, KErrUnknown, KErrLocked
       
    63 	EInsufficientResources		= 0x06,		// KErrNoMemory, KErrHardwareNotAvailable
       
    64 	};
       
    65 
       
    66 
       
    67 
       
    68 // Data Element stuff
       
    69 
       
    70 static const TInt KErrSdpParserInvalidSizeForType = -3000;
       
    71 static const TInt KErrSdpParserInvalidSizeForParentList = -3001;
       
    72 static const TInt KErrSdpBadAttributeId = -3002;
       
    73 
       
    74 static const TInt KSdpRecordHandleSize = 4;
       
    75 static const TInt KSdpAttributeIdSize = 2;
       
    76 static const TSdpServRecordHandle KSdpMaxServRecordHandle = 0xffffffff;
       
    77 static const TSdpServRecordHandle KSdpMinServRecordHandle = 0x10000;
       
    78 
       
    79 static const TInt KSdpContinuationStateMaxLength = 16;
       
    80 
       
    81 enum TSdpElementSizeDesc
       
    82 	{
       
    83 	ESizeOneByte		= 0,
       
    84 	ESizeTwoBytes		= 1,
       
    85 	ESizeFourBytes		= 2,
       
    86 	ESizeEightBytes		= 3,
       
    87 	ESizeSixteenBytes	= 4,
       
    88 	ESizeOneAdditional	= 5,
       
    89 	ESizeTwoAdditional	= 6,
       
    90 	ESizeFourAdditional	= 7
       
    91 	};
       
    92 
       
    93 // Element header fields
       
    94 static const TInt KSdpElemHdrTypeShift = 3;
       
    95 static const TInt KSdpElemHdrSizeMask = 0x07;
       
    96 
       
    97 // Data Element Stuff
       
    98 static const TUint8 KSdpElementValidSizes[] = 
       
    99 	{		// Type		// Sizes
       
   100 	0x01,	//	00		-------0
       
   101 	0x1f,	//	01		---43210
       
   102 	0x1f,	//	02		---43210
       
   103 	0x16,	//	03		---4-21-
       
   104 	0xe0,	//	04		765-----
       
   105 	0x01,	//	05		-------0
       
   106 	0xe0,	//	06		765-----
       
   107 	0xe0,	//	07		765-----
       
   108 	0xe0	//	08		765-----
       
   109 	};
       
   110 
       
   111 
       
   112 #endif