epoc32/include/mw/obexconstants.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/obexconstants.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
williamr@2
    17
williamr@2
    18
/**
williamr@2
    19
 @file
williamr@2
    20
 @publishedAll
williamr@2
    21
 @released
williamr@2
    22
*/
williamr@2
    23
williamr@2
    24
#ifndef __OBEXCONSTANTS_H
williamr@2
    25
#define __OBEXCONSTANTS_H
williamr@2
    26
williamr@2
    27
#include <e32std.h>
williamr@2
    28
#include <es_sock.h>
williamr@2
    29
#include <ir_sock.h>
williamr@2
    30
#include <bt_sock.h>
williamr@2
    31
#include <obexpanics.h>
williamr@2
    32
williamr@2
    33
//common to request & resp digests
williamr@2
    34
williamr@2
    35
/** @internalComponent */
williamr@2
    36
const TInt KChallResponseSize = 58;
williamr@2
    37
/** @internalComponent */
williamr@2
    38
const TInt KMinChallResponseSize = 18; //Nonce(16) + tag(1) + size(1)
williamr@2
    39
/** @internalComponent */
williamr@2
    40
const TInt KObexNonceSize = 16;
williamr@2
    41
/** @internalComponent */
williamr@2
    42
const TUint8 KObexRequireUID = 0x01;
williamr@2
    43
williamr@2
    44
//request or chall
williamr@2
    45
/** @internalComponent */
williamr@2
    46
const TUint KObexChallNonceTag = 0;
williamr@2
    47
/** @internalComponent */
williamr@2
    48
const TUint8 KObexChallOptionsTag = 0x01;
williamr@2
    49
/** @internalComponent */
williamr@2
    50
const TUint8 KObexChallRealmTag = 0x02;
williamr@2
    51
/** @internalComponent */
williamr@2
    52
const TInt KObexChallOptionSize = 1; //this can't be changed from one without making
williamr@2
    53
/** @internalComponent */
williamr@2
    54
const TUint KObexChallHeaderSize = 23; //assuming no Realm data
williamr@2
    55
williamr@2
    56
//response
williamr@2
    57
/** @internalComponent */
williamr@2
    58
const TUint KObexRespTag = 0;
williamr@2
    59
/** @internalComponent */
williamr@2
    60
const TInt KObexRespSize = 16;
williamr@2
    61
/** @internalComponent */
williamr@2
    62
const TUint8 KObexRespUserIDTag = 0x01;
williamr@2
    63
/** @internalComponent */
williamr@2
    64
const TUint8 KObexRespNonceTag = 0x02;
williamr@2
    65
williamr@2
    66
/** @internalComponent */
williamr@2
    67
const TUint8 KObexHeaderTypeMask = 0xc0;
williamr@2
    68
/** @internalComponent */
williamr@2
    69
const TUint8 KObexHeaderTypeOffset = 6;
williamr@2
    70
williamr@2
    71
#ifdef _UNICODE
williamr@2
    72
/** @internalComponent */
williamr@2
    73
const TInt KUidOBEXTransportModule = 0x10003d56;
williamr@2
    74
#else
williamr@2
    75
/** @internalComponent */
williamr@2
    76
const TInt KUidOBEXTransportModule = 0x1000169c;
williamr@2
    77
#endif
williamr@2
    78
williamr@2
    79
/** @internalComponent */
williamr@2
    80
const TInt KUsbIntStringDescLength = 30;
williamr@2
    81
williamr@2
    82
/** @internalComponent */
williamr@2
    83
const TUint8 KFourByteTimeHeaderAddress = 0xc4;
williamr@2
    84
williamr@2
    85
// Header mask definitions.
williamr@2
    86
// Old style accessor for which headers are present or
williamr@2
    87
// should be sent by an object.  Now deprecated, use the
williamr@2
    88
// header iterator instead.
williamr@2
    89
/** @internalComponent */
williamr@2
    90
const TUint16 KObexHdrName				= 0x0001;
williamr@2
    91
/** @internalComponent */
williamr@2
    92
const TUint16 KObexHdrType				= 0x0002;
williamr@2
    93
/** @internalComponent */
williamr@2
    94
const TUint16 KObexHdrLength			= 0x0004;
williamr@2
    95
/** @internalComponent */
williamr@2
    96
const TUint16 KObexHdrTime				= 0x0008;
williamr@2
    97
/** @internalComponent */
williamr@2
    98
const TUint16 KObexHdrDescription		= 0x0010;
williamr@2
    99
/** @internalComponent */
williamr@2
   100
const TUint16 KObexHdrTarget			= 0x0020;
williamr@2
   101
/** @internalComponent */
williamr@2
   102
const TUint16 KObexHdrConnectionID		= 0x0040;
williamr@2
   103
/** @internalComponent */
williamr@2
   104
const TUint16 KObexHdrBody				= 0x0080;
williamr@2
   105
/** @internalComponent */
williamr@2
   106
const TUint16 KObexHdrEndOfBody			= 0x0100;
williamr@2
   107
/** @internalComponent */
williamr@2
   108
const TUint16 KObexHdrHttp				= 0x0200;
williamr@2
   109
/** @internalComponent */
williamr@2
   110
const TUint16 KObexHdrAppParam			= 0x0400;
williamr@2
   111
/** @internalComponent */
williamr@2
   112
const TUint16 KObexHdrUserDefined		= 0x0800;
williamr@2
   113
/** @internalComponent */
williamr@2
   114
const TUint16 KObexHdrCount				= 0x1000;
williamr@2
   115
/** @internalComponent */
williamr@2
   116
const TUint16 KObexHdrCreatorID			= 0x2000;
williamr@2
   117
/** @internalComponent */
williamr@2
   118
const TUint16 KObexHdrWanUUID			= 0x4000;
williamr@2
   119
/** @internalComponent */
williamr@2
   120
const TUint16 KObexHdrObjectClass		= 0x8000;
williamr@2
   121
williamr@2
   122
/** @internalComponent */
williamr@2
   123
const TUint8  KObexUserDefinedHdrAddrMin	 = 0x30; //start of user defined header address range
williamr@2
   124
/** @internalComponent */
williamr@2
   125
const TUint8  KObexUserDefinedHdrAddrMax	 = 0x3F; //end of user defined header address range
williamr@2
   126
williamr@2
   127
/** @internalComponent */
williamr@2
   128
const TUint8 KObexVersion           	= 0x10;		///< Version 1.0 (still correct for Obex spec v 1.2)
williamr@2
   129
williamr@2
   130
/** @internalComponent */
williamr@2
   131
const TUint8 KObexObjectFieldSize   	= 127;
williamr@2
   132
/** @internalComponent */
williamr@2
   133
const TUint8 KObexObjectDescriptionSize = 255;
williamr@2
   134
williamr@2
   135
// Extended errors for IrObex
williamr@2
   136
williamr@2
   137
/** Must not use as not in the allocated range */
williamr@2
   138
const TInt KErrIrObexRespBase			= - 5500; 
williamr@2
   139
williamr@2
   140
/** Extended error for IrObex - No other infrared device found */
williamr@2
   141
const TInt KErrIrObexClientNoDevicesFound = -5501;
williamr@2
   142
williamr@2
   143
/** Extended error for IrObex - Other IR device cannot handle IrObex */
williamr@2
   144
const TInt KErrIrObexClientPeerDoesNotHaveObex = -5502;
williamr@2
   145
williamr@2
   146
/** Extended error for IrObex - Other IR device aborted the transfer */
williamr@2
   147
const TInt KErrIrObexClientPutPeerAborted	= -5503;
williamr@2
   148
williamr@2
   149
/** Extended error for IrObex - Peer device aborted data transmission/obex sending */
williamr@2
   150
const TInt KErrIrObexServerPutPeerAborted = -5507;
williamr@2
   151
williamr@2
   152
/** Extended error for IrObex - Cannot authorise the challenge so link dropped */
williamr@2
   153
const TInt KErrIrObexConnectChallRejected = -5512;
williamr@2
   154
williamr@2
   155
// Other Obex errors defined in the system but no longer used
williamr@2
   156
// Do not reuse the number!
williamr@2
   157
// KErrIrObexClientPutPeerCannotHandleObject -5504
williamr@2
   158
// KErrIrObexServerPutFileWriteError		-5509
williamr@2
   159
// KErrIrObexClientFirstPutFailed			-5510
williamr@2
   160
// KErrIrObexClientSubsequentPutFailed		-5511
williamr@2
   161
williamr@2
   162
/** Unexpected event for the given state */
williamr@2
   163
const TInt KErrIrObexBadEvent = -5513;
williamr@2
   164
williamr@2
   165
/** Event occurred while Server is stopped */
williamr@2
   166
const TInt KErrIrObexServerStopped = -5514;
williamr@2
   167
williamr@2
   168
/** Packet received while state machine is in a wait state */
williamr@2
   169
const TInt KErrIrObexPacketDuringWait = -5515;
williamr@2
   170
williamr@2
   171
// There are other error codes defined at the end of this file,
williamr@2
   172
// which are a direct mapping of specific Obex error codes and
williamr@2
   173
// are returned by the client.
williamr@2
   174
williamr@2
   175
williamr@2
   176
// Flags used by Connect
williamr@2
   177
// ...None in OBEX 1.0
williamr@2
   178
williamr@2
   179
// Flags used by SetPath
williamr@2
   180
/** @internalComponent */
williamr@2
   181
const TUint8 KObexSetPathParent	= 0x01;
williamr@2
   182
williamr@2
   183
/**
williamr@2
   184
Version number for TObexTransportInfo and derived classes.  
williamr@2
   185
When iVersion is set to this value the following fields of TObexTransportInfo  
williamr@2
   186
must be set:
williamr@2
   187
iTransportName, 
williamr@2
   188
iReceiveMtu
williamr@2
   189
iTransmitMtu
williamr@2
   190
The iVersion member variable must be set to this value. If in future any of the 
williamr@2
   191
iFuture variables are used a new version constant will be created.
williamr@2
   192
williamr@2
   193
@see TObexTransportInfo
williamr@2
   194
@publishedAll
williamr@2
   195
@released
williamr@2
   196
*/
williamr@2
   197
const TInt KObexTransportInfoVersion0 = 0;	
williamr@2
   198
williamr@2
   199
/**
williamr@2
   200
Default for the receive and transmit MTU sizes
williamr@2
   201
Use this default value for setting the iReceiveMtu or iTransmitMtu in TObexTransportInfo
williamr@2
   202
objects or derived classes.
williamr@2
   203
williamr@2
   204
@see TObexTransportInfo
williamr@2
   205
@publishedAll
williamr@2
   206
@released
williamr@2
   207
*/
williamr@2
   208
const TInt KObexDefaultMtuSize = 4000;
williamr@2
   209
williamr@2
   210
/**
williamr@2
   211
Default value for the number of discovery slots to use.  Use this value as a default 
williamr@2
   212
for iDiscoverySlots in TObexIrdaV2TransportInfo.  
williamr@2
   213
williamr@2
   214
@see TObexIrdaV2TransportInfo
williamr@2
   215
@publishedAll
williamr@2
   216
@released
williamr@2
   217
*/
williamr@2
   218
const TUint KObexIrdaDefaultDiscoverySlotsToUse = 1;
williamr@2
   219
williamr@2
   220
/**
williamr@2
   221
Default value for the number of discovery attempts made.  Use this value as a default for iDiscoveryAttempts
williamr@2
   222
in TObexIrdaV2TransportInfo.  
williamr@2
   223
@see TObexIrdaV2TransportInfo
williamr@2
   224
@publishedAll
williamr@2
   225
@released
williamr@2
   226
*/
williamr@2
   227
const TUint KObexIrdaDefaultDiscoveryAttempts = 4;
williamr@2
   228
williamr@2
   229
// Constants used to define which transport Obex will run over.
williamr@2
   230
// Used in TObexTransportInfo and TObexProtocolInfo's iTransport member.
williamr@2
   231
williamr@2
   232
/**
williamr@2
   233
Protocol string when running over IrDA
williamr@2
   234
@see TObexIrProtocolInfo
williamr@2
   235
@see TObexTransportInfo
williamr@2
   236
@publishedAll
williamr@2
   237
@released
williamr@2
   238
*/
williamr@2
   239
_LIT(KObexIrTTPProtocol, "IrTinyTP");
williamr@2
   240
williamr@2
   241
/**
williamr@2
   242
Protocol string when running over IrDA
williamr@2
   243
Using this version indicates that the configuration object contains discovery parameters.
williamr@2
   244
@see TObexIrProtocolInfo
williamr@2
   245
@publishedAll
williamr@2
   246
@released
williamr@2
   247
*/
williamr@2
   248
_LIT(KObexIrTTPProtocolV2, "IrTinyTP-V2");
williamr@2
   249
williamr@2
   250
/**
williamr@2
   251
Protocol string when running over IrDA
williamr@2
   252
Using this version indicates that the configuration object contains the device nickname.
williamr@2
   253
@see TObexIrProtocolInfo
williamr@2
   254
@publishedAll
williamr@2
   255
williamr@2
   256
@capability WriteDeviceData If the TObexIrV3TransportInfo is passed as the argument
williamr@2
   257
                            to CObexServer::NewL or CObexClient::NewL and the associated 
williamr@2
   258
                            name is valid.
williamr@2
   259
@released
williamr@2
   260
*/
williamr@2
   261
_LIT(KObexIrTTPProtocolV3, "IrTinyTP-V3");
williamr@2
   262
williamr@2
   263
/**
williamr@2
   264
Protocol string when running over Bluetooth
williamr@2
   265
@see TObexBluetoothProtocolInfo
williamr@2
   266
@see TObexTransportInfo
williamr@2
   267
@publishedAll
williamr@2
   268
@released
williamr@2
   269
*/
williamr@2
   270
_LIT(KObexRfcommProtocol, "RFCOMM");
williamr@2
   271
williamr@2
   272
/**
williamr@2
   273
Protocol string when running over USB
williamr@2
   274
@see TObexUsbProtocolInfo
williamr@2
   275
@see TObexTransportInfo
williamr@2
   276
@publishedAll
williamr@2
   277
@released
williamr@2
   278
*/
williamr@2
   279
_LIT(KObexUsbProtocol, "USB");
williamr@2
   280
williamr@2
   281
/**
williamr@2
   282
Place holder for...
williamr@2
   283
protocol string that should be used 
williamr@2
   284
if a Win32 emulator USB transport were 
williamr@2
   285
to be created for testing.
williamr@2
   286
@see TObexUsbProtocolInfo
williamr@2
   287
@see TObexTransportInfo
williamr@2
   288
@publishedAll
williamr@2
   289
@released
williamr@2
   290
*/
williamr@2
   291
_LIT(KObexWin32UsbProtocol, "Win32Usb");
williamr@2
   292
williamr@2
   293
/**
williamr@2
   294
Protocol string when running over USB using client driver extensions
williamr@2
   295
@see TObexUsbProtocolInfoV2
williamr@2
   296
@see TObexTransportInfo
williamr@2
   297
@publishedAll
williamr@2
   298
@released
williamr@2
   299
*/
williamr@2
   300
_LIT(KObexUsbProtocolV2, "USB-V2");
williamr@2
   301
williamr@2
   302
/** 
williamr@2
   303
This class is derived for each underlying transport protocol OBEX 
williamr@2
   304
runs over.
williamr@2
   305
williamr@2
   306
The iTransport member holds the unique name for the transport. For example for
williamr@2
   307
infra-red (TinyTP) this is "IrTinyTP" or KObexIrTTPProtocol.
williamr@2
   308
williamr@2
   309
@see TObexIrProtocolInfo for running over TinyTP
williamr@2
   310
@see TObexBluetoothProtocolInfo for running over Rfcomm
williamr@2
   311
@see TObexUsbProtocolInfo for running over USB
williamr@2
   312
@see TObexUsbProtocolInfoV2 for running over USB using client driver extensions
williamr@2
   313
williamr@2
   314
@see KObexIrTTPProtocol
williamr@2
   315
@see KObexIrTTPProtocolV2
williamr@2
   316
@see KObexRfcommProtocol
williamr@2
   317
@see KObexUsbProtocol
williamr@2
   318
@see KObexUsbProtocolV2
williamr@2
   319
williamr@2
   320
@publishedAll
williamr@2
   321
@released
williamr@2
   322
*/
williamr@2
   323
NONSHARABLE_CLASS(TObexProtocolInfo)
williamr@2
   324
	{
williamr@2
   325
public:
williamr@2
   326
	/** Holds the unique name for the transport. */
williamr@2
   327
	TBuf<60> iTransport;
williamr@2
   328
private:
williamr@2
   329
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   330
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   331
	TUint32     iPadding1; 
williamr@2
   332
	TUint32     iPadding2; 		
williamr@2
   333
	};
williamr@2
   334
williamr@2
   335
/** 
williamr@2
   336
Used to describe IrDA specific protocol information
williamr@2
   337
	
williamr@2
   338
To access the default OBEX server, the IAS class value should be "OBEX"
williamr@2
   339
and the IAS attribute name "IrDA:TinyTP:LsapSel". 
williamr@2
   340
williamr@2
   341
@publishedAll
williamr@2
   342
@released
williamr@2
   343
*/
williamr@2
   344
NONSHARABLE_CLASS(TObexIrProtocolInfo) : public TObexProtocolInfo
williamr@2
   345
	{
williamr@2
   346
public:
williamr@2
   347
	/** IrDA address information for this connection, as used in the IrDA sockets interface.
williamr@2
   348
	Refer to the SDK for more information about this.
williamr@2
   349
	Its main use is for setting the port that the local machine will listen on. */
williamr@2
   350
	TIrdaSockAddr iAddr;
williamr@2
   351
	/** The IAS class value that the OBEX session will register its listener port,
williamr@2
   352
	or request remote port with. */
williamr@2
   353
	TBuf8<KIASClassNameMax> iClassName;
williamr@2
   354
	/** The IAS attribute value that the OBEX session will register its listener port,
williamr@2
   355
	or request remote port with. */
williamr@2
   356
	TBuf8<KIASAttributeNameMax> iAttributeName;
williamr@2
   357
	/** The number of discovery slots to use. */
williamr@2
   358
	TUint8 iDiscoverySlots;
williamr@2
   359
	/** The number of discovery attempts to make. */
williamr@2
   360
	TUint8 iDiscoveryAttempts;
williamr@2
   361
williamr@2
   362
private:
williamr@2
   363
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   364
	// None of these padding variables have been zero'd because they are currently not used
williamr@2
   365
	TUint16     iPadding1; 
williamr@2
   366
	TUint32     iPadding2; 		
williamr@2
   367
	TUint32     iPadding3; 
williamr@2
   368
	TUint32     iPadding4; 	
williamr@2
   369
	};
williamr@2
   370
williamr@2
   371
/** 
williamr@2
   372
Used to describe Bluetooth specific protocol information
williamr@2
   373
	
williamr@2
   374
@publishedAll
williamr@2
   375
@released
williamr@2
   376
*/
williamr@2
   377
NONSHARABLE_CLASS(TObexBluetoothProtocolInfo) : public TObexProtocolInfo
williamr@2
   378
	{
williamr@2
   379
public:
williamr@2
   380
	/** 
williamr@2
   381
	For OBEX servers:
williamr@2
   382
	This defines the server channel on which the OBEX server listens 
williamr@2
   383
	for connections. The server channel is set using SetPort on the 
williamr@2
   384
	TRfcommSockAddr.
williamr@2
   385
	Note:
williamr@2
   386
	1) Unless the channel is defined as KRfcommPassiveAutoBind 
williamr@2
   387
	it may be in use when the obex server attempts to 'bind' to it
williamr@2
   388
	2) If the channel is defined as KRfcommPassiveAutoBind 
williamr@2
   389
	then when the server is FIRST started it will attempt 
williamr@2
   390
	to find a free RFComm channel. If this is successful 
williamr@2
   391
	that free channel will be used as the server channel 
williamr@2
   392
	for the life time of the obex server including
williamr@2
   393
	when it is 'stopped' and re-'started'.
williamr@2
   394
	3) When the obex server is stopped, and very
williamr@2
   395
	briefly when a bluetooth connection comes down, the
williamr@2
   396
	obex server releases its server channel. It is possible
williamr@2
   397
	therefore that during this time another application might bind
williamr@2
   398
	to it. This will cause an error when the obex server tries
williamr@2
   399
	to re-bind.
williamr@2
   400
williamr@2
   401
	Also note that a Bluetooth OBEX server will itself set the Object Transfer
williamr@2
   402
	bit in the Service Class as required by the Generic Object Exchange
williamr@2
   403
	Profile so the user need not do this.	
williamr@2
   404
	@see CObexServer
williamr@2
   405
	
williamr@2
   406
	For OBEX clients:
williamr@2
   407
	This defines the server channel and the 
williamr@2
   408
	device address to connect to. The server channel 
williamr@2
   409
	and device address are set respectively using SetPort 
williamr@2
   410
	and SetBTAddr on the TRfcommSockAddr.
williamr@2
   411
	*/
williamr@2
   412
	TRfcommSockAddr iAddr;
williamr@2
   413
	
williamr@2
   414
private:
williamr@2
   415
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   416
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   417
	TUint32     iPadding1; 
williamr@2
   418
	TUint32     iPadding2; 	
williamr@2
   419
	};
williamr@2
   420
williamr@2
   421
/** 
williamr@2
   422
Used to describe USB specific protocol information
williamr@2
   423
	
williamr@2
   424
@publishedAll
williamr@2
   425
@released
williamr@2
   426
*/
williamr@2
   427
NONSHARABLE_CLASS(TObexUsbProtocolInfo) : public TObexProtocolInfo
williamr@2
   428
	{
williamr@2
   429
public:
williamr@2
   430
	/** Provides a string to be attached to the Obex function's Communication Class interface,
williamr@2
   431
	which may be used to identify the Obex service. */
williamr@2
   432
	TBuf16<KUsbIntStringDescLength> iInterfaceStringDescriptor;
williamr@2
   433
	};
williamr@2
   434
williamr@2
   435
/** 
williamr@2
   436
Used to set options used by the extended USB client driver for improved performance
williamr@2
   437
	
williamr@2
   438
@see TObexUsbProtocolInfo
williamr@2
   439
@see RDevUsbcClient
williamr@2
   440
@publishedAll
williamr@2
   441
@released
williamr@2
   442
*/
williamr@2
   443
NONSHARABLE_CLASS(TObexUsbProtocolInfoV2) : public TObexUsbProtocolInfo
williamr@2
   444
	{
williamr@2
   445
public:
williamr@2
   446
	/** Bitmap containing the bandwidth priorities to use on IN and OUT endpoints
williamr@2
   447
	@see TUsbcBandwidthPriority
williamr@2
   448
	*/
williamr@2
   449
	TInt iBandwidthPriority;
williamr@2
   450
	/** Specifies whether to use DMA on the bulk OUT endpoint */
williamr@2
   451
	TBool iDmaOnOutEndpoint;
williamr@2
   452
	/** Specifies whether to use DMA on the bulk IN endpoint */
williamr@2
   453
	TBool iDmaOnInEndpoint;
williamr@2
   454
	
williamr@2
   455
private:
williamr@2
   456
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   457
	// None of these padding variables have been zero'd because they are currently not used
williamr@2
   458
	TUint32     iPadding1; 
williamr@2
   459
	TUint32     iPadding2; 		
williamr@2
   460
	TUint32     iPadding3; 
williamr@2
   461
	TUint32     iPadding4; 	
williamr@2
   462
	};
williamr@2
   463
williamr@2
   464
/**
williamr@2
   465
Contains information about OBEX packet sizing policy, defining the
williamr@2
   466
maximum buffer size for receive and transmit packets
williamr@2
   467
*/
williamr@2
   468
NONSHARABLE_CLASS(TObexProtocolPolicy)
williamr@2
   469
	{
williamr@2
   470
public:
williamr@2
   471
	IMPORT_C TObexProtocolPolicy ();	// Sets version and default values
williamr@2
   472
williamr@2
   473
	IMPORT_C TInt SetReceiveMtu ( TUint16 aReceiveMtu );
williamr@2
   474
	IMPORT_C TInt SetTransmitMtu ( TUint16 aTransmitMtu );
williamr@2
   475
	IMPORT_C TUint16 Version () const;
williamr@2
   476
	IMPORT_C TUint16 ReceiveMtu () const;
williamr@2
   477
	IMPORT_C TUint16 TransmitMtu () const;
williamr@2
   478
williamr@2
   479
private:
williamr@2
   480
	TUint16 iVersion;
williamr@2
   481
	TUint16 iReceiveMtu;
williamr@2
   482
	TUint16 iTransmitMtu;
williamr@2
   483
williamr@2
   484
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   485
	// None of these padding variables have been zero'd because they are currently not used
williamr@2
   486
	TUint32     iPadding1; 
williamr@2
   487
	TUint32     iPadding2; 		
williamr@2
   488
	TUint32     iPadding3; 
williamr@2
   489
	TUint32     iPadding4; 	
williamr@2
   490
	};
williamr@2
   491
williamr@2
   492
struct TObexConnectionInfo;
williamr@2
   493
williamr@2
   494
/**
williamr@2
   495
TObexConnectInfo
williamr@2
   496
This structure contains information used during OBEX connection. iVersion
williamr@2
   497
holds the encoded OBEX version of the machine, use @c VersionMajor() and
williamr@2
   498
@c VersionMinor() to extract the parts of the version number (each having a
williamr@2
   499
value from 0 to 15). @c iFlags holds OBEX connection flags. @c iWho holds 
williamr@2
   500
the Who attribute from the connect packet, if any was specified, or 
williamr@2
   501
otherwise has a length of 0. 
williamr@2
   502
It is recommended that this class is only ever allocated on the heap as it is quite big.
williamr@2
   503
*/
williamr@2
   504
NONSHARABLE_CLASS(TObexConnectInfo)
williamr@2
   505
	{
williamr@2
   506
public:
williamr@2
   507
	IMPORT_C TObexConnectInfo();
williamr@2
   508
	IMPORT_C TUint8 VersionMajor() const;
williamr@2
   509
	IMPORT_C TUint8 VersionMinor() const;
williamr@2
   510
public:
williamr@2
   511
	TUint8 iVersion; /** Encoded OBEX version of the machine*/
williamr@2
   512
	TUint8 iFlags; /** iFlags holds OBEX connection flags*/
williamr@2
   513
	TBuf8<KObexObjectDescriptionSize> iWho; /** the Who attribute from the connect packet, if any was specified */
williamr@2
   514
	TBuf8<KObexObjectDescriptionSize> iTargetHeader; /** the Target header from the connect packet, if any was specified */
williamr@2
   515
	
williamr@2
   516
private:
williamr@2
   517
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   518
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   519
	TUint32     iPadding1; 
williamr@2
   520
	TUint32     iPadding2; 	
williamr@2
   521
	};
williamr@2
   522
williamr@2
   523
williamr@2
   524
williamr@2
   525
//if these codes are extended due to a IRObex spec update ensure 
williamr@2
   526
//that the TInt immediately below are updated 
williamr@2
   527
//and the default in the method IrOBEXUtil::ObexResponse is also updated
williamr@2
   528
enum TObexResponse  
williamr@2
   529
	{ 
williamr@2
   530
/** Response is "Continue" */	
williamr@2
   531
	ERespContinue			= 0x10,
williamr@2
   532
	
williamr@2
   533
/** Response is "Success" */		
williamr@2
   534
	ERespSuccess			= 0x20,
williamr@2
   535
	
williamr@2
   536
/** Response is "Created" */		
williamr@2
   537
	ERespCreated			= 0x21,
williamr@2
   538
	
williamr@2
   539
/** Response is "Accepted" */		
williamr@2
   540
	ERespAccepted			= 0x22,
williamr@2
   541
	
williamr@2
   542
/** Response is "Non-Authenticated Information" */		
williamr@2
   543
	ERespNonAuthInfo		= 0x23,
williamr@2
   544
	
williamr@2
   545
/** Response is "No Content" */			
williamr@2
   546
	ERespNoContent			= 0x24,
williamr@2
   547
	
williamr@2
   548
/** Response is "Reset Content" */				
williamr@2
   549
	ERespResetContent		= 0x25,
williamr@2
   550
	
williamr@2
   551
/** Response is "Partial Content" */					
williamr@2
   552
	ERespPartialContent		= 0x26,
williamr@2
   553
	
williamr@2
   554
/** Response is "Multiple Choices" */						
williamr@2
   555
	ERespMultipleChoices	= 0x30,
williamr@2
   556
	
williamr@2
   557
/** Response is "Moved Permanently" */						
williamr@2
   558
	ERespMovedPerm			= 0x31,
williamr@2
   559
	
williamr@2
   560
/** Response is "Moved Temporarily" */							
williamr@2
   561
	ERespMovedTemp			= 0x32,
williamr@2
   562
williamr@2
   563
/** Response is "See Other" */								
williamr@2
   564
	ERespSeeOther			= 0x33,
williamr@2
   565
williamr@2
   566
/** Response is "Not Modified" */									
williamr@2
   567
	ERespNotModified		= 0x34,
williamr@2
   568
williamr@2
   569
/** Response is "Use Proxy" */									
williamr@2
   570
	ERespUseProxy			= 0x35,
williamr@2
   571
williamr@2
   572
/** Response is "Bad Request" */									
williamr@2
   573
	ERespBadRequest			= 0x40,
williamr@2
   574
williamr@2
   575
/** Response is "Unauthorized" */									
williamr@2
   576
	ERespUnauthorized		= 0x41,
williamr@2
   577
williamr@2
   578
/** Response is "Payment Required" */									
williamr@2
   579
	ERespPaymentRequired	= 0x42,
williamr@2
   580
williamr@2
   581
/** Response is "Forbidden" */									
williamr@2
   582
	ERespForbidden			= 0x43,
williamr@2
   583
williamr@2
   584
/** Response is "Not Found" */										
williamr@2
   585
	ERespNotFound			= 0x44,
williamr@2
   586
williamr@2
   587
/** Response is "Method Not Allowed" */										
williamr@2
   588
	ERespMethodNotAllowed	= 0x45,
williamr@2
   589
williamr@2
   590
/** Response is "Not Acceptable" */									
williamr@2
   591
	ERespNotAcceptable		= 0x46,
williamr@2
   592
williamr@2
   593
/** Response is "Proxy Authentication is Required" */										
williamr@2
   594
	ERespProxyAuthenReqd	= 0x47,
williamr@2
   595
williamr@2
   596
/** Response is "Timed Out" */										
williamr@2
   597
	ERespTimedOut			= 0x48,
williamr@2
   598
williamr@2
   599
/** Response is "Conflict" */										
williamr@2
   600
	ERespConflict			= 0x49,
williamr@2
   601
williamr@2
   602
/** Response is "Gone" */										
williamr@2
   603
	ERespGone				= 0x4A,
williamr@2
   604
williamr@2
   605
/** Response is "Length Required" */										
williamr@2
   606
	ERespLengthReqd			= 0x4B,
williamr@2
   607
williamr@2
   608
/** Response is "Precondition Failed" */											
williamr@2
   609
	ERespPreCondFailed		= 0x4C,
williamr@2
   610
williamr@2
   611
/** Response is "Required Entity is Too Large" */											
williamr@2
   612
	ERespReqEntityTooLarge	= 0x4D,
williamr@2
   613
williamr@2
   614
/** Response is "Required URL is Too Large" */											
williamr@2
   615
	ERespReqURLTooLarge		= 0x4E,
williamr@2
   616
williamr@2
   617
/** Response is "Unsupported Media Type" */											
williamr@2
   618
	ERespUnsupMediaType		= 0x4F,
williamr@2
   619
williamr@2
   620
/** Response is "Internal Error" */											
williamr@2
   621
	ERespInternalError		= 0x50,
williamr@2
   622
williamr@2
   623
/** Response is "Not Implemented" */											
williamr@2
   624
	ERespNotImplemented		= 0x51,
williamr@2
   625
williamr@2
   626
/** Response is "Bad Gateway" */											
williamr@2
   627
	ERespBadGateway			= 0x52,
williamr@2
   628
williamr@2
   629
/** Response is "Service Unavailable" */											
williamr@2
   630
	ERespServiceUnavail		= 0x53,
williamr@2
   631
williamr@2
   632
/** Response is "Gateway Timeout" */											
williamr@2
   633
	ERespGatewayTimeout		= 0x54,
williamr@2
   634
williamr@2
   635
/** Response is "HTTP Version is Not Supported" */											
williamr@2
   636
	ERespHTTPVerNotSupp		= 0x55,
williamr@2
   637
williamr@2
   638
/** Response is "Database is Full" */											
williamr@2
   639
	ERespDatabaseFull		= 0x60,
williamr@2
   640
williamr@2
   641
/** Response is "Database is Locked" */											
williamr@2
   642
	ERespDatabaseLocked		= 0x61,
williamr@2
   643
williamr@2
   644
/** Response is "Service is Unavailable" */											
williamr@2
   645
	ERespServiceUnavailable = 0xD3,
williamr@2
   646
	};
williamr@2
   647
williamr@2
   648
williamr@2
   649
//some error codes to be used specifically by the client
williamr@2
   650
//these shall, be mapped directly to OBEX defined error codes.
williamr@2
   651
const TInt KErrIrObexRespSuccess		= KErrIrObexRespBase - ERespSuccess;			//-5532 returns 0x20 (0xA0)
williamr@2
   652
const TInt KErrIrObexRespCreated		= KErrIrObexRespBase - ERespCreated;			//-5533 returns 0x21 (0xA1)
williamr@2
   653
const TInt KErrIrObexRespAccepted		= KErrIrObexRespBase - ERespAccepted;			//-5534 returns 0x22 (0xA2)
williamr@2
   654
const TInt KErrIrObexRespNonAuthInfo	= KErrIrObexRespBase - ERespNonAuthInfo;		//-5535 returns 0x23 (0xA3)
williamr@2
   655
const TInt KErrIrObexRespNoContent		= KErrIrObexRespBase - ERespNoContent;			//-5536 returns 0x24 (0xA4)
williamr@2
   656
const TInt KErrIrObexRespResetContent	= KErrIrObexRespBase - ERespResetContent;		//-5537 returns 0x25 (0xA5)
williamr@2
   657
const TInt KErrIrObexRespPartialContent = KErrIrObexRespBase - ERespPartialContent;		//-5538 returns 0x26 (0xA6)
williamr@2
   658
const TInt KErrIrObexRespMultipleChoices = KErrIrObexRespBase - ERespMultipleChoices;	//-5548 returns 0x30 (0xB0)
williamr@2
   659
const TInt KErrIrObexRespMovedPerm		= KErrIrObexRespBase - ERespMovedPerm;			//-5549 returns 0x31 (0xB1)
williamr@2
   660
const TInt KErrIrObexRespMovedTemp		= KErrIrObexRespBase - ERespMovedTemp;			//-5550 returns 0x32 (0xB2)
williamr@2
   661
const TInt KErrIrObexRespSeeOther		= KErrIrObexRespBase - ERespSeeOther;			//-5551 returns 0x33 (0xB3)
williamr@2
   662
const TInt KErrIrObexRespNotModified	= KErrIrObexRespBase - ERespNotModified;		//-5552 returns 0x34 (0xB4)
williamr@2
   663
const TInt KErrIrObexRespUseProxy		= KErrIrObexRespBase - ERespUseProxy;			//-5553 returns 0x35 (0xB5)
williamr@2
   664
const TInt KErrIrObexRespBadRequest		= KErrIrObexRespBase - ERespBadRequest;			//-5564 returns 0x40 (0xC0)
williamr@2
   665
const TInt KErrIrObexRespUnauthorized	= KErrIrObexRespBase - ERespUnauthorized;		//-5565 returns 0x41 (0xC1)
williamr@2
   666
const TInt KErrIrObexRespPaymentRequired = KErrIrObexRespBase - ERespPaymentRequired;	//-5566 returns 0x42 (0xC2)
williamr@2
   667
const TInt KErrIrObexRespForbidden		= KErrIrObexRespBase - ERespForbidden;			//-5567 returns 0x43 (0xC3)
williamr@2
   668
const TInt KErrIrObexRespNotFound		= KErrIrObexRespBase - ERespNotFound;			//-5568 returns 0x44 (0xC4)
williamr@2
   669
const TInt KErrIrObexRespMethodNotAllowed = KErrIrObexRespBase - ERespMethodNotAllowed;	//-5569 returns 0x45 (0xC5)
williamr@2
   670
const TInt KErrIrObexRespNotAcceptable	= KErrIrObexRespBase - ERespNotAcceptable;		//-5570 returns 0x46 (0xC6)
williamr@2
   671
const TInt KErrIrObexRespProxyAuthenReqd = KErrIrObexRespBase - ERespProxyAuthenReqd;	//-5571 returns 0x47 (0xC7)
williamr@2
   672
const TInt KErrIrObexRespTimedOut		= KErrIrObexRespBase - ERespTimedOut;			//-5572 returns 0x48 (0xC8)
williamr@2
   673
const TInt KErrIrObexRespConflict		= KErrIrObexRespBase - ERespConflict;			//-5573 returns 0x49 (0xC9)
williamr@2
   674
const TInt KErrIrObexRespGone			= KErrIrObexRespBase - ERespGone;				//-5574 returns 0x4A (0xCA)
williamr@2
   675
const TInt KErrIrObexRespLengthReqd		= KErrIrObexRespBase - ERespLengthReqd;			//-5575 returns 0x4B (0xCB)
williamr@2
   676
const TInt KErrIrObexRespPreCondFailed	= KErrIrObexRespBase - ERespPreCondFailed;		//-5576 returns 0x4C (0xCC)
williamr@2
   677
const TInt KErrIrObexRespReqEntityTooLarge = KErrIrObexRespBase - ERespReqEntityTooLarge;//-5577 returns 0x4D (0xCD)
williamr@2
   678
const TInt KErrIrObexRespReqURLTooLarge	= KErrIrObexRespBase - ERespReqURLTooLarge;		//-5578 returns 0x4E (0xCE)
williamr@2
   679
const TInt KErrIrObexRespUnsupMediaType = KErrIrObexRespBase - ERespUnsupMediaType;		//-5579 returns 0x4F (0xCF)
williamr@2
   680
const TInt KErrIrObexRespInternalError	= KErrIrObexRespBase - ERespInternalError;		//-5580 returns 0x50 (0xD0)
williamr@2
   681
const TInt KErrIrObexRespNotImplemented = KErrIrObexRespBase - ERespNotImplemented;		//-5581 returns 0x51 (0xD1)
williamr@2
   682
const TInt KErrIrObexRespBadGateway		= KErrIrObexRespBase - ERespBadGateway;			//-5582 returns 0x52 (0xD2)
williamr@2
   683
const TInt KErrIrObexRespServiceUnavail = KErrIrObexRespBase - ERespServiceUnavail;		//-5583 returns 0x53 (0xD3)
williamr@2
   684
const TInt KErrIrObexRespGatewayTimeout = KErrIrObexRespBase - ERespGatewayTimeout;		//-5584 returns 0x54 (0xD4)
williamr@2
   685
const TInt KErrIrObexRespHTTPVerNotSupp = KErrIrObexRespBase - ERespHTTPVerNotSupp;		//-5585 returns 0x55 (0xD5)
williamr@2
   686
const TInt KErrIrObexRespDatabaseFull	= KErrIrObexRespBase - ERespDatabaseFull;		//-5596 returns 0x60 (0xE0)
williamr@2
   687
const TInt KErrIrObexRespDatabaseLocked = KErrIrObexRespBase - ERespDatabaseLocked;		//-5597 returns 0x61 (0xE1)
williamr@2
   688
williamr@2
   689
#endif // __OBEXCONSTANTS_H