epoc32/include/ir_sock.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 1997-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@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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
 @file
williamr@2
    18
 @publishedAll
williamr@2
    19
 @released
williamr@2
    20
*/
williamr@2
    21
williamr@2
    22
#ifndef __IR_SOCK_H__
williamr@2
    23
#define __IR_SOCK_H__
williamr@2
    24
williamr@2
    25
#include "es_sock.h"
williamr@2
    26
#include <e32property.h>
williamr@2
    27
williamr@2
    28
//################## EXPORTED CONSTANTS ########################
williamr@2
    29
williamr@2
    30
williamr@2
    31
/** IrDA protocol family. */
williamr@2
    32
const TUint KIrdaAddrFamily=0x100;   // Address of Irda prot family
williamr@2
    33
williamr@2
    34
/** IrMUX protocol within the IrDA protocol family. */
williamr@2
    35
const TUint KIrmux=88;               // Protocol number for Irmux
williamr@2
    36
williamr@2
    37
/** IrTinyTP protocol within the IrDA protocol family.. */
williamr@2
    38
const TUint KIrTinyTP=89;            // Protocol number for IrTinyTP
williamr@2
    39
williamr@2
    40
/** An invalid LSAP number--binding to this will select the first unused LSAP. */
williamr@2
    41
const TUint KAutoBindLSAP = 0xffff;
williamr@2
    42
williamr@2
    43
williamr@2
    44
/** Category used when publishing IrDA status notifications. */
williamr@2
    45
const TUid KIrdaPropertyCategory = {KUidSystemCategoryValue};
williamr@2
    46
williamr@2
    47
/** Key used when publishing IrDA status notifications. */
williamr@2
    48
const TUint KIrdaStatus = 0x100052d1;
williamr@2
    49
williamr@2
    50
williamr@2
    51
/** Names used for IrDA status notifications. */
williamr@2
    52
namespace TIrdaStatusCodes
williamr@2
    53
	{
williamr@2
    54
	enum
williamr@2
    55
		{
williamr@2
    56
		EIrLoaded,
williamr@2
    57
		EIrDiscoveredPeer,
williamr@2
    58
		EIrLostPeer,
williamr@2
    59
		EIrConnected,
williamr@2
    60
		EIrBlocked,
williamr@2
    61
		EIrDisconnected,
williamr@2
    62
		EIrUnloaded,
williamr@2
    63
		};
williamr@2
    64
	}
williamr@2
    65
williamr@2
    66
/** PnP support - first service hint byte. */
williamr@2
    67
const TUint8 KIrPnPMask=0x01;	   // PnP support - FIRST SERVICE HINT BYTE
williamr@2
    68
williamr@2
    69
/** PDA/Palmtop - first service hint byte. */
williamr@2
    70
const TUint8 KPalmtopMask=0x02;    // PDA/Palmtop - FIRST SERVICE HINT BYTE
williamr@2
    71
williamr@2
    72
/** Computer - first service hint byte. */
williamr@2
    73
const TUint8 KComputerMask=0x04;   // Computer - FIRST SERVICE HINT BYTE
williamr@2
    74
williamr@2
    75
/** Printer - first service hint byte. */
williamr@2
    76
const TUint8 KPrinterMask=0x08;	   // Printer - FIRST SERVICE HINT BYTE
williamr@2
    77
williamr@2
    78
/** IrModem - first service hint byte. */
williamr@2
    79
const TUint8 KModemMask=0x10;      // IrModem - FIRST SERVICE HINT BYTE
williamr@2
    80
williamr@2
    81
/** Fax - first service hint byte. */
williamr@2
    82
const TUint8 KFaxMask=0x20;        // Fax - FIRST SERVICE HINT BYTE
williamr@2
    83
williamr@2
    84
/** LAN Access - first service hint byte. */
williamr@2
    85
const TUint8 KLANAccessMask=0x40;  // LAN Access - FIRST SERVICE HINT BYTE
williamr@2
    86
williamr@2
    87
/** Extension bit - first service hint byte. */
williamr@2
    88
const TUint8 KExtensionMask=0x80;  // Extension bit - FIRST SERVICE HINT BYTE
williamr@2
    89
williamr@2
    90
/** Telephony - second service hint byte. */
williamr@2
    91
const TUint8 KTelephonyMask=0x01;  // Telephony - SECOND SERVICE HINT BYTE
williamr@2
    92
williamr@2
    93
/** File Server - second service hint byte. */
williamr@2
    94
const TUint8 KFileServerMask=0x02; // File Server - SECOND SERVICE HINT BYTE
williamr@2
    95
williamr@2
    96
/** IrCOMM support - second service hint byte. */
williamr@2
    97
const TUint8 KIrCommMask=0x04;     // IrCOMM support - SECOND SERVICE HINT BYTE
williamr@2
    98
williamr@2
    99
/** IrOBEX support - second service hint byte. */
williamr@2
   100
const TUint8 KIrObexMask=0x20;     // IrObex support - SECOND SERVICE HINT BYTE
williamr@2
   101
williamr@2
   102
//
williamr@2
   103
// IrDA Ioctls
williamr@2
   104
//
williamr@2
   105
