bluetoothcommsprofiles/btpan/bnep/bneputils.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2004-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 __BNEPUTILS_H
       
    22 #define __BNEPUTILS_H 
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <e32def.h>
       
    26 #include <bttypes.h>
       
    27 
       
    28 const TInt KEthernetHWAddrSize = KBTDevAddrSize;
       
    29 const TInt KEthernetProtocolSize = 2;
       
    30 const TInt KBnepPacketTypeSize = 1;
       
    31 const TInt KMaxBnepHeaderSize = 19;
       
    32 const TInt KEthernetProtocolOffset = KEthernetHWAddrSize * 2;
       
    33 const TInt KEthernetHeaderSize = KEthernetProtocolOffset + KEthernetProtocolSize;
       
    34 
       
    35 const TInt KSocketReaderPriority = EPriorityHigh;
       
    36 //KBnepProceedCallBackPriority is used for async callback from PanAgent after processing
       
    37 //a part of the frame. The priority has be higher than the one used in socket reader.
       
    38 //Otherwise the current frame may be overwritten if the socket reader completes request 
       
    39 //before the async callback.
       
    40 const TInt KBnepProceedCallBackPriority = KSocketReaderPriority + 1;
       
    41 
       
    42 namespace Bnep
       
    43     {
       
    44     enum TBnepPanic
       
    45         {
       
    46         ENullTlsPointer,
       
    47         ENullPointer,
       
    48         EUnableToRespond,
       
    49         ESocketWriterQueueOverflow,
       
    50         ELogResetAttempt,
       
    51         EAppendFailed,
       
    52         ECallBackAlreadyAdded,
       
    53         EProceedingOnInvalidLink,
       
    54         EUnexpectedMessage
       
    55         };
       
    56     } // Namespace Bnep
       
    57 
       
    58 class BnepUtils 
       
    59     {
       
    60 public:
       
    61     static TBool IsMulticast (const TBTDevAddr& aAddr);
       
    62     static void Panic (Bnep::TBnepPanic aReason);
       
    63     };
       
    64 
       
    65 #endif