bluetoothmgmt/bluetoothclientlib/inc/bluetoothAV.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  @publishedPartner
       
    19  @released
       
    20 */
       
    21 #ifndef BLUETOOTHAV_H
       
    22 #define BLUETOOTHAV_H
       
    23 
       
    24 #include <bt_sock.h>
       
    25 
       
    26 class TSEID;
       
    27 
       
    28 typedef TUint8 TTCID;
       
    29 typedef TUint8 TTSID;
       
    30 typedef TUint8 TAvdtpTransactionLabel;
       
    31 typedef TUint8 TBluetoothMediaCodecType;
       
    32 
       
    33 // to cover AVDTP, GAVDP, A2DP and VDP enums
       
    34 // NOTE: 	Changing this from a TUint8 will cause a 'Break'.
       
    35 //			See in-source documentation for:-
       
    36 //			TInt SymbianBluetoothAV::ConvertToSymbianError::DoConvertError(TBluetoothAvDistributionError aAVError)
       
    37 typedef TUint8 TBluetoothAvDistributionError;
       
    38 
       
    39 /**
       
    40 TSEID class represents an AVDTP SEID as described in the AVDTP v1.0 specification.
       
    41 */
       
    42 NONSHARABLE_CLASS(TSEID)
       
    43 	{
       
    44 private:
       
    45 static const TUint KIsLocalBit = 1<<31;
       
    46 public:
       
    47 	IMPORT_C TSEID();
       
    48 	IMPORT_C TSEID(TUint aSEID, TBool aIsLocal);
       
    49 	IMPORT_C explicit TSEID(TUint aValue);
       
    50 	IMPORT_C TUint SEID() const;
       
    51 	IMPORT_C TUint PacketValue() const;
       
    52 	IMPORT_C TBool IsValid() const;
       
    53 	IMPORT_C void Set(TUint aValue);
       
    54 	IMPORT_C TBool operator==(TSEID aSEID) const;
       
    55 	IMPORT_C TBool operator!=(TSEID aSEID) const;
       
    56 	IMPORT_C static TSEID _Spare(TUint8 aUnused);
       
    57 	IMPORT_C static TSEID FromPacketL(TUint8 aPacketValue, TBool aSemanticallyLocal);
       
    58 	IMPORT_C void Reset();
       
    59 	IMPORT_C TBool IsLocal() const;
       
    60 	IMPORT_C TUint Value() const; 
       
    61 	 
       
    62 private:
       
    63 	static const TUint  KInvalidSEID;
       
    64 	TUint	iValue; // large size for interface compatibility
       
    65 	};
       
    66 
       
    67 const TInt KAVDTP = 0x0019;	// protocol number, as per assigned number
       
    68 _LIT(KAVDTPProtocolName, "AVDTP");
       
    69 
       
    70 /**
       
    71 Error Code: -18000.  Indicates the start of the error range for AVDTP and the AV profiles 
       
    72 that sit above it.
       
    73 
       
    74 The error range this encompasses: -18000 to -18300 (inclusive).
       
    75 */
       
    76 const TInt KErrAvdtpBaseError = -18000;
       
    77 
       
    78 /**
       
    79 Error Code: -18001.  Error raised when the AVDTP is started without 
       
    80 having been bound to a lower layer protocol which provides the 
       
    81 Service Access Points.
       
    82 */
       
    83 const TInt KErrAvdtpNotBound = KErrAvdtpBaseError -1;
       
    84 
       
    85 /**
       
    86 Error Code: -18002.  Error raised when trying to bind the AVDTP
       
    87 to a lower layer protocol when it is already bound to one.
       
    88 */
       
    89 const TInt KErrAvdtpAlreadyBound = KErrAvdtpBaseError -2;
       
    90 
       
    91 /**
       
    92 Error Code: -18003.  Error raised when trying to add a packet
       
    93 to a full packetpool.
       
    94 */
       
    95 const TInt KErrAvdtpPacketPoolBalk = KErrAvdtpBaseError -3;
       
    96 
       
    97 /**
       
    98 Error Code: -18004.  
       
    99 */
       
   100 const TInt KErrAvdtpClientBufferInUse = KErrAvdtpBaseError -4;
       
   101 
       
   102 /**
       
   103 Error Code: -18005.  The Acceptor did not respond to the AVDTP 
       
   104 signalling message within the period of the protocol's timeout.
       
   105 */
       
   106 const TInt KErrAvdtpRequestTimeout = KErrAvdtpBaseError -5;
       
   107 
       
   108 /**
       
   109 Error Code: -18006.
       
   110 */
       
   111 const TInt KErrAvdtpRemoteReject = KErrAvdtpBaseError -6;
       
   112 
       
   113 /**
       
   114 Error Code: -18007.  Error raised when trying to reconfigure the application 
       
   115 service parameters of an AV stream if either device is not in an OPEN state 
       
   116 as defined in the GAVDP specification.  So the error is raised when not in the 
       
   117 Ready state.
       
   118 */
       
   119 const TInt KErrAvdtpInvalidStateForReconfigure = KErrAvdtpBaseError -7;
       
   120 
       
   121 // errors from -18000 to -18045 are "locally-originated" errors
       
   122 
       
   123 /**
       
   124 Constant: -18045.  Indicates the start of the error range for AV signalling.
       
   125 Errors from -18000 to -18044 (inclusive) are "locally-originated" errors that are not sent 
       
   126 over the air and return from the AVDTP layer with an output parameter to the application 
       
   127 rather than causing an error event.
       
   128 
       
   129 Errors from -18045 to -18300 (inclusive) are "on-air" errors that are returned from the 
       
   130 AVDTP or application layers on the peer device, resulting in error events.
       
   131 */
       
   132 const TInt KErrAvdtpSignallingErrorBase = KErrAvdtpBaseError - 45;
       
   133 // the error space is divided across the AVDTP, GAVDP, A2DP and VDP specs
       
   134 // it is possible in future to have any of 255 errors on the air
       
   135 // therefore from KErrAvdtpSignallingErrorBase to -18300 downwards are "air-originated errors"
       
   136 
       
   137 // GAVDP errors start at KErrAvdtpSignallingErrorBase - 0x80
       
   138 
       
   139 // concrete profile (A2DP, VDP) errors start at KErrAvdtpSignallingErrorBase - 0xC0
       
   140 
       
   141 const TUint8 KMaxTUint6 = (1<<6) - 1;
       
   142 const TUint8 KMaxTUint5 = (1<<5) - 1;
       
   143 
       
   144 enum TAvdtpTransportSessionType
       
   145 	{
       
   146 	EMedia,
       
   147 	EReporting,
       
   148 	ERecovery,
       
   149 	ESignalling,	// not a true session as per spec
       
   150 	ENumStreamTypes // always last enumeration
       
   151 	};
       
   152 
       
   153 enum TBluetoothAVPanics
       
   154 	{
       
   155 	EBadValue,
       
   156 	};
       
   157 	
       
   158 enum TAvdtpServiceCategory
       
   159 	{
       
   160 	EServiceCategoryNull				=0x00,
       
   161 	EServiceCategoryMediaTransport 		=0x01,
       
   162 	EServiceCategoryReporting			=0x02,
       
   163 	EServiceCategoryRecovery			=0x03,
       
   164 	EServiceCategoryContentProtection	=0x04,
       
   165 	EServiceCategoryHeaderCompression	=0x05,
       
   166 	EServiceCategoryMultiplexing		=0x06,
       
   167 	EServiceCategoryMediaCodec			=0x07,
       
   168 	ENumberOfServiceCategories			=0x08,	// the number of real categories in spec
       
   169 	EAllServiceCategories				=0xff,
       
   170 	};
       
   171 	
       
   172 enum TAvdtpOptions
       
   173 	{
       
   174 	EAvdtpMediaGetMaximumPacketSize,
       
   175 	EAvdtpMediaGetMaximumReceivePacketSize,
       
   176 	};
       
   177 
       
   178 enum TAvdtpClientIoctls
       
   179 	{
       
   180 	ENotifyAvdtpMediaPacketDropped
       
   181 	};
       
   182 
       
   183 namespace SymbianBluetoothAV
       
   184 {
       
   185 /**
       
   186 As specified by Bluetooth SIG
       
   187 Depending on result of MediaType this can be used for casting
       
   188 */
       
   189 enum TBluetoothMediaType
       
   190 	{
       
   191 	EAvdtpMediaTypeAudio = 0x00,
       
   192 	EAvdtpMediaTypeVideo = 0x01,
       
   193 	EAvdtpMediaTypeMultimedia = 0x02,
       
   194 	};
       
   195 
       
   196 /**
       
   197 As specified by Bluetooth SIG
       
   198 Depending on result of MediaType this can be used for casting
       
   199 */
       
   200 enum TBluetoothAudioCodecType
       
   201 	{
       
   202 	EAudioCodecSBC = 0x00,
       
   203 	EAudioCodecMPEG12Audio = 0x01,
       
   204 	EAudioCodecMPEG24AAC = 0x02,
       
   205 	EAudioCodecATRAC = 0x04,
       
   206 	EAudioCodecNonA2DP = 0xFF,
       
   207 	};
       
   208 
       
   209 /**
       
   210 As specified by Bluetooth SIG
       
   211 Depending on result of MediaType this can be used for casting
       
   212 */
       
   213 enum TBluetoothVideoCodecType
       
   214 	{
       
   215 	EVideoCodecH263Baseline = 0x01,
       
   216 	EVideoCodecMPEG4VisualSimpleProfile = 0x02,
       
   217 	EVideoCodecH263Profile3 = 0x03,
       
   218 	EVideoCodecH263Profile8 = 0x04,
       
   219 	EVideoCodecNonVDP = 0xFF,
       
   220 	};
       
   221 
       
   222 enum TAvdtpRecoveryType
       
   223 	{
       
   224 	EForbiddenRecovery =0x00, //for checking purposes
       
   225 	ERFC2733Recovery = 0x01,
       
   226 	};
       
   227 
       
   228 /**
       
   229 Error codes relating to the Audio/Video Distribution Transport Protocol signalling messages.  Error desciptions taken from the Bluetooth SIG specification.
       
   230 These error codes are sent over the air from the Acceptor device (the device to whom the original signal was sent) 
       
   231 to the Initiator device (from which the signal originated) in a signal response message when the Acceptor rejects 
       
   232 the signalling command from the Initiator.  The rejection can come either from the Application itself or the AVDTP layer 
       
   233 (when the message cannot be interpreted).
       
   234 */
       
   235 enum TAvdtpSignallingErrorCode
       
   236 	{
       
   237 	/**
       
   238 	Error Code: -18046.  The request packet header format error is not specified above ERROR_CODE.  Related Signalling Command: All messages.
       
   239 	*/
       
   240 	EAvdtpBadHeaderFormat			=0x01,
       
   241 	
       
   242 	/**
       
   243 	Error Code: -18062.  The request packet length does not match the assumed length.  Related Signalling Command: All messages.
       
   244 	*/
       
   245 	EAvdtpBadLength					=0x11,
       
   246 
       
   247 	/**
       
   248 	Error Code: -18063.  The requested command indicates an invalid ACP Stream End Point Identifier (not addressable).  Related Signalling Command: All messages.
       
   249 	*/	
       
   250 	EAvdtpBadACPSEID				=0x12,
       
   251 	
       
   252 	/**
       
   253 	Error Code: -18064.  The Stream End Point is in use.  Related Signalling Command: Set Configuration.
       
   254 	*/	
       
   255 	EAvdtpSEPInUse					=0x13,
       
   256 	
       
   257 	/**
       
   258 	Error Code: -18065.  The Stream End Point is not in use.  Related Signalling Command: Reconfigure.
       
   259 	*/	
       
   260 	EAvdtpSepNotInUse				=0x14,
       
   261 	
       
   262 	/**
       
   263 	Error Code: -18068.  The value of Service Category in the request packet is not defined in AVDTP.  Related Signalling Command: Set Configuration, Reconfigure.
       
   264 	*/	
       
   265 	EAvdtpBadServCategory			=0x17,
       
   266 	
       
   267 	/**
       
   268 	Error Code: -18069.  The requested command has an incorrect payload format (Format errors not specified in this ERROR_CODE).  Related Signalling Command: All messages.
       
   269 	*/	
       
   270 	EAvdtpBadPayloadFormat			=0x18,
       
   271 	
       
   272 	/**
       
   273 	Error Code: -18070.  The requested command is not supported by the device.  Related Signalling Command: All messages.
       
   274 	*/	
       
   275 	EAvdtpNotSupportedCommand		=0x19,
       
   276 	
       
   277 	/**
       
   278 	Error Code: -18071.  The reconfigure command is an attempt to reconfigure transport service capabilities of the Stream End Point. Reconfigure is only permitted for application service capabilities.  Related Signalling Command: Reconfigure.
       
   279 	*/	
       
   280 	EAvdtpInvalidCapabilities		=0x1a,
       
   281 	
       
   282 	/**
       
   283 	Error Code: -18079.  The requested Recovery Type is not defined in AVDTP.  Related Signalling Command: Set Configuration.
       
   284 	*/	
       
   285 	EAvdtpBadRecoveryType			=0x22,
       
   286 	
       
   287 	/**
       
   288 	Error Code: -18080.  The format of Media Transport Capability is not correct.  Related Signalling Command: Set Configuration.
       
   289 	*/	
       
   290 	EAvdtpBadMediaTransportFormat	=0x23,
       
   291 	
       
   292 	/**
       
   293 	Error Code: -18081.  Unused.  This is not in the AVDTP specification, but appears that it should be.
       
   294 	*/	
       
   295 	EAvdtpBadReportingFormat		=0x24, // Unused - not in spec, but appears it should be!
       
   296 	
       
   297 	/**
       
   298 	Error Code: -18082.  The format of Recovery Service Capability is not correct.  Related Signalling Command: Set Configuration.
       
   299 	*/	
       
   300 	EAvdtpBadRecoveryFormat			=0x25,
       
   301 	
       
   302 	/**
       
   303 	Error Code: -18083.  The format of Header Compression Service Capability is not correct.  Related Signalling Command: Set Configuration.
       
   304 	*/	
       
   305 	EAvdtpBadRohcFormat				=0x26,
       
   306 	
       
   307 	/**
       
   308 	Error Code: -18084.  The format of Content Protection Service Capability is not correct.  Related Signalling Command: Set Configuration.
       
   309 	*/	
       
   310 	EAvdtpBadCpFormat				=0x27,
       
   311 	
       
   312 	/**
       
   313 	Error Code: -18085.  The format of Multiplexing Service Capability is not correct.  Related Signalling Command: Set Configuration.
       
   314 	*/	
       
   315 	EAvdtpBadMultiplexingFormat		=0x28,
       
   316 	
       
   317 	/**
       
   318 	Error Code: -18086.  Configuration not supported.  Related Signalling Command: Set Configuration.
       
   319 	*/	
       
   320 	EAvdtpUnsupportedConfiguration	=0x29,
       
   321 	
       
   322 	/**
       
   323 	Error Code: -18094.  Indicates that the ACP state machine is in an invalid state in order to process the signal.  Related Signalling Command: All messages.
       
   324 	*/	
       
   325 	EAvdtpBadState					=0x31
       
   326 	};
       
   327 
       
   328 /**
       
   329 Error codes relating to the Generic Audio/Video Distribution Profile signalling messages.  Error desciptions taken from the Bluetooth SIG specification.
       
   330 These error codes are sent over the air from the Acceptor device (the device to whom the original signal was sent) 
       
   331 to the Initiator device (from which the signal originated) in a signal response message when the Acceptor rejects 
       
   332 the signalling command from the Initiator.  
       
   333 
       
   334 The error range -18300 to -18237 (inclusive) is reserved for the profile sitting on top of the GAVDP.
       
   335 */	
       
   336 enum TGavdpSignallingErrorCode
       
   337 	{
       
   338 	/**
       
   339 	Error Code: -18173.  The service category stated is invalid.  Related Signalling Command: Set Configuration.
       
   340 	*/
       
   341 	EGavdpBadService			=0x80,
       
   342 	
       
   343 	/**
       
   344 	Error Code: -18174.  Lack of resource new Stream Context.  Related Signalling Command: Set Configuration.
       
   345 	*/
       
   346 	EGavdpInsufficientResource	=0x81,
       
   347 	};
       
   348 	
       
   349 	
       
   350 /**
       
   351 Error codes relating to the Advanced Audio Distribution Profile signalling messages.  Error desciptions taken from the Bluetooth SIG specification.
       
   352 These error codes are sent over the air from the Acceptor device (the device to whom the original signal was sent) 
       
   353 to the Initiator device (from which the signal originated) in a signal response message when the Acceptor rejects 
       
   354 the signalling command from the Initiator.  
       
   355 
       
   356 These error codes are used by the application if it receives commands containing relevant errors.
       
   357 
       
   358 This profile sits on top of the GAVDP and so uses the error range -18300 to -18237 (inclusive).  This range is shared with 
       
   359 other profiles that sit above GAVDP, such as VDP.
       
   360 */		
       
   361 enum TA2dpSignallingErrorCode
       
   362 	{
       
   363 	/**
       
   364 	Error Code: -18238.  Media Codec Type is not valid.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   365 	*/
       
   366 	EA2dpInvalidCodec					=0xc1,
       
   367 	
       
   368 	/**
       
   369 	Error Code: -18239.  Media Codec Type is not supported.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   370 	*/
       
   371 	EA2dpNotSupportedCodec				=0xc2,
       
   372 	
       
   373 	/**
       
   374 	Error Code: -18240.  Sampling Frequency is not valid or multiple values have been selected.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   375 	*/
       
   376 	EA2dpInvalidSamplingFrequency		=0xc3,
       
   377 	
       
   378 	/**
       
   379 	Error Code: -18241.  Sampling Frequency is not supported.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   380 	*/
       
   381 	EA2dpNotSupportedSamplingFrequency	=0xc4,
       
   382 	
       
   383 	/**
       
   384 	Error Code: -18242.  Channel Mode is not valid or multiple values have been selected.  Related Codec: SBC, MPEG-1,2 Audio, ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   385 	*/
       
   386 	EA2dpInvalidChannelMode				=0xc5,
       
   387 	
       
   388 	/**
       
   389 	Error Code: -18243.  Channel Mode is not supported.  Related Codec: SBC; MPEG-1,2 Audio; ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   390 	*/
       
   391 	EA2dpNotSupportedChannelMode		=0xc6,
       
   392 	
       
   393 	/**
       
   394 	Error Code: -18244.  None or multiple values have been selected for Number of Subbands.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure. 
       
   395 	*/
       
   396 	EA2dpInvalidSubbands				=0xc7,
       
   397 	
       
   398 	/**
       
   399 	Error Code: -18245.  Number of Subbands is not supported.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   400 	*/
       
   401 	EA2dpNotSupportedSubbands			=0xc8,
       
   402 	
       
   403 	/**
       
   404 	Error Code: -18246.  None or multiple values have been selected for Allocation Method.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.  
       
   405 	*/
       
   406 	EA2dpInvalidAllocationMethod		=0xc9,
       
   407 	
       
   408 	/**
       
   409 	Error Code: -18247.  Allocation Method is not supported.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   410 	*/
       
   411 	EA2dpNotSupportedAllocationMethod	=0xca,
       
   412 	
       
   413 	/**
       
   414 	Error Code: -18248.  Minimum Bitpool Value is not valid.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   415 	*/
       
   416 	EA2dpInvalidMinimumBitPoolValue		=0xcb,
       
   417 	
       
   418 	/**
       
   419 	Error Code: -18249.  Minimum Bitpool Value is not supported.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   420 	*/
       
   421 	EA2dpNotSupportedMinimumBitPoolValue=0xcc,
       
   422 	
       
   423 	/**
       
   424 	Error Code: -18250.  Maximum Bitpool Value is not valid.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   425 	*/
       
   426 	EA2dpInvalidMaximumBitPoolValue		=0xcd,
       
   427 	
       
   428 	/**
       
   429 	Error Code: -18251.  Maximum Bitpool Value is not supported.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   430 	*/
       
   431 	EA2dpNotSupportedMaximumBitPoolValue=0xce,
       
   432 	
       
   433 	/**
       
   434 	Error Code: -18252.  None or multiple values have been selected for Layer.  Related Codec: MPEG-1,2 Audio.  Related Signalling Command: Set Configuration, Reconfigure.
       
   435 	*/
       
   436 	EA2dpInvalidLayer					=0xcf,
       
   437 	
       
   438 	/**
       
   439 	Error Code: -18253.  Layer is not supported.  Related Codec: MPEG-1,2 Audio.  Related Signalling Command: Set Configuration, Reconfigure.
       
   440 	*/
       
   441 	EA2dpNotSupportedLayer				=0xd0,
       
   442 	
       
   443 	/**
       
   444 	Error Code: -18254.  CRC is not supported.  Related Codec: MPEG-1,2 Audio.  Related Signalling Command: Set Configuration, Reconfigure.
       
   445 	*/
       
   446 	EA2dpNotSupportedCRC				=0xd1,
       
   447 	
       
   448 	/**
       
   449 	Error Code: -18255.  MPF-2 is not supported.  Related Codec: MPEG-1,2 Audio.  Related Signalling Command: Set Configuration, Reconfigure.
       
   450 	*/
       
   451 	EA2dpNotSupportedMPF				=0xd2,
       
   452 	
       
   453 	/**
       
   454 	Error Code: -18256.  VBR is not supported.  Related Codec: MPEG-1,2 Audio; MPEG-2,4 AAC; ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   455 	*/
       
   456 	EA2dpNotSupportedVBR				=0xd3,
       
   457 	
       
   458 	/**
       
   459 	Error Code: -18257.  None or multiple values have been selected for Bit Rate.  Related Codec: MPEG-1,2 Audio; ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   460 	*/
       
   461 	EA2dpInvalidBitRate					=0xd4,
       
   462 	
       
   463 	/**
       
   464 	Error Code: -18258.  Bit Rate is not supported.  Related Codec: MPEG-1,2 Audio; MPEG-2,4 AAC; ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   465 	*/
       
   466 	EA2dpNotSupportedBitRate			=0xd5,
       
   467 	
       
   468 	/**
       
   469 	Error Code: -18259.  Either 1) Object type is not valid (b3-b0) or 2) None or multiple values have been selected for Object Type.  Related Codec: MPEG-2,4 AAC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   470 	*/
       
   471 	EA2dpInvalidObjectType				=0xd6,
       
   472 	
       
   473 	/**
       
   474 	Error Code: -18260.  Object Type is not supported.  Related Codec: MPEG-2,4 AAC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   475 	*/
       
   476 	EA2dpNotSupportedObjectType			=0xd7,
       
   477 	
       
   478 	/**
       
   479 	Error Code: -18261.  None or multiple values have been selected for Channels.  Related Codec: MPEG-2,4 AAC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   480 	*/
       
   481 	EA2dpInvalidChannels				=0xd8,
       
   482 	
       
   483 	/**
       
   484 	Error Code: -18262.  Channels is not supported.  Related Codec: MPEG-2,4 AAC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   485 	*/
       
   486 	EA2dpNotSupportedChannels			=0xd9,
       
   487 	
       
   488 	/**
       
   489 	Error Code: -18263.  Version is not valid.  Related Codec: ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   490 	*/
       
   491 	EA2dpInvalidVersion					=0xda,
       
   492 	
       
   493 	/**
       
   494 	Error Code: -18264.  Version is not supported.  Related Codec: ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   495 	*/
       
   496 	EA2dpNotSupportedVersion			=0xdb,
       
   497 	
       
   498 	/**
       
   499 	Error Code: -18265.  Maximum SUL is not acceptable for the Decoder in the SNK.  Related Codec: ATRAC family.  Related Signalling Command: Set Configuration, Reconfigure.
       
   500 	*/
       
   501 	EA2dpNotSupportedSUL				=0xdc,
       
   502 	
       
   503 	/**
       
   504 	Error Code: -18266.  None or multiple values have been selected for Block Length.  Related Codec: SBC.  Related Signalling Command: Set Configuration, Reconfigure.
       
   505 	*/
       
   506 	EA2dpInvalidBlockLength				=0xdd,
       
   507 	
       
   508 	/**
       
   509 	Error Code: -18269.  The requested CP Type is not supported.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   510 	*/
       
   511 	EA2dpInvalidCPType					=0xe0,
       
   512 	
       
   513 	/**
       
   514 	Error Code: -18270.  The format of Content Protection Service Capability/Content Protection Scheme Dependent Data is not correct.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure, Security Control.
       
   515 	*/
       
   516 	EA2dpInvalidCPFormat				=0xe1,
       
   517 	};
       
   518 	
       
   519 	
       
   520 /**
       
   521 Error codes relating to the Video Distribution Profile signalling messages.  Error desciptions taken from the Bluetooth SIG specification.
       
   522 These error codes are sent over the air from the Acceptor device (the device to whom the original signal was sent) 
       
   523 to the Initiator device (from which the signal originated) in a signal response message when the Acceptor rejects 
       
   524 the signalling command from the Initiator.  
       
   525 
       
   526 These error codes are used by the application if it receives commands containing relevant errors.
       
   527 
       
   528 This profile sits on top of the GAVDP and so uses the error range -18300 to -18237 (inclusive).  This range is shared with 
       
   529 other profiles that sit above GAVDP, such as A2DP.
       
   530 */
       
   531 enum TVdpSignallingErrorCode
       
   532 	{
       
   533 	/**
       
   534 	Error Code: -18238.  Media Codec Type is not valid.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   535 	*/
       
   536 	EVdpInvalidCodecType			=0xc1,
       
   537 	
       
   538 	/**
       
   539 	Error Code: -18239.  Media Codec Type is not supported.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   540 	*/
       
   541 	EVdpNotSupportedCodecType		=0xc2,
       
   542 	
       
   543 	/**
       
   544 	Error Code: -18240.  Level is not valid or multiple values have been selected.  Related Codec: H.263 baseline; MPEG-4 Visual Simple Profile; H.263 Profile 3; H.263 Profile 8.  Related Signalling Command: Set Configuration, Reconfigure.
       
   545 	*/
       
   546 	EVdpInvalidLevel				=0xc3,
       
   547 	
       
   548 	/**
       
   549 	Error Code: -18241.  Level is not supported.  Related Codec: H.263 baseline; MPEG-4 Visual Simple Profile; H.263 Profile 3; H.263 Profile 8.  Related Signalling Command: Set Configuration, Reconfigure.
       
   550 	*/
       
   551 	EVdpNotSupportedLevel			=0xc4,
       
   552 	
       
   553 	/**
       
   554 	Error Code: -18269.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   555 	*/
       
   556 	EVdpInvalidCPType				=0xe0,
       
   557 	
       
   558 	/**
       
   559 	Error Code: -18270.  Related Codec: All.  Related Signalling Command: Set Configuration, Reconfigure.
       
   560 	*/
       
   561 	EVdpInvalidCPFormat				=0xe1,
       
   562 	};
       
   563 
       
   564 /**
       
   565 Class used for converting signalling error codes stored in the local namespace 
       
   566 into standard system-wide error codes.  The values used locally are the same as the 
       
   567 error codes set out 
       
   568 in the various Bluetooth Profile specifications.  
       
   569 
       
   570 Marked NONSHARABLE and therefore 
       
   571 cannot be derived outside the dll.
       
   572 */
       
   573 NONSHARABLE_CLASS(ConvertToSymbianError)
       
   574 	{
       
   575 public:
       
   576 	IMPORT_C static TInt AvdtpError(TAvdtpSignallingErrorCode aAvdtpError);
       
   577 	IMPORT_C static TInt GavdpError(TGavdpSignallingErrorCode aGavdpError);
       
   578 	IMPORT_C static TInt A2dpError(TA2dpSignallingErrorCode aA2dpError);
       
   579 	IMPORT_C static TInt VdpError(TVdpSignallingErrorCode aVdpError);
       
   580 
       
   581 private:
       
   582 	static TInt DoConvertError(TBluetoothAvDistributionError aError);
       
   583 	};
       
   584 } // end SymbianBluetoothAV namespace
       
   585 
       
   586 
       
   587 namespace SymbianSBC
       
   588 {
       
   589 /*
       
   590 Mask for configuring SBC channel modes
       
   591 */
       
   592 enum TSBCChannelMode
       
   593 	{
       
   594 	EMono			= 0x8,
       
   595 	EDualChannel	= 0x4,
       
   596 	EStereo			= 0x2,
       
   597 	EJointStereo	= 0x1
       
   598 	};
       
   599 
       
   600 /*
       
   601 Mask for configuring SBC sampling frequencies
       
   602 */
       
   603 enum TSBCSamplingFrequency
       
   604 	{
       
   605 	E16kHz		= 0x8,
       
   606 	E32kHz		= 0x4,
       
   607 	E44100Hz	= 0x2,
       
   608 	E48kHz		= 0x1,
       
   609 	};
       
   610 	
       
   611 /*
       
   612 Mask for configuring SBC number of subbands
       
   613 */
       
   614 enum TSBCSubbands
       
   615 	{
       
   616 	EFourSubbands  = 0x02,
       
   617 	EEightSubbands = 0x01,
       
   618 	};
       
   619 	
       
   620 /*
       
   621 Mask for configuring SBC allocation methods
       
   622 */
       
   623 enum TSBCAllocationMethod
       
   624 	{
       
   625 	ELoudness	= 0x01,
       
   626 	ESNR		= 0x02,
       
   627 	};
       
   628 	
       
   629 	
       
   630 /*
       
   631 Mask for configuring SBC block lengths
       
   632 */
       
   633 enum TSBCBlockLength
       
   634 	{
       
   635 	EBlockLenFour 		= 0x8,
       
   636 	EBlockLenEight 		= 0x4,
       
   637 	EBlockLenTwelve		= 0x2,
       
   638 	EBlockLenSixteen	= 0x1,
       
   639 	};
       
   640 
       
   641 }  // end of namespace SymbianSBC
       
   642 
       
   643 
       
   644 
       
   645 
       
   646 typedef TUint8	TSBCChannelModeBitmask;
       
   647 typedef TUint8	TSBCAllocationMethodBitmask;
       
   648 typedef TUint8	TSBCSamplingFrequencyBitmask;
       
   649 typedef TUint8	TSBCBlockLengthBitmask;
       
   650 typedef TUint8	TSBCSubbandsBitmask;
       
   651 
       
   652 
       
   653 /**
       
   654 This constant has been deprecated in favour of RGavdp::MaxSecurityControlLength().
       
   655 
       
   656 Note however that you should call this function each time you wish to use this value rather than storing 
       
   657 copy because the actual value is subject to change.
       
   658 
       
   659 @deprecated
       
   660 */
       
   661 const TInt KMaxAvdtpSecurityControlInfo = 255; // our defn: spec doesnt give a max.
       
   662 
       
   663 typedef TBuf8<KMaxAvdtpSecurityControlInfo> TAvdtpSecurityControlInfo;
       
   664 
       
   665 
       
   666 /**
       
   667 An AVDTP Socket Address is composed of a Bluetooth device address, 
       
   668 an AVDTP session type (eg Media, Reporting or Recovery), and a SEID.
       
   669 */
       
   670 NONSHARABLE_CLASS(TAvdtpSockAddr) : public TBTSockAddr
       
   671 	{
       
   672 public:
       
   673 	IMPORT_C TAvdtpSockAddr();
       
   674 	IMPORT_C explicit TAvdtpSockAddr(const TSockAddr& aSockAddr);
       
   675 	IMPORT_C static TAvdtpSockAddr& Cast(const TSockAddr& aSockAddr);
       
   676 	IMPORT_C void SetSession(TAvdtpTransportSessionType aSession);
       
   677 	IMPORT_C TAvdtpTransportSessionType Session() const;
       
   678 	IMPORT_C void SetSEID(TSEID aSEID);
       
   679 	IMPORT_C TSEID SEID() const;
       
   680 	};
       
   681 
       
   682 /**
       
   683 Used for casting the descriptor passed in the MGavdpUser::GAVDP_Error callback
       
   684 Allows the client (knowing the previously sent GAVDP primitive) to decode extended errors
       
   685 */	
       
   686 struct TAvdtpConfigReject
       
   687 	{
       
   688 	TInt iError;
       
   689 	TAvdtpServiceCategory iFailedCategory;
       
   690 	};
       
   691 	
       
   692 typedef TPckgBuf<TAvdtpConfigReject> TAvdtpConfigRejectPckgBuf;
       
   693 
       
   694 typedef TUint TAvdtpServiceCatBitMask;
       
   695 
       
   696 static const TInt KServiceCatLOSCRecovery 			= 3;
       
   697 static const TInt KServiceCatLOSCHeaderCompression 	= 1;
       
   698 static const TInt KServiceCatLOSCMediaCodecMinimum	= 2;
       
   699 static const TInt KServiceCatLOSCMediaCodecMaximum	= KMaxTUint8;
       
   700 static const TInt KServiceCatLOSCSBCCodec			= 4+KServiceCatLOSCMediaCodecMinimum;
       
   701 
       
   702 
       
   703 NONSHARABLE_CLASS(TAvdtpSEPInfo)
       
   704 	{
       
   705 public:
       
   706 	IMPORT_C TAvdtpSEPInfo();
       
   707 
       
   708 	IMPORT_C TSEID SEID() const;
       
   709 	IMPORT_C TBool InUse() const;
       
   710 	IMPORT_C SymbianBluetoothAV::TBluetoothMediaType MediaType() const;
       
   711 	IMPORT_C TBool IsSink() const;
       
   712 
       
   713 	IMPORT_C void SetSEID(TSEID aSEID);
       
   714 	IMPORT_C void SetInUse(TBool aIsInUse);
       
   715 	IMPORT_C void SetMediaType(SymbianBluetoothAV::TBluetoothMediaType aMediaType);
       
   716 	IMPORT_C void SetIsSink(TBool aIsSink);
       
   717 
       
   718 private:
       
   719 	TSEID				iSEID;
       
   720 	TBool				iInUse;
       
   721 	SymbianBluetoothAV::TBluetoothMediaType	iMediaType;
       
   722 	TBool				iIsSink;
       
   723 	};
       
   724 		
       
   725 
       
   726 /**
       
   727 This is a base class for AVDTP Service Capabilities as described in the Bluetooth AVDTP specification.
       
   728 This can be derived externally, but no support is provided for Capabilities not described in v1.0 of 
       
   729 the AVDTP specification.
       
   730 @see RGavdp
       
   731 */	
       
   732 class TAvdtpServiceCapability
       
   733 	{
       
   734 public:
       
   735 	IMPORT_C TAvdtpServiceCategory Category() const; // not inline to assist BC
       
   736 	
       
   737 	/**AsProtocol() is for Symbian use only
       
   738 	This method is not to be used otherwise.
       
   739 	@internalTechnology
       
   740 	*/
       
   741 	virtual TInt AsProtocol(RBuf8& aBuffer) const =0;	// write into buffer as per protocol
       
   742 	
       
   743 	IMPORT_C static TAvdtpServiceCapability* AllocFromPDUL(TAvdtpServiceCategory aCat, const TDesC8& aDes);
       
   744 	IMPORT_C static TAvdtpServiceCapability* AllocFromPckgL(const TDesC8& aDes);
       
   745 	
       
   746 	/**Parse() is for Symbian use only
       
   747 	This method is not to be used otherwise.
       
   748 	@internalTechnology
       
   749 	*/
       
   750 	IMPORT_C virtual void Parse(const TDesC8& aPtr);
       
   751 
       
   752 protected:
       
   753 	IMPORT_C TAvdtpServiceCapability(TAvdtpServiceCategory aCat, TInt aLOSC=KMaxTInt);
       
   754 	TInt AddHeader(RBuf8& aBuffer) const;
       
   755 
       
   756 protected:
       
   757 	mutable TInt iLOSC;	// Length of Service Capability
       
   758 
       
   759 private:
       
   760 	TAvdtpServiceCategory	iCategory;
       
   761 	};
       
   762 		
       
   763 /**
       
   764 Represents the Media Transport Capability of AVDTP.
       
   765 */
       
   766 NONSHARABLE_CLASS(TAvdtpMediaTransportCapabilities) : public TAvdtpServiceCapability
       
   767 	{
       
   768 public:
       
   769 	IMPORT_C TAvdtpMediaTransportCapabilities();
       
   770 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   771 	};
       
   772 
       
   773 /**
       
   774 Represents the Reporting Capability of AVDTP.
       
   775 */
       
   776 NONSHARABLE_CLASS(TAvdtpReportingCapabilities) : public TAvdtpServiceCapability
       
   777 	{
       
   778 public:
       
   779 	IMPORT_C TAvdtpReportingCapabilities();
       
   780 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   781 	};
       
   782 
       
   783 
       
   784 typedef TUint8 TAvdtpRecoveryWindowSize;
       
   785 
       
   786 /**
       
   787 Represents the Recovery Capability of AVDTP.
       
   788 */
       
   789 NONSHARABLE_CLASS(TAvdtpRecoveryCapabilities) : public TAvdtpServiceCapability
       
   790 	{
       
   791 public:
       
   792 	IMPORT_C TAvdtpRecoveryCapabilities();
       
   793 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   794 
       
   795 	IMPORT_C SymbianBluetoothAV::TAvdtpRecoveryType RecoveryType() const;
       
   796 	IMPORT_C void SetRecoveryType(SymbianBluetoothAV::TAvdtpRecoveryType aType);
       
   797 	
       
   798 	IMPORT_C TAvdtpRecoveryWindowSize MaxWindowSize() const;
       
   799 	//This runs client-side - panic bad values, no return error needed
       
   800 	IMPORT_C void SetMaxWindowSize(TAvdtpRecoveryWindowSize aSize);
       
   801 	
       
   802 	IMPORT_C TAvdtpRecoveryWindowSize MinWindowSize() const;
       
   803 	//This runs client-side - panic bad values
       
   804 	IMPORT_C void SetMinWindowSize(TAvdtpRecoveryWindowSize aSize);
       
   805 
       
   806 	virtual void Parse(const TDesC8& aPtr);
       
   807 
       
   808 private:
       
   809 	SymbianBluetoothAV::TAvdtpRecoveryType iRecoveryType;
       
   810 	TAvdtpRecoveryWindowSize		iMaximumRecoveryWindowSize;
       
   811 	TAvdtpRecoveryWindowSize		iMinimumRecoveryWindowSize;
       
   812 	};
       
   813 	
       
   814 /**
       
   815 Represents the Media Codec Capability of AVDTP.
       
   816 */
       
   817 NONSHARABLE_CLASS(TAvdtpMediaCodecCapabilities) : public TAvdtpServiceCapability
       
   818 	{
       
   819 public:
       
   820 	IMPORT_C SymbianBluetoothAV::TBluetoothMediaType MediaType() const;
       
   821 	IMPORT_C TBluetoothMediaCodecType MediaCodecType() const;
       
   822 	//factory for derived class
       
   823 	static TAvdtpMediaCodecCapabilities* AllocCodecFromPDUL(const TDesC8& aBuf);
       
   824 	IMPORT_C virtual void Parse(const TDesC8& aPtr);
       
   825 
       
   826 protected:
       
   827 	//remain abstract - derivers must specify their LOSC
       
   828 	TAvdtpMediaCodecCapabilities(SymbianBluetoothAV::TBluetoothMediaType aMediaType,
       
   829 									TBluetoothMediaCodecType aCodecType, TInt aLOSC);
       
   830 
       
   831 protected:
       
   832 	SymbianBluetoothAV::TBluetoothMediaType iMediaType;
       
   833 	TBluetoothMediaCodecType iMediaCodecType;
       
   834 	};
       
   835 	
       
   836 	
       
   837 /**
       
   838 Represents the Content Protection Capability of AVDTP.
       
   839 So this capability at present doesn't parse to anything interesting, it just has a 
       
   840 setter for CP type and trailing data
       
   841 */
       
   842 NONSHARABLE_CLASS(TAvdtpContentProtectionCapabilities) : public TAvdtpServiceCapability
       
   843 	{
       
   844 public:
       
   845 	IMPORT_C TAvdtpContentProtectionCapabilities();
       
   846 	IMPORT_C TUint16 ContentProtectionType() const;
       
   847 	IMPORT_C void SetContentProtectionType(TUint16 aCPType);
       
   848 	IMPORT_C const TDesC8& ContentProtectionData() const;
       
   849 	IMPORT_C void SetContentProtectionData(const TDesC8& aData);
       
   850 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   851 	IMPORT_C void Parse(const TDesC8& aPtr);
       
   852 	
       
   853 private:
       
   854 	TUint16	iCPType;
       
   855 	TBuf8<KMaxAvdtpSecurityControlInfo>	iCPData;
       
   856 	const TInt KMinContentProtectionLOSC;
       
   857 	};
       
   858 	
       
   859 /**
       
   860 Represents the Header Compression Capability of AVDTP.
       
   861 */
       
   862 NONSHARABLE_CLASS(TAvdtpHeaderCompressionCapabilities) : public TAvdtpServiceCapability
       
   863 	{
       
   864 public:
       
   865 	IMPORT_C TAvdtpHeaderCompressionCapabilities();
       
   866 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   867 	
       
   868 	IMPORT_C TBool Media() const;
       
   869 	IMPORT_C TBool Recovery() const;
       
   870 	IMPORT_C TBool BackChannel() const;
       
   871 	
       
   872 	IMPORT_C void SetCapabilities(TBool aMedia,TBool aRecovery,TBool aBackChannel);
       
   873 
       
   874 	virtual void Parse(const TDesC8& aPtr);	
       
   875 private:
       
   876 	TBool	iMedia;
       
   877 	TBool	iRecovery;
       
   878 	TBool	iBackChannel;
       
   879 	};
       
   880 	
       
   881 //Not muxing - stack looks after it
       
   882 
       
   883 /**
       
   884 Class to configure GAVDP SEPs supporting the SBC codec
       
   885 @see RGavdp
       
   886 */
       
   887 NONSHARABLE_CLASS(TSBCCodecCapabilities) : public TAvdtpMediaCodecCapabilities
       
   888 	{
       
   889 public:
       
   890 	IMPORT_C TSBCCodecCapabilities();
       
   891 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   892 	
       
   893 	IMPORT_C TSBCSamplingFrequencyBitmask SamplingFrequencies() const;
       
   894 	IMPORT_C void SetSamplingFrequencies(TSBCSamplingFrequencyBitmask aSampFreq);
       
   895 	
       
   896 	IMPORT_C TSBCChannelModeBitmask ChannelModes() const;
       
   897 	IMPORT_C void SetChannelModes(TSBCChannelModeBitmask aChModes);
       
   898 	
       
   899 	IMPORT_C TSBCBlockLengthBitmask BlockLengths() const;
       
   900 	IMPORT_C void SetBlockLengths(TSBCBlockLengthBitmask aBlkLens);
       
   901 	
       
   902 	IMPORT_C TSBCSubbandsBitmask Subbands() const;
       
   903 	IMPORT_C void SetSubbands(TSBCSubbandsBitmask aSubbands);
       
   904 	
       
   905 	IMPORT_C TSBCAllocationMethodBitmask AllocationMethods() const;
       
   906 	IMPORT_C void SetAllocationMethods(TSBCAllocationMethodBitmask aAllocMeths);
       
   907 	
       
   908 	IMPORT_C TInt MinBitpoolValue() const;
       
   909 	IMPORT_C void SetMinBitpoolValue(TInt aMinBP);
       
   910 	
       
   911 	IMPORT_C TInt MaxBitpoolValue() const;
       
   912 	IMPORT_C void SetMaxBitpoolValue(TInt aMaxBP);
       
   913 	
       
   914 	IMPORT_C virtual void Parse(const TDesC8& aPtr);
       
   915 	
       
   916 private:
       
   917 	TSBCSamplingFrequencyBitmask	iSamplingFrequencies;
       
   918 	TSBCChannelModeBitmask 			iChannelModes;
       
   919 	TSBCBlockLengthBitmask			iBlockLengths;
       
   920 	TSBCSubbandsBitmask				iSubbands;
       
   921 	TSBCAllocationMethodBitmask 	iAllocationMethod;
       
   922 	TInt 							iMinimumBitpoolValue;
       
   923 	TInt 							iMaximumBitpoolValue;
       
   924 	};
       
   925 	
       
   926 /**
       
   927 Allows any other codec - but without handy getters and setters
       
   928 SBC will dominate heavily in SymbianOS A2DP, but this provided for further extension
       
   929 without need for recompilation (which would be the way to support codecs in a more friendly manner)
       
   930 @see RGavdp
       
   931 */	
       
   932 class TNonSBCCodecCapabilities : public TAvdtpMediaCodecCapabilities
       
   933 	{
       
   934 public:
       
   935 	IMPORT_C TNonSBCCodecCapabilities(SymbianBluetoothAV::TBluetoothMediaType aMediaType,
       
   936 										TBluetoothMediaCodecType aCodecType);
       
   937 	IMPORT_C virtual TInt AsProtocol(RBuf8& aBuffer) const;
       
   938 	IMPORT_C const TDesC8& CodecData() const;
       
   939 	IMPORT_C void SetCodecData(const TDesC8& aData);
       
   940 
       
   941 	IMPORT_C virtual void Parse(const TDesC8& aPtr);	
       
   942 private:
       
   943 	TBuf8<KServiceCatLOSCMediaCodecMaximum>	iCodecData;
       
   944 	};
       
   945 /*
       
   946 Allows for specification of >1 category
       
   947 */
       
   948 NONSHARABLE_CLASS(TAvdtpServiceCategories)
       
   949 	{
       
   950 public:
       
   951 	IMPORT_C TAvdtpServiceCategories();
       
   952 	IMPORT_C TAvdtpServiceCatBitMask operator()() const;
       
   953 	IMPORT_C void SetCapability(TAvdtpServiceCategory aCategory);
       
   954 	IMPORT_C void ClearCapability(TAvdtpServiceCategory aCategory);
       
   955 	IMPORT_C TBool CapabilityPresent(TAvdtpServiceCategory aCategory) const;
       
   956 private:
       
   957 	TAvdtpServiceCatBitMask iCategories;
       
   958 	};
       
   959 
       
   960 #endif //BLUETOOTHAV