williamr@2
   106
/** Completes on receipt of a discovery indication. 
williamr@2
   107
williamr@2
   108
Returns log entry in a TNameEntry. 
williamr@2
   109
williamr@2
   110
Ioctl level : KIrdaAddrFamily */
williamr@2
   111
const TUint KDiscoveryIndicationIoctl=0;
williamr@2
   112
williamr@2
   113
/** Completes on successfully making RSocket EXCLUSIVE else returns error. 
williamr@2
   114
williamr@2
   115
Completes successfully or returns KErrDisconnected if failed.
williamr@2
   116
williamr@2
   117
Ioctl level: KIrdaAddrFamily */
williamr@2
   118
const TUint KExclusiveModeIoctl=1;
williamr@2
   119
williamr@2
   120
/** Completes on successfully making RSocket MULTIPLEXED else returns error.
williamr@2
   121
williamr@2
   122
Completes successfully or returns KErrDisconnected if failed.
williamr@2
   123
williamr@2
   124
Ioctl level: KIrdaAddrFamily */
williamr@2
   125
const TUint KMultiplexModeIoctl=2;
williamr@2
   126
williamr@2
   127
/** Completes on doing a status request on IrMUX layer packets to send.
williamr@2
   128
williamr@2
   129
Returns TDes8* holding TUint indicating number of outstanding MUX data requests.
williamr@2
   130
williamr@2
   131
Ioctl level: KIrdaAddrFamily */
williamr@2
   132
const TUint KIrmuxStatusRequestIoctl=3;
williamr@2
   133
williamr@2
   134
/** Completes on doing a status request on IrLAP layer packets to send.
williamr@2
   135
williamr@2
   136
Returns TDes8* holding TUint indicating the number of outstanding LAP data 
williamr@2
   137
requests.
williamr@2
   138
williamr@2
   139
Ioctl level: KIrdaAddrFamily */
williamr@2
   140
const TUint KIrlapStatusRequestIoctl=4;
williamr@2
   141
williamr@2
   142
/** Completes on successfully putting RSocket into IDLE mode.
williamr@2
   143
williamr@2
   144
Completes successfully or returns KErrAbort if failed.
williamr@2
   145
williamr@2
   146
Ioctl level: KIrdaAddrFamily */
williamr@2
   147
const TUint KIdleRequestIoctl=5;
williamr@2
   148
williamr@2
   149
/** Completes on successfully taking RSocket out of IDLE mode.
williamr@2
   150
williamr@2
   151
Completes successfully or returns KErrAbort if failed.
williamr@2
   152
williamr@2
   153
Ioctl level: KIrdaAddrFamily */
williamr@2
   154
const TUint KIdleClearRequestIoctl=6;
williamr@2
   155
williamr@2
   156
/** Completes on receipt of an IrLAP disconnect indication.
williamr@2
   157
williamr@2
   158
Completes successfully on IrLAP or IrMUX disconnect on this connection.
williamr@2
   159
williamr@2
   160
Ioctl level: KIrdaAddrFamily */
williamr@2
   161
const TUint KDisconnectIndicationIoctl=7;
williamr@2
   162
williamr@2
   163
/** Completes on doing a status request on IrLAP layer packets to send.
williamr@2
   164
williamr@2
   165
Returns TDes8* holding TUint indicating the number of outstanding LAP data 
williamr@2
   166
requests.
williamr@2
   167
williamr@2
   168
Ioctl level: KIrdaAddrFamily */
williamr@2
   169
const TUint KIrlapStatusIndicationIoctl=8;
williamr@2
   170
williamr@2
   171
/** Completes on receiving a status indication from IrLAP.
williamr@2
   172
williamr@2
   173
Returns TDes8* holding TUint indicating the number of outstanding MUX data 
williamr@2
   174
requests.
williamr@2
   175
williamr@2
   176
Ioctl level: KIrdaAddrFamily */
williamr@2
   177
const TUint KIrmuxStatusIndicationIoctl=9;
williamr@2
   178
williamr@2
   179
/** Completes on doing an IrLAP link reset.
williamr@2
   180
williamr@2
   181
Does an SNRMP-UAF link reset which can be initiated from either primary or 
williamr@2
   182
secondary.
williamr@2
   183
williamr@2
   184
Ioctl level: KIrdaAddrFamily */
williamr@2
   185
const TUint KIrlapResetRequestIoctl=10;
williamr@2
   186
williamr@2
   187
/** Completes on receipt of an IrLAP link reset indication.
williamr@2
   188
williamr@2
   189
Completes with error value KErrNone if link is successfully reset.
williamr@2
   190
williamr@2
   191
Ioctl level: KIrdaAddrFamily */
williamr@2
   192
const TUint KIrlapResetIndicationIoctl=11;
williamr@2
   193
williamr@2
   194
/** Completes on doing an IrLAP link reset.
williamr@2
   195
williamr@2
   196
Does a DISCP-UAF link disconnect which can be initiated from either primary 
williamr@2
   197
or secondary.
williamr@2
   198
williamr@2
   199
Ioctl level: KIrdaAddrFamily */
williamr@2
   200
const TUint KIrlapDisconnectRequestIoctl=12;
williamr@2
   201
williamr@2
   202
const TUint KExclusiveMode=0;
williamr@2
   203
williamr@2
   204
const TUint KMultiplexMode=1;
williamr@2
   205
williamr@2
   206
williamr@2
   207
//********************  Irda Set/GetOpts ******************************
williamr@2
   208
// These two are done on Socket Write
williamr@2
   209
//
williamr@2
   210
williamr@2
   211
williamr@2
   212
/** KLevelIrlap.
williamr@2
   213
williamr@2
   214
Sets transfer mode to be unexpedited (the default).
williamr@2
   215
williamr@2
   216
Not recommended for use with SetOpt(). Preferred use is with RSocket::Send()
williamr@2
   217
williamr@2
   218
Returns KErrNone */
williamr@2
   219
const TUint KUnexpeditedDataOpt		= 0;		// Default
williamr@2
   220
williamr@2
   221
/** KLevelIrlap
williamr@2
   222
williamr@2
   223
Sets transfer mode to be expedited (urgent).
williamr@2
   224
williamr@2
   225
Not recommended for use with SetOpt(). Preferred use is with RSocket::Send()
williamr@2
   226
williamr@2
   227
Returns KErrNone */
williamr@2
   228
const TUint KExpeditedDataOpt		= 1;		// Urgent data transfer
williamr@2
   229
williamr@2
   230
// On KLevelIrlap
williamr@2
   231
williamr@2
   232
/** KLevelIrlap
williamr@2
   233
williamr@2
   234
Sets number of discovery slots.
williamr@2
   235
williamr@2
   236
Returns KErrNone */
williamr@2
   237
const TUint KDiscoverySlotsOpt		= 2;
williamr@2
   238
williamr@2
   239
/** KLevelIrlap
williamr@2
   240
williamr@2
   241
Sets the requested maximum link baud rate.
williamr@2
   242
williamr@2
   243
Returns KErrInUse, if the link is already running.
williamr@2
   244
williamr@2
   245
Returns with the currently set maximum link baud supported. */
williamr@2
   246
const TUint KUserBaudOpt			= 3;
williamr@2
   247
williamr@2
   248
/** KLevelIrlap
williamr@2
   249
williamr@2
   250
Sets the requested maximum data packet size that can be received by the host.
williamr@2
   251
williamr@2
   252
Returns KErrInUse, if the link is already running.
williamr@2
   253
williamr@2
   254
Returns with the currently set value for the maximum receivable data size 
williamr@2
   255
of the host IrLAP layer. */
williamr@2
   256
const TUint KHostMaxDataSizeOpt		= 4;
williamr@2
   257
williamr@2
   258
/** KLevelIrlap
williamr@2
   259
williamr@2
   260
Returns KErrNotSupported.
williamr@2
   261
williamr@2
   262
Cannot set this value for the remote station.
williamr@2
   263
williamr@2
   264
Returns with the currently set value for the maximum transmissible data size 
williamr@2
   265
to remote IrLAP layer. */
williamr@2
   266
const TUint KRemoteMaxDataSizeOpt	= 6;	// Remote packet size
williamr@2
   267
williamr@2
   268
/** KLevelIrlap
williamr@2
   269
williamr@2
   270
Set the maximum link turnaround time for the host IrLAP layer.
williamr@2
   271
williamr@2
   272
Returns KErrInUse, if the link is already running.
williamr@2
   273
williamr@2
   274
Returns with the currently set value for the host link turnaround time */
williamr@2
   275
const TUint KHostMaxTATimeOpt		= 5;
williamr@2
   276
williamr@2
   277
/** KLevelIrlap
williamr@2
   278
williamr@2
   279
Disables IrLAP level reset_check/wait states */
williamr@2
   280
const TUint KIrlapDisableResetOpt	= 9;	// This disables Irlap level reset_check/wait states.
williamr@2
   281
williamr@2
   282
/** KLevelIrlap
williamr@2
   283
williamr@2
   284
Allows the client to set local busy in IrLAP. */
williamr@2
   285
const TUint KLocalBusyDetectedOpt	= 10;	// Client can set local busy in Irlap
williamr@2
   286
williamr@2
   287
/** KLevelIrlap
williamr@2
   288
williamr@2
   289
Allows the client to clear local busy in IrLAP */
williamr@2
   290
const TUint KLocalBusyClearedOpt	= 11;	// Client can clear local busy in Irlap
williamr@2
   291
williamr@2
   292
/** KLevelIrlap
williamr@2
   293
williamr@2
   294
Disables discovery response for a short period (typically 3 seconds). */
williamr@2
   295
const TUint KDiscoveryResponseDisableOpt = 12;
williamr@2
   296
williamr@2
   297
/** KLevelIrlap
williamr@2
   298
williamr@2
   299
Sets the host's first service hint byte used in XID frames.
williamr@2
   300
williamr@2
   301
Retrieves the first hint byte. */
williamr@2
   302
const TUint KFirstHintByteOpt		= 13;	// Hint Bytes
williamr@2
   303
williamr@2
   304
/** KLevelIrlap
williamr@2
   305
williamr@2
   306
Sets the host's second service hint byte used in XID frames.
williamr@2
   307
williamr@2
   308
Retrieves the second hint byte */
williamr@2
   309
const TUint KSecondHintByteOpt		= 14;
williamr@2
   310
williamr@2
   311
// On KLevelIrmux
williamr@2
   312
williamr@2
   313
/** KLevelIrmux
williamr@2
   314
williamr@2
   315
Turns on transport layer segmentation with the segment size specified. This 
williamr@2
   316
value is advertised to the remote machine as the maximum amount of data we 
williamr@2
   317
can reassemble.
williamr@2
   318
williamr@2
   319
Returns KErrNone */
williamr@2
   320
const TUint KTinyTPLocalSegSizeOpt=7;	// This value is advertised to the remote machine as the max amount of data we can reassemble
williamr@2
   321
williamr@2
   322
/** KLevelIrmux
williamr@2
   323
williamr@2
   324
Queries the remote machine's segment size. The remote machine is unable 
williamr@2
   325
to assemble more data than this.
williamr@2
   326
williamr@2
   327
Returns the remote machine's segment size. */
williamr@2
   328
const TUint KTinyTPRemoteSegSizeOpt=8;	// Remote machine is unable to reassemble more data than this
williamr@2
   329
williamr@2
   330
/**
williamr@2
   331
Disables TinyTP reassembly of segmented packets. */
williamr@2
   332
const TUint KTinyTPDisabledSegmentation=15;
williamr@2
   333
/**
williamr@2
   334
@deprecated
williamr@2
   335
Disables TinyTP reassembly of segmented packets. */
williamr@2
   336
const TUint KTinyTPDiasbledSegmentation=15;
williamr@2
   337
williamr@2
   338
/**
williamr@2
   339
@internalComponent
williamr@2
   340
*/
williamr@2
   341
const TUint KIrdaInternalOption=0x4000000;
williamr@2
   342
williamr@2
   343
/**
williamr@2
   344
@internalTechnology
williamr@2
   345
*/
williamr@2
   346
const TUint KTinyTPSetMaxBufferSpace=16 | KIrdaInternalOption;
williamr@2
   347
williamr@2
   348
williamr@2
   349
williamr@2
   350
/** The option relates to IrLAP. */
williamr@2
   351
const TUint KLevelIrlap=4;
williamr@2
   352
williamr@2
   353
/** The option relates to IrMUX. */
williamr@2
   354
const TUint KLevelIrmux=5;
williamr@2
   355
williamr@2
   356
/** The maximum length of a class name in an IAS entry. */
williamr@2
   357
const TUint KIASClassNameMax=60;
williamr@2
   358
williamr@2
   359
/** The maximum length of an attribute in an IAS entry. */
williamr@2
   360
const TUint KIASAttributeNameMax=60;
williamr@2
   361
williamr@2
   362
/** The maximum length of a TIASQuery descriptor. */
williamr@2
   363
const TUint KMaxQueryStringLength=128;
williamr@2
   364
williamr@2
   365
//################# CLASS DEFINITIONS ########################
williamr@2
   366
williamr@2
   367
NONSHARABLE_CLASS(TIrdaSockAddr) : public TSockAddr
williamr@2
   368
/** An IrDA socket address. 
williamr@2
   369
	@publishedAll 
williamr@2
   370
	@released */
williamr@2
   371
	{
williamr@2
   372
struct SIrdaAddr
williamr@2
   373
	{	
williamr@2
   374
	TUint iHostDevAddr;
williamr@2
   375
	TUint iRemoteDevAddr;
williamr@2
   376
	TBool iSniff;
williamr@2
   377
	TBool iSolicited;
williamr@2
   378
	TUint8 iIrlapVersion;
williamr@2
   379
	TUint8 iFirstServiceHintByte;
williamr@2
   380
	TUint8 iSecondServiceHintByte;
williamr@2
   381
	TUint8 iCharacterSet;
williamr@2
   382
	TUint8 iServiceHintByteCount;
williamr@2
   383
	// Extra stuff for MUX
williamr@2
   384
	TUint8 iHomePort;
williamr@2
   385
	TUint8 iRemotePort;
williamr@2
   386
	TUint8 iSpare;
williamr@2
   387
    };
williamr@2
   388
public:
williamr@2
   389
	IMPORT_C TIrdaSockAddr();
williamr@2
   390
	IMPORT_C TIrdaSockAddr(const TSockAddr &aAddr);
williamr@2
   391
	/** Casts a reference to a general socket address into an IrDA socket address.
williamr@2
   392
	
williamr@2
   393
	@param aAddr A reference to a general socket address. 
williamr@2
   394
	@return The socket address returned as a reference to an IrDA socket address. */
williamr@2
   395
	
williamr@2
   396
	/** Casts a pointer to a general socket address into an IrDA socket address.
williamr@2
   397
	
williamr@2
   398
	@param aAddr A pointer to a general socket address. 
williamr@2
   399
	@return The socket address returned as a reference to an IrDA socket address. */
williamr@2
   400
	IMPORT_C static TIrdaSockAddr &Cast(const TSockAddr &aAddr);
williamr@2
   401
williamr@2
   402
	/** Casts a reference to a general socket address into an IrDA socket address.
williamr@2
   403
	
williamr@2
   404
	@param aAddr A reference to a general socket address. 
williamr@2
   405
	@return The socket address returned as a reference to an IrDA socket address. */
williamr@2
   406
	
williamr@2
   407
	/** Casts a pointer to a general socket address into an IrDA socket address.
williamr@2
   408
	
williamr@2
   409
	@param aAddr A pointer to a general socket address. 
williamr@2
   410
	@return The socket address returned as a reference to an IrDA socket address. */
williamr@2
   411
williamr@2
   412
	IMPORT_C static TIrdaSockAddr &Cast(const TSockAddr *aAddr);
williamr@2
   413
	/** Returns the remote device address.
williamr@2
   414
	
williamr@2
   415
	@return The remote device address as a 32 bit value. */
williamr@2
   416
williamr@2
   417
	IMPORT_C TUint GetRemoteDevAddr() const;
williamr@2
   418
	/** Sets the remote device address.
williamr@2
   419
	
williamr@2
   420
	@param aRemote The remote device address as a 32-bit value. */
williamr@2
   421
williamr@2
   422
	IMPORT_C void SetRemoteDevAddr(const TUint aRemote);
williamr@2
   423
	
williamr@2
   424
	/** Returns the host device address.
williamr@2
   425
	
williamr@2
   426
	@return The host device address as a 32 bit value. */
williamr@2
   427
	IMPORT_C TUint GetHostDevAddr() const;
williamr@2
   428
	
williamr@2
   429
	/** Sets the host device address.
williamr@2
   430
	
williamr@2
   431
	@param aHost The host device address as a 32-bit value. */
williamr@2
   432
	IMPORT_C void SetHostDevAddr(const TUint aHost);
williamr@2
   433
	
williamr@2
   434
	/** Returns the remote device's sniff status, i.e. whether the device is capable 
williamr@2
   435
	of sniffing for IrDA devices.
williamr@2
   436
	
williamr@2
   437
	@return True, if the device is capable of sniffing for IrDA devices; false, 
williamr@2
   438
	otherwise. */
williamr@2
   439
	IMPORT_C TBool GetSniffStatus() const;
williamr@2
   440
	
williamr@2
   441
	/** Sets the sniff status for the remote device, i.e. whether the device is capable 
williamr@2
   442
	of sniffing for IrDA devices.
williamr@2
   443
	
williamr@2
   444
	@param aSniff True, if the device is capable of sniffing for IrDA devices; 
williamr@2
   445
	false, otherwise. */
williamr@2
   446
	IMPORT_C void SetSniffStatus(const TBool aSniff);
williamr@2
   447
	
williamr@2
   448
	/** Returns the solicited status.
williamr@2
   449
	
williamr@2
   450
	The solicited status indicates whether a discovery was initiated by the host 
williamr@2
   451
	device or a remote device.
williamr@2
   452
	
williamr@2
   453
	@return True, if the discovery was initiated by the host device; false if 
williamr@2
   454
	the discovery was initiated by the remote device. */
williamr@2
   455
	IMPORT_C TBool GetSolicitedStatus() const;
williamr@2
   456
	
williamr@2
   457
	/** Sets the solicited status. The solicited status indcates whether a discovery 
williamr@2
   458
	was initiated by the host device or a remote device.
williamr@2
   459
	
williamr@2
   460
	@param aSolicited ETrue, if the discovery was initiated by the host device; 
williamr@2
   461
	EFalse, if discovery was initiated by the remote device. */
williamr@2
   462
	IMPORT_C void SetSolicitedStatus(const TBool aSolicited);
williamr@2
   463
	
williamr@2
   464
	/** Returns the remote device's IrLAP version number.
williamr@2
   465
	
williamr@2
   466
	This should be 0x00 indicating that the device conforms to the IrDA IrLAP 
williamr@2
   467
	1.00 specification.
williamr@2
   468
	
williamr@2
   469
	@return The device's IrLAP version number. */
williamr@2
   470
	IMPORT_C TUint8 GetIrlapVersion() const;
williamr@2
   471
	
williamr@2
   472
	/** Sets the IrLAP version number for the remote device.
williamr@2
   473
	
williamr@2
   474
	This should be 0x00 indicating that the device conforms to the IrDA IrLAP 
williamr@2
   475
	1.00 specification.
williamr@2
   476
	
williamr@2
   477
	@param aIrlapVersion The device's IrLAP version number. */
williamr@2
   478
	IMPORT_C void SetIrlapVersion(const TUint8 aIrlapVersion);
williamr@2
   479
	
williamr@2
   480
	/** Returns the character set supported by the remote device.
williamr@2
   481
	
williamr@2
   482
	@return One of the TIASCharSet enumerator values defining the character set 
williamr@2
   483
	supported by the device. */
williamr@2
   484
	IMPORT_C TUint8 GetCharacterSet() const;
williamr@2
   485
	
williamr@2
   486
	/** Sets the character set supported by the remote device.
williamr@2
   487
	
williamr@2
   488
	@param aCharacterSet One of the TIASCharSet enumerator values defining the 
williamr@2
   489
	character set supported by the device */
williamr@2
   490
	IMPORT_C void SetCharacterSet(const TUint8 aCharacterSet);
williamr@2
   491
	
williamr@2
   492
	/** Returns the remote device's first service hint byte. Service hint bytes indicate 
williamr@2
   493
	the level of IrLMP support provided by the device.
williamr@2
   494
	
williamr@2
   495
	@return The first service hint byte. The individual bits have the following 
williamr@2
   496
	meaning: Bit 0 (0x01) - PnP Compatible Bit 1 (0x02) - PDA/Palmtop Bit 2 (0x04) 
williamr@2
   497
	- Computer Bit 3 (0x08) - Printer Bit 4 (0x10) - Modem Bit 5 (0x20) - Fax 
williamr@2
   498
	Bit 6 (0x40) - LAN Access Bit 7 (0x80) - Extension */
williamr@2
   499
	IMPORT_C TUint8 GetFirstServiceHintByte() const;
williamr@2
   500
	
williamr@2
   501
	/** Sets the first service hint byte for the remote device. The service hint bytes 
williamr@2
   502
	indicate the level of IrLMP support provided by the device.
williamr@2
   503
	
williamr@2
   504
	@param aFirstServiceHintByte The first service hint byte. The individual bits 
williamr@2
   505
	have the following meaning: Bit 0 (0x01) - PnP Compatible Bit 1 (0x02) - PDA/Palmtop 
williamr@2
   506
	Bit 2 (0x04) - Computer Bit 3 (0x08) - Printer Bit 4 (0x10) - Modem Bit 5 
williamr@2
   507
	(0x20) - Fax Bit 6 (0x40) - LAN Access Bit 7 (0x80) - Extension */
williamr@2
   508
	IMPORT_C void SetFirstServiceHintByte(const TUint8 aFirstServiceHintByte);
williamr@2
   509
	
williamr@2
   510
	/** Returns the remote device's first service hint byte. Service hint bytes indicate 
williamr@2
   511
	the level of IrLMP support provided by the device.
williamr@2
   512
	
williamr@2
   513
	@return The second service hint byte. The individual bits have the following 
williamr@2
   514
	meaning: Bit 0 (0x01) - Telephony Bit 1 (0x02) - File Server Bit 2 (0x04) 
williamr@2
   515
	- IrCOMM Bit 3 (0x08) - reserved Bit 4 (0x10) - reserved Bit 5 (0x20) - IrOBEX 
williamr@2
   516
	Bit 6 (0x40) - reserved Bit 7 (0x80) - Extension */
williamr@2
   517
	IMPORT_C TUint8 GetSecondServiceHintByte() const;
williamr@2
   518
	
williamr@2
   519
	/** Sets the second service hint byte for the remote device. The service hint bytes 
williamr@2
   520
	indicate the level of IrLMP support provided by the device.
williamr@2
   521
	
williamr@2
   522
	@param aSecondServiceHintByte The second service hint byte. The individual 
williamr@2
   523
	bits have the following meaning: Bit 0 (0x01) - Telephony Bit 1 (0x02) - File 
williamr@2
   524
	Server Bit 2 (0x04) - IrCOMM Bit 3 (0x08) - reserved Bit 4 (0x10) - reserved 
williamr@2
   525
	Bit 5 (0x20) - IrOBEX Bit 6 (0x40) - reserved Bit 7 (0x80) - Extension */
williamr@2
   526
	IMPORT_C void SetSecondServiceHintByte(const TUint8 aSecondServiceHintByte);
williamr@2
   527
	
williamr@2
   528
	/** Returns the number of service hint bytes for the remote device.
williamr@2
   529
	
williamr@2
   530
	@return The number of service hint bytes. */
williamr@2
   531
	IMPORT_C TUint8 GetServiceHintByteCount() const;
williamr@2
   532
	
williamr@2
   533
	/** Sets the number of service hint bytes for the remote device.
williamr@2
   534
	
williamr@2
   535
	@param aServiceHintByteCount The number of service hint bytes. */
williamr@2
   536
	IMPORT_C void SetServiceHintByteCount(const TUint8 aServiceHintByteCount);
williamr@2
   537
	IMPORT_C TUint8 GetHomePort() const;
williamr@2
   538
	IMPORT_C void SetHomePort(const TUint8 aHomePort);
williamr@2
   539
	IMPORT_C TUint8 GetRemotePort() const;
williamr@2
   540
	IMPORT_C void SetRemotePort(const TUint8 aRemotePort);
williamr@2
   541
private:
williamr@2
   542
	SIrdaAddr* addrPtr() const;
williamr@2
   543
	};
williamr@2
   544
williamr@2
   545
enum TIASDataType
williamr@2
   546
/** An enumeration whose enumerators define the type of response received from 
williamr@2
   547
an Information Access Service (IAS) query.
williamr@2
   548
williamr@2
   549
@see TIASResponse */
williamr@2
   550
{
williamr@2
   551
	/** No response type defined. */
williamr@2
   552
	EIASDataMissing=0,
williamr@2
   553
	/** The response type is an integer. */
williamr@2
   554
	EIASDataInteger=1,
williamr@2
   555
	/** The response type is binary data. */
williamr@2
   556
	EIASDataOctetSequence=2,
williamr@2
   557
	/** The response type is a string. */
williamr@2
   558
	EIASDataUserString=3
williamr@2
   559
};
williamr@2
   560
williamr@2
   561
enum TIASCharSet
williamr@2
   562
/** The character set encoding of the character string response from an IAS query.
williamr@2
   563
williamr@2
   564
@see TIASResponse::GetCharString()
williamr@2
   565
@see TIrdaSockAddr::GetCharacterSet() */
williamr@2
   566
	{ 
williamr@2
   567
	/** String is standard ASCII. */
williamr@2
   568
	EIASCharSetUserStringASCII =0x00,
williamr@2
   569
	/** String is ISO Latin-1. */
williamr@2
   570
	EIASCharSetUserStringISO_8859_1=0x01,
williamr@2
   571
	/** String is ISO Latin-2. */
williamr@2
   572
	EIASCharSetUserStringISO_8859_2=0x02,
williamr@2
   573
	/** String is ISO Latin-3. */
williamr@2
   574
	EIASCharSetUserStringISO_8859_3=0x03,
williamr@2
   575
	/** String is ISO Latin-4. */
williamr@2
   576
	EIASCharSetUserStringISO_8859_4=0x04,
williamr@2
   577
	/** String is ISO-8859-5 (Cyrillic). */
williamr@2
   578
	EIASCharSetUserStringISO_8859_5=0x05,
williamr@2
   579
	/** String is ISO-8859-6 (Arabic). */
williamr@2
   580
	EIASCharSetUserStringISO_8859_6=0x06,
williamr@2
   581
	/** String is ISO-8859-7 (Greek). */
williamr@2
   582
	EIASCharSetUserStringISO_8859_7=0x07,
williamr@2
   583
	/** String is ISO-8859-8 (Hebrew). */
williamr@2
   584
	EIASCharSetUserStringISO_8859_8=0x08,
williamr@2
   585
	/** String is ISO Latin-5. */
williamr@2
   586
	EIASCharSetUserStringISO_8859_9=0x09,
williamr@2
   587
	/** String is UNICODE. */
williamr@2
   588
	EIASCharSetUserStringUnicode=0xFF,
williamr@2
   589
	};
williamr@2
   590
williamr@2
   591
NONSHARABLE_CLASS(TIASQuery) : public TBuf8<KMaxQueryStringLength>
williamr@2
   592
/** An Information Access Service (IAS) query to another device's IAS server.
williamr@2
   593
@publishedAll
williamr@2
   594
@released
williamr@2
   595
@see TIASResponse */
williamr@2
   596
	{
williamr@2
   597
public:
williamr@2
   598
	IMPORT_C TIASQuery(const TDesC8& aClass,const TDesC8& aAttribute,TUint aRemoteDevAddr);
williamr@2
   599
	IMPORT_C TIASQuery();
williamr@2
   600
	IMPORT_C void Set(const TDesC8& aClass,const TDesC8& aAttribute,TUint aRemoteDevAddr);
williamr@2
   601
	IMPORT_C void Get(TDes8& aClass,TDes8& aAttribute,TUint& aRemoteDevAddr);
williamr@2
   602
private:
williamr@2
   603
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   604
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   605
	TUint32     iPadding1; 
williamr@2
   606
	TUint32     iPadding2; 
williamr@2
   607
	};
williamr@2
   608
williamr@2
   609
NONSHARABLE_CLASS(TIASResponse) : public TBuf8<KMaxQueryStringLength>
williamr@2
   610
/** Response from an Information Access Service (IAS) query to another device's 
williamr@2
   611
IAS server.
williamr@2
   612
@publishedAll
williamr@2
   613
@released
williamr@2
   614
@see TIASQuery */
williamr@2
   615
	{
williamr@2
   616
public:		// But not exported :-)
williamr@2
   617
	void SetToInteger(TUint anInteger);
williamr@2
   618
	void SetToCharString(const TDesC8& aCharString);
williamr@2
   619
	void SetToOctetSeq(const TDesC8& aData);
williamr@2
   620
#ifdef _UNICODE
williamr@2
   621
	void SetToCharString(const TDesC16& aWideString);
williamr@2
   622
#endif
williamr@2
   623
williamr@2
   624
public:
williamr@2
   625
	IMPORT_C TIASResponse();
williamr@2
   626
/** Indicates the response contains a list. */
williamr@2
   627
	IMPORT_C TBool IsList() const;
williamr@2
   628
/** Indicates the number of items in the response. */
williamr@2
   629
	IMPORT_C TInt NumItems() const;
williamr@2
   630
williamr@2
   631
/** Returns the type of the response.
williamr@2
   632
	
williamr@2
   633
	@return An enumeration identifying the type of response. */
williamr@2
   634
	IMPORT_C TIASDataType Type() const;
williamr@2
   635
williamr@2
   636
	IMPORT_C TInt GetInteger(TInt &aResult,TInt anIndex=0) const;
williamr@2
   637
	IMPORT_C TInt GetOctetSeq(TDes8 &aResult,TInt anIndex=0) const;
williamr@2
   638
	IMPORT_C TInt GetCharString(TDes8 &aResult,TInt anIndex=0) const;
williamr@2
   639
	IMPORT_C const TPtrC8 GetCharString8(TInt anIndex=0) const;
williamr@2
   640
	
williamr@2
   641
	/** Gets the response string.
williamr@2
   642
	
williamr@2
   643
	This is called if the response type indicates a string.
williamr@2
   644
	
williamr@2
   645
	@param aResult On return, an 8 bit modifiable descriptor containing the response 
williamr@2
   646
	string. The length of the response string can never be greater than the value 
williamr@2
   647
	of (KMaxQueryStringLength - 3). 
williamr@2
   648
	@param anIndex Reserved for future use. This argument must be allowed to default 
williamr@2
   649
	to 0 and must not be overriden. 
williamr@2
   650
	@return If successful, one of the TIASCharSet enumerator values defining the 
williamr@2
   651
	character set encoding of the response string. KErrNotSupported, if a non-zero 
williamr@2
   652
	value has been specified for anIndex. KErrCorrupt, if the response type is 
williamr@2
   653
	not a string. 
williamr@2
   654
	@see TIASResponse::Type() */
williamr@2
   655
	IMPORT_C TInt GetCharString(TDes16 &aResult,TInt anIndex=0) const;
williamr@2
   656
williamr@2
   657
	IMPORT_C const TPtrC16 GetCharString16(TInt anIndex=0) const;
williamr@2
   658
	
williamr@2
   659
private:
williamr@2
   660
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   661
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   662
	TUint32     iPadding1;
williamr@2
   663
	TUint32     iPadding2;	
williamr@2
   664
	};
williamr@2
   665
williamr@2
   666
NONSHARABLE_CLASS(TIASDatabaseEntryV001)
williamr@2
   667
/** The data for an Information Access Service (IAS) record in the network database.
williamr@2
   668
williamr@2
   669
An object of this type is contained in a packaged modifiable buffer descriptor.
williamr@2
   670
@publishedAll
williamr@2
   671
@released
williamr@2
   672
@see TIASDatabaseEntry */
williamr@2
   673
	{
williamr@2
   674
public:
williamr@2
   675
	IMPORT_C TIASDatabaseEntryV001();
williamr@2
   676
	
williamr@2
   677
	/** The class name for the IAS entry
williamr@2
   678
	
williamr@2
   679
	This is a template specialisation of a TBuf8<TInt> */
williamr@2
   680
	TBuf8<KIASClassNameMax> iClassName;
williamr@2
   681
	
williamr@2
   682
	/** The attribute for the IAS entry.
williamr@2
   683
	
williamr@2
   684
	This is a template specialisation of a TBuf8<TInt> */
williamr@2
   685
	TBuf8<KIASAttributeNameMax> iAttributeName;
williamr@2
   686
	
williamr@2
   687
	/** The response data. */
williamr@2
   688
	TIASResponse iData;
williamr@2
   689
	
williamr@2
   690
private:
williamr@2
   691
	// This data padding has been added to help prevent future binary compatibility breaks	
williamr@2
   692
	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
williamr@2
   693
	TUint32     iPadding1; 
williamr@2
   694
	TUint32     iPadding2; 	
williamr@2
   695
	};
williamr@2
   696
	
williamr@2
   697
NONSHARABLE_CLASS(TIASDatabaseEntry) : public TPckgBuf<TIASDatabaseEntryV001>
williamr@2
   698
/** An Information Access Service (IAS) record in the network database.
williamr@2
   699
williamr@2
   700
The record data is contained in an object of type TIASDatabaseEntryV001 packaged 
williamr@2
   701
in a modifiable buffer descriptor.
williamr@2
   702
@publishedAll
williamr@2
   703
@released
williamr@2
   704
@see RNetDatabase */
williamr@2
   705
	{
williamr@2
   706
public:
williamr@2
   707
	IMPORT_C void SetClassName(const TDesC8& aClassName);
williamr@2
   708
	IMPORT_C void SetAttributeName(const TDesC8& anAttributeName);
williamr@2
   709
	IMPORT_C void SetToInteger(const TUint anInteger);
williamr@2
   710
	IMPORT_C void SetToCharString(const TDesC8& aCharString);
williamr@2
   711
	
williamr@2
   712
	/** Sets the response type corresponding to the class and attribute defined in 
williamr@2
   713
	this record, as binary data.
williamr@2
   714
	
williamr@2
   715
	@param aData The response binary data. The length of this data can never be 
williamr@2
   716
	greater than (KMaxQueryStringLength - 3). */
williamr@2
   717
	IMPORT_C void SetToOctetSeq(const TDesC8& aData);
williamr@2
   718
williamr@2
   719
#ifdef _UNICODE	//need to be able to enter wide entries in unicode builds
williamr@2
   720
	IMPORT_C void SetToCharString(const TDesC16& aWideString);//new export
williamr@2
   721
#endif
williamr@2
   722
	};
williamr@2
   723
williamr@2
   724
#endif // __IR_SOCK_H__