bthci/hci2implementations/hctls/bcsp/inc/hctlbcspconsts.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2006-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  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef HCTLBCSPCONSTS_H
       
    22 #define HCTLBCSPCONSTS_H
       
    23 
       
    24 
       
    25 /**BCSP Channel allocation*/
       
    26 const TUint8 KBcspAckChnl=0x00;				// channel 0
       
    27 const TUint8 KBcspLinkChnl=0x01;			// channel 1 Link Establishment
       
    28 const TUint8 KBcspBcCmdChnl=0x02;			// channel 2
       
    29 const TUint8 KBcspCommEvntChnl=0x05;		// channel 5
       
    30 const TUint8 KBcspACLDataChnl=0x06;			// channel 6
       
    31 const TUint8 KBcspSynchronousDataChnl=0x07;	// channel 7
       
    32 
       
    33 //FlagByte Constants
       
    34 const TUint8 KBcspCrcPresentMask = 0x40;
       
    35 const TUint8 KBcspProtocolTypeMask = 0x80;
       
    36 
       
    37 const TUint8 KBcspSeqMask = 0x07;
       
    38 const TUint8 KBcspAckFieldOffset = 3;
       
    39 const TUint8 KBcspAckMask = 0x38;
       
    40 
       
    41 const TUint8 KBcspPayloadLen1stBitsMask=0xf0;
       
    42 const TUint8 KBcspProtocolIdMask=0x0f;	
       
    43 
       
    44 /**HCTL Header and trailer consts*/
       
    45 const TUint8 KBcspHeaderFlagsByteIndex = 0;
       
    46 const TUint8 KBcspHeaderByte2Index = 1;
       
    47 const TUint8 KBcspHeaderByte3Index = 2;
       
    48 const TUint8 KBcspHeaderChecksumByteIndex = 3;
       
    49 
       
    50 const TUint8 KBcspHeaderBytes = 4;
       
    51 const TUint8 KBcspCrcBytes = 2;
       
    52 
       
    53 /**Defined max payload sizes of various packet types*/
       
    54 const TUint16 KMaxSCOData = 64;
       
    55 const TUint16 KMaxHCICommand = 256;
       
    56 const TUint16 KMaxACLData = 1021;
       
    57 
       
    58 const TUint16 KMaxReliablePayloadSize=KMaxACLData+5;
       
    59 const TUint16 KMaxUnreliablePayloadSize=KMaxSCOData+4;
       
    60 
       
    61 /**Defined max windows size i.e. no. packets that can be transmitted without acknowledgement */
       
    62 const TUint8  KBcspReliableWindowSize = 4;
       
    63 const TUint8  KBcspUnreliableQueueSize = 4;
       
    64 const TUint8  KBcspWindowSize=4;      // Maximum Window Size for BCSP in Casiras by default
       
    65 const TUint8  KMaxBcspWindowSize=8;   // Window Size for BCSP in Casiras by default
       
    66 const TUint16 KHCIHeaderSize=4;
       
    67 
       
    68 
       
    69 /** Flags field masks */
       
    70 
       
    71 const TInt KBcspUnreliableDatagramQueue=0;
       
    72 const TInt KBcspReliableSequenceQueue=1;
       
    73 
       
    74 /**Sequence layer constants */
       
    75 const TUint8 KWindowSize=4;				// Define according to efficiency and performance
       
    76 const TUint8 KMaxWindowSize=8;
       
    77 const TInt KRxAckTimeout=250000;			// Some number to tune/adjust for performance
       
    78 const TInt KTxAckTimeout=125000;			// Some number to tune/adjust for performance
       
    79 const TUint8 KTxRetryLimit=20;				// Some number to tune/adjust for performance
       
    80 
       
    81 /**Link Establishment layer constants */
       
    82 _LIT8(KBcspLinkMsg_Sync,     "\xda\xdc\xed\xed");
       
    83 _LIT8(KBcspLinkMsg_SyncResp, "\xac\xaf\xef\xee");
       
    84 _LIT8(KBcspLinkMsg_Conf,     "\xad\xef\xac\xed");
       
    85 _LIT8(KBcspLinkMsg_ConfResp, "\xde\xad\xd0\xd0");
       
    86 const TInt KBcspConfCntMax=50;
       
    87 const TInt KTShyTimeout = 250000;
       
    88 const TInt KTConfTimeout = 250000;
       
    89 
       
    90 
       
    91 /**SLIP Encoding Bytes */
       
    92 const TUint8 KSlipWrapperByte = 0xc0;	
       
    93 const TUint8 KSlipByteDB = 0xdb;	
       
    94 const TUint8 KSlipByteDC = 0xdc;	
       
    95 const TUint8 KSlipByteDD = 0xdd;	
       
    96 
       
    97 /**BCSP Framing errors*/
       
    98 
       
    99 const TInt KErrSlipCorrupted=-6100;
       
   100 const TInt KErrBcspHeaderCorrupt=-6101;
       
   101 const TInt KErrBcspCorruptedHCIPayload=-6102;
       
   102 const TInt KErrBcspCRCCheckFailed=-6103;
       
   103 const TInt KErrBcspUnRecognizableHCIData=-6104;
       
   104 const TInt KErrBcspPacketTypeUnrecognized=-6105;
       
   105 const TInt KErrBcspInvalidAckFlagValue=-6106;
       
   106 const TInt KErrBcspInvalidSeqFlagValue=-6107;
       
   107 const TInt KErrBcspWriteACLDataFailed=-6108;
       
   108 const TInt KErrBcspWriteCommandDataFailed=-6109;
       
   109 const TInt KErrBcspNothingToSend = -6110;
       
   110 const TInt KErrBcspMaxRetries = -6111;
       
   111 const TInt KErrBcspWriteBcCmdDataFailed=-6112;
       
   112 
       
   113 const TUint KHCTLRecvBufSize=2048;
       
   114 
       
   115 #endif // HCTLBCSPCONSTS_H