bluetooth/btstack/avdtp/avdtputil.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 // Utility functions for AVDTP
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef AVDTPUTIL_H
       
    25 #define AVDTPUTIL_H
       
    26 
       
    27 #include <bluetoothav.h>
       
    28 
       
    29 #define __SYMBIAN_AVDTP_HIDE_MUX 
       
    30 
       
    31 #ifndef __SYMBIAN_AVDTP_HIDE_MUX
       
    32 #pragma message("Note: MUX support is untested")
       
    33 #endif
       
    34 
       
    35 using namespace SymbianBluetoothAV;
       
    36 
       
    37 _LIT(KAvdtpPanicName, "AVDTP Panic");
       
    38 
       
    39 enum TAvdtpPanic
       
    40 	{
       
    41 	EAVDTPBadSessionCount,
       
    42 	EAVDTPBadSessionSet,
       
    43 	EAVDTPBadDropSession,
       
    44 	EAVDTPBadRemoveStream,
       
    45 	EAvdtpStreamAlreadyExists,
       
    46 	EAVDTPCorruptMessage,
       
    47 	EAVDTPBadSessionDetachFromTransportChannel,
       
    48 	EAVDTPBadSessionAttachToTransportChannel,
       
    49 	EAVDTPBadMuxConfiguration,
       
    50 	EAVDTPBadMuxSetConfigPacket,
       
    51 	EAVDTPBadStreamConstitution,
       
    52 	EAVDTPSAPInitiatedServiceCompleteNoIoctlOutstanding,
       
    53 	EAvdtpInvalidResponseInUse,
       
    54 	EAvdtpBadIoctl,
       
    55 	EAvdtpBadSEPCount,
       
    56 	ERGAVDPSequenceFailure,
       
    57 	EAvdtpSAPIndicationEngineFailure,
       
    58 	EAvdtpBadErrorCase,
       
    59 	EAvdtpBadSignallingUserQueue,
       
    60 	EAvdtpBadLocalSEPUpdate,
       
    61 	EAvdtpBadSessionAttachingToStream,
       
    62 	EAvdtpSearchingForDirectChannel,
       
    63 	EAvdtpIncorrectlyFoundDirectChannel,
       
    64 	EAvdtpProtocolUsingWrongListeningMechanism,
       
    65 	EAvdtpGavdpHasNotCheckedSEID,
       
    66 	EAvdtpConfirmAddressedToWrongRequester,
       
    67 	EAvdtpStackIssuedBadSEID,
       
    68 	EAvdtpIndicationResult_Accepted_NotChecked,
       
    69 	EAvdtpOutboundMessageNewDataCalled,
       
    70 	EAvdtpTransactionLabelUnionMisused,
       
    71 	EAvdtpBadLocalSEPInstructingStreamRelease,
       
    72 	EAvdtpProtocolDyingWithTransportChannelsOnQueue,
       
    73 	EAvdtpProtocolDyingWithSignallingChannelsOnQueue,
       
    74 	EAvdtpProtocolDyingWithStreamsOnQueue,
       
    75 	EAvdtpSignallingChannelShouldExist,
       
    76 	EAvdtpProtocolReceivingControlFromUnexpectedProtocol,
       
    77 	EAvdtpProtocolReceivingControlFromUnexpectedPort,
       
    78 	EAvdtpProtocolReceivingBadlyFormedControlMessage,
       
    79 	EAvdtpProtocolAskedForSecondarySAPWhenNonExist,
       
    80 	EAvdtpConfiguratorsMultiplexingUnexpectedlySet,
       
    81 	EAvdtpSEIDHasWrongDomain,
       
    82 	EAvdtpReconfigurationCapabilitiesNotChecked,
       
    83 	EAvdtpLogicalChannelFactoryJobHasNoLogicalChannels,
       
    84 	EAvdtpLogicalChannelFactoryBadClaimLogicalChannel,
       
    85 	EAvdtpLogicalChannelFactoryBadSequenceNumber,
       
    86 	EAvdtpUnexpectedErrorFromL2CAP,
       
    87 	EAvdtpBadlyFormattedOutboundSignallingMessage,
       
    88 	EAvdtpGotBadDataFromL2CAP,
       
    89 	EAvdtpSignallingChannelDrainingFaulty,
       
    90 	EAvdtpSignallingChannelDyingWithDraftMessagesOnQueue,
       
    91 	EAvdtpSignallingChannelDyingWithTransactionsOnQueue,
       
    92 	EAvdtpSignallingChannelDyingWithMessagesOnQueue,
       
    93 	EAvdtpSignallingChannelGotBadSyncResponseFromSignallingSession,
       
    94 	EAvdtpSignallingChannelLogicalChannelNotReady,
       
    95 	EAvdtpSignallingMessageResponseNoTrailingDataExpected,
       
    96 	EAvdtpSignallingMessageResponseTrailingDataExpected,
       
    97 	EAvdtpSignallingSessionReceivedBadIndication,
       
    98 	EAvdtpSignallingSessionFoundWrongStream,
       
    99 	EAvdtpTransportSessionPacketPoolNotZeroSize,
       
   100 	EAvdtpTransportSessionPacketBalkingNotSet,
       
   101 	EAvdtpBadTransportSessionUpcallFromTransportChannel,
       
   102 	EAvdtpBadSessionAccessingMuxChannel,
       
   103 	EAvdtpTransportSessionBaseNotCheckStream,
       
   104 	EAvdtpStreamStateMachineFailed,
       
   105 	EAvdtpUnknownPostSendAction,
       
   106 	EAvdtpSignallingMessageHandlerLeft,
       
   107 	EAvdtpProtocolToldToRemoveUnknownTransportChannel,
       
   108 	EAvdtpSignallingChannelNotifiedOfWrongJob,
       
   109 	EAvdtpProtocolDeletionWhilstIdling,
       
   110 	EAvdtpInvalidTimeout,
       
   111 	EAvdtpLogicalChannelArrayMismatchesIndexAndSequence,
       
   112 	EAvdtpUnexpectedAwaitLogicalChannelsEvent,
       
   113 	EAvdtpUnexpectedLogicalChannelsAvailableEvent,
       
   114 	EAvdtpUnexpectedWatchdogFiredEvent,
       
   115 	EAvdtpUnexpectedConfiguredEvent,
       
   116 	EAvdtpUnexpectedSetConfigurationEvent,
       
   117 	EAvdtpUnexpectedAddSessionEvent,
       
   118 	EAvdtpUnexpectedDropSession,
       
   119 	EAvdtpUnexpectedStartedEvent,
       
   120 	EAvdtpUnexpectedSuspendedEvent,
       
   121 	EAvdtpPassingSapOwnershipToChannelThatAlreadyHasASap,
       
   122 	EAvdtpJobCompleteForUnknownCloseChannelJob,
       
   123 	EAvdtpTransferSapCalledForMuxChannel,
       
   124 	EAvdtpManagedChannelToldToShutdownWithNoSAP,
       
   125 	EAvdtpStartedListeningAgain,
       
   126 	EAvdtpNotListening,
       
   127 	EAvdtpStillListening,
       
   128 	EAvdtpInconsistentPendingConfigurationState,
       
   129 	EAvdtpInconsistentPendingReconfigurationState,
       
   130 	EAvdtpPassingNullSapOwnershipToChannel,
       
   131 	EAvdtpMuxerStateOutOfBounds,
       
   132 	EAvdtpInvalidLogicalChannel,
       
   133 	EAvdtpNotifyCompleteCancelledRequest,
       
   134 	EAvdtpUnexpectedIndicationsInQueue,
       
   135 	EAvdtpLogicalChannelFactoryDeletionWhileJobPending,
       
   136 	EUnexpectedEncryptionKeyRefreshPrevent,
       
   137 	EAvdtpInvalidReservedValueInOutboundSignallingMessage
       
   138 	};
       
   139 
       
   140 /**
       
   141 Panics raised by state machine default behaviour are multiplied by this
       
   142 factor.  The less signifigant digits are then available to carry a state
       
   143 index, allowing more information when fixing defects.
       
   144 
       
   145 For example, the Avdtp stream state machine failing may raise 
       
   146 panic 'AVDTP Panic 631000' if it occurs in the 'Idle' state.
       
   147 */
       
   148 const TInt KAvdtpStatePanicMultiplier = 10000;
       
   149 
       
   150 /**
       
   151 A delimiter to prevent a panic code of 0 creating ambigious panics.
       
   152 Without this panic code 0 in state 8 and panic code 8 (not in the state 
       
   153 machine) would be identical.
       
   154 */
       
   155 const TInt KAvdtpStatePanicDelimiter = 1000; // '1' is the delimiter
       
   156 
       
   157 /**
       
   158 If for any reason the current state cannot be found, this value is placed
       
   159 in the state field of a panic.
       
   160 */
       
   161 const TInt KAvdtpUnknownState = KAvdtpStatePanicDelimiter - 1;
       
   162 	
       
   163 void Panic(TAvdtpPanic aPanic);
       
   164 void Panic(TAvdtpPanic aPanic, TInt aState);
       
   165 
       
   166 #endif