epoc32/include/c32comm.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     2
// All rights reserved.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     3
// This component and the accompanying materials are made available
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     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
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     5
// which accompanies this distribution, and is available
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     7
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     8
// Initial Contributors:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     9
// Nokia Corporation - initial contribution.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    10
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    11
// Contributors:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    12
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    13
// Description:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    14
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    15
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    16
#ifndef SYMBIAN_C32_SERCOMMS_V2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    17
// PLEASE NOTE: This file is part of Version 2 of C32 - that is, the multi-threaded version.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    18
// The single-threaded C32 version of this file is in c32\Version1\SCOMM
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    19
// All defect fixes should be applied to both versions where appropriate.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    20
// PLEASE NOTE: This comment is applicable to SercommsV2 but is surrounded by an "#ifndef"
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    21
// to enable the automatic removal of this comment once non-C32 V2 code is removed.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    22
#endif
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    23
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    24
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    25
#ifndef C32COMM_H
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    26
#define C32COMM_H
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    27
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    28
/** @file
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    29
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    30
C32 header file to be included by the clients.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    31
Defines the main interface to C32, RCommServ and RComm
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    32
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    33
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    34
#include <e32base.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    35
#include <d32comm.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    36
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    37
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    38
@publishedAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    39
@released	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    40
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    41
IMPORT_C TInt StartC32();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    42
IMPORT_C TInt StartC32WithCMISuppressions(const TDesC& aCMISuppressionList);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    43
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    44
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    45
C32 major version number.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    46
@internalAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    47
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    48
const TUint KEC32MajorVersionNumber = 1;  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    49
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    50
C32 minor version number.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    51
@internalAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    52
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    53
const TUint KEC32MinorVersionNumber = 0;  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    54
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    55
C32 build version number.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    56
@internalAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    57
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    58
const TUint KEC32BuildVersionNumber = 605;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    59
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    60
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    61
@internalComponent
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    62
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    63
const TDesC& KCommServerName(void);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    64
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    65
/** Specifies the mode in which a port is opened.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    66
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    67
We specify the mode when it is opened, and the mode cannot thereafter be
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    68
changed. If we open the port in Shared mode, other clients of the comms
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    69
server can use the same port while we have it open. If we open the port
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    70
in Exclusive mode, then it is locked for our own use and any attempt to
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    71
access it from another process will fail. Furthermore, our own attempt
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    72
to open a port in exclusive mode will fail if another process has already
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    73
opened the port in shared mode.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    74
 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    75
Infra-red ports using IRCOMM.CSY can be opened in either shared or exclusive 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    76
mode. However they SHOULD only be opened in Exclusive mode, since opening 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    77
them any other way warm-boots the computer.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    78
 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    79
@publishedAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    80
@released	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    81
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    82
enum TCommAccess
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    83
    {
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    84
	/** Once open, the port cannot be used by any other RComm clients. An attempt to 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    85
	open a port in exclusive mode will fail if another process has already opened 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    86
	the port in shared mode. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    87
	ECommExclusive,  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    88
	/** The port can be shared by other RComm clients who open in the same mode. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    89
	ECommShared,    
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    90
	/** Allows another client to pre-empt the session with an open request in one of 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    91
	the other two modes. The port will be lost if other clients are trying to open it.*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    92
	ECommPreemptable 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    93
    };
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    94
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    95
Use full buffering. Used by RComm::SetMode().
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    96
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    97
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    98
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    99
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   100
const TUint KCommBufferFull    = 0x0000; 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   101
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   102
Use partial buffering. Used by RComm::SetMode().
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   103
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   104
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   105
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   106
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   107
const TUint KCommBufferPartial = 0x0001;  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   108
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   109
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   110
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   111
trace flags for debugging purposes
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   112
@internalComponent
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   113
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   114
enum TC32Trace 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   115
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   116
	ETraceC32Startup = 0x00000001,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   117
	ETraceC32Panic   = 0x00000002,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   118
	ETraceC32Request = 0x00000004,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   119
	ETraceC32IPC     = 0x00000008,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   120
	ETraceC32All     = 0xFFFFFFFF,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   121
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   122
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   123
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   124
Used by the package TCommServerConfig to configure the comm port.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   125
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   126
Holds the buffer configuration settings for the comms server. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   127
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   128
The comms server copies data between the descriptors provided by the client 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   129
and the buffers used by the serial port drivers, for each read and write request. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   130
There are two methods by which this can be accomplished. Full buffering means 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   131
that the comms server will always attempt to allocate enough memory to satisfy 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   132
any reads or writes in a single copy, while partial buffering means that the 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   133
comms server will allocate a static buffer and use partial copies to transfer 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   134
data to the serial driver. When a port is opened, the default is full buffering. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   135
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   136
@publishedAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   137
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   138
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   139
struct TCommServerConfigV01
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   140
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   141
	/** Buffering option: either KCommBufferFull or KCommBufferPartial */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   142
	TUint iBufFlags; ///< contains buffer flags e.g for partial read/write
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   143
	/** Size of server buffer if partial buffering is being used */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   144
	TUint iBufSize;  ///< size of the Tx/Rx buffer
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   145
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   146
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   147
/** Package buffer for a server configuration object. TCommServerConfig is used 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   148
as an argument to RComm::Mode() and RComm::SetMode(). 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   149
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   150
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   151
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   152
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   153
typedef TPckgBuf<TCommServerConfigV01> TCommServerConfig; 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   154
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   155
/** Maximum length of port full name, TPortDescription (48 characters).
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   156
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   157
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   158
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   159
 */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   160
const TInt KMaxPortDescription = 0x30; 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   161
/** Maximum length of the Port Prefix format name, as used by TPortName (16 characters). 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   162
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   163
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   164
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   165
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   166
const TInt KMaxPortName = 0x10;        
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   167
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   168
/** Reset the receive buffer 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   169
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   170
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   171
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   172
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   173
const TUint KCommResetRx = 0x00000001;  ///< to by used as flag by RComm::ResetBuffers
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   174
/** Reset the transmit buffer 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   175
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   176
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   177
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   178
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   179
const TUint KCommResetTx = 0x00000002;  ///< to by used as flag by RComm::ResetBuffers
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   180
/** Port name. Used by TSerialInfo::iName. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   181
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   182
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   183
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   184
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   185
typedef TBuf<KMaxPortName> TPortName;            
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   186
/** Full port name/description. Used by TSerialInfo::iDescription. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   187
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   188
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   189
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   190
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   191
typedef TBuf<KMaxPortDescription> TPortDescription; 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   192
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   193
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   194
class TSerialInfo
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   195
/** Describes a serial protocol's general capabilities.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   196
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   197
Used by RCommServ::GetPortInfo to retrieve information
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   198
about the comm ports and the CSY.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   199
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   200
Notes:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   201
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   202
1. The lowest port need not necessarily be numbered zero.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   203
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   204
2. At least one port is always guaranteed. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   205
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   206
3. The full name of the serial port (used when opening it) consists of the name 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   207
  returned by TSerialInfo (the Port Prefix), followed by a double colon separator, followed by 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   208
  the unit number (port number) as an ASCII number (for instance COMM::0). 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   209
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   210
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   211
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   212
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   213
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   214
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   215
	/** Description of the CSY meant only for human reading. It
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   216
	can be up to KMaxPortDescription (48) characters long. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   217
	TPortDescription iDescription; ///< description of the port (CSY)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   218
	/** The short name of the port (Port Prefix). This is used in calls to RComm::Open(). It can be up to 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   219
	KMaxPortName (i.e. 16) characters long. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   220
	TPortName iName;               ///< name of the port
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   221
	TUint iLowUnit;                ///< The lowest port number supported by the serial module
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   222
	TUint iHighUnit;               ///< the highest port number supported by the serial module
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   223
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   224
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   225
/**
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   226
Specifies the DTE/DCE role in which a port is opened.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   227
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   228
@see RComm::Open() 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   229
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   230
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   231
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   232
enum TCommRole
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   233
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   234
	/** Port takes on role of DTE. (DTE=computer).
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   235
	This is the default.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   236
	*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   237
		ECommRoleDTE, 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   238
	/** Port takes on role of DCE. (DCE=modem).
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   239
	*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   240
		ECommRoleDCE  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   241
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   242
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   243
class RComm;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   244
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   245
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   246
class RCommServ : public RSessionBase
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   247
/** Represents a session with the serial comms server. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   248
Functions are provided for connection 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   249
to the server and for loading and unloading different comms modules, and services 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   250
for finding out the name and numbers of the available ports. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   251
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   252
Sessions with the serial comms server are not shareable.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   253
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   254
Comms modules are also known as "CSY"s due to their ".CSY" extension,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   255
 derived from the term "Comms SYstem".
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   256
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   257
This class is not intended for user derivation.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   258
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   259
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   260
@released */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   261
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   262
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   263
	IMPORT_C RCommServ();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   264
	IMPORT_C TInt Connect();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   265
	IMPORT_C TVersion Version() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   266
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   267
	IMPORT_C TInt LoadCommModule(const TDesC& aFileName);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   268
	IMPORT_C TInt UnloadCommModule(const TDesC& aName);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   269
	IMPORT_C TInt NumPorts(TInt& aNum);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   270
	IMPORT_C TInt GetPortInfo(const TDesC& aName, TSerialInfo& aInfo);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   271
	IMPORT_C TInt GetPortInfo(TInt aIndex, TDes& aModuleName, TSerialInfo& aInfo);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   272
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   273
	IMPORT_C TInt __DbgMarkHeap();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   274
	IMPORT_C TInt __DbgCheckHeap(TInt aCount);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   275
	IMPORT_C TInt __DbgMarkEnd(TInt aCount);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   276
	IMPORT_C TInt __DbgFailNext(TInt aCount);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   277
	IMPORT_C TInt __DbgSetTraceMask(TC32Trace aMask);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   278
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   279
	IMPORT_C static TInt CreateThreadInCommProc(const TDesC& aLibraryName, const TDesC& aThreadName, TThreadFunction aFunction, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   280
private:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   281
	static TBool IsServerThreadL();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   282
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   283
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   284
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   285
struct TCommDebugInfo; // defined in d32comm.h
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   286
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   287
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   288
class RComm : public RSubSessionBase
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   289
/** A sub-session to the C32 Serial Server used for addressing a serial port.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   290
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   291
All the necessary functions are provided by this class for communicating via 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   292
a port, including functions for opening, closing, reading, writing, 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   293
port configuration and capability checking. An RComm session represents
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   294
a single serial port and once opened cannot be altered to represent another port.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   295
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   296
Ports are referenced by a character string whose format is referred to as Port Prefix format.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   297
This format is also known as the CSY internal name, and the ports "short" name in older releases.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   298
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   299
@publishedAll	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   300
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   301
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   302
		{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   303
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   304
	IMPORT_C RComm();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   305
	IMPORT_C TInt Open(RCommServ& aServer, const TDesC& aName, TCommAccess aMode);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   306
	IMPORT_C TInt Open(RCommServ& aServer, const TDesC& aName, TCommAccess aMode, TCommRole aRole);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   307
	IMPORT_C void OpenWhenAvailable(TRequestStatus& aStatus, RCommServ& aServer, const TDesC& aName);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   308
	IMPORT_C void OpenWhenAvailable(TRequestStatus& aStatus, RCommServ& aServer, const TDesC& aName, TCommRole aRole);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   309
	IMPORT_C void OpenWhenAvailableCancel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   310
	IMPORT_C void Read(TRequestStatus& aStatus, TDes8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   311
	IMPORT_C void Read(TRequestStatus& aStatus, TDes8& aDes, TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   312
	IMPORT_C void Read(TRequestStatus& aStatus, TTimeIntervalMicroSeconds32 aTimeOut, TDes8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   313
	IMPORT_C void Read(TRequestStatus& aStatus, TTimeIntervalMicroSeconds32 aTimeOut, TDes8& aDes, TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   314
	IMPORT_C void ReadOneOrMore(TRequestStatus& aStatus, TDes8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   315
	IMPORT_C TInt ReadCancel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   316
	IMPORT_C TInt QueryReceiveBuffer() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   317
	IMPORT_C TInt ResetBuffers(TUint aFlags=(KCommResetRx|KCommResetTx));
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   318
	IMPORT_C void Write(TRequestStatus& aStatus, const TDesC8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   319
	IMPORT_C void Write(TRequestStatus& aStatus, const TDesC8& aDes, TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   320
	IMPORT_C void Write(TRequestStatus& aStatus, TTimeIntervalMicroSeconds32 aTimeOut, const TDesC8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   321
	IMPORT_C void Write(TRequestStatus& aStatus, TTimeIntervalMicroSeconds32 aTimeOut, const TDesC8& aDes, TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   322
	IMPORT_C TInt WriteCancel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   323
	IMPORT_C void Break(TRequestStatus& aStatus, TTimeIntervalMicroSeconds32 aTime);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   324
	IMPORT_C TInt BreakCancel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   325
	IMPORT_C TInt Cancel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   326
	IMPORT_C TInt Config(TDes8& aConfig) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   327
	IMPORT_C TInt SetConfig(const TDesC8& aConfig);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   328
	IMPORT_C TInt Caps(TDes8& aCaps) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   329
	IMPORT_C TInt SetMode(const TCommServerConfig& aConfig);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   330
	IMPORT_C TInt Mode(TCommServerConfig& aConfig) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   331
	IMPORT_C TUint Signals(TUint aSignalMask = 0x3F) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   332
	IMPORT_C TInt SetSignalsToMark(TUint aSignalMask);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   333
	IMPORT_C TInt SetSignalsToSpace(TUint aSignalMask);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   334
	IMPORT_C TInt ReceiveBufferLength() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   335
	IMPORT_C TInt SetReceiveBufferLength(TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   336
	IMPORT_C void Close();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   337
	inline void SetSignals(TUint aSetMask, TUint aClearMask);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   338
	IMPORT_C void NotifySignalChange(TRequestStatus& aStatus, TUint& aSignals, TUint aSignalMask=0x3F);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   339
	IMPORT_C TInt NotifySignalChangeCancel() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   340
	IMPORT_C void NotifyConfigChange(TRequestStatus& aStatus, TDes8& aNewConfig) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   341
	IMPORT_C TInt NotifyConfigChangeCancel() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   342
	IMPORT_C void NotifyFlowControlChange(TRequestStatus& aStatus, TFlowControl& aFlowControl);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   343
	IMPORT_C TInt NotifyFlowControlChangeCancel() const;	  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   344
	IMPORT_C void NotifyBreak(TRequestStatus& aStatus) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   345
	IMPORT_C TInt NotifyBreakCancel() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   346
	IMPORT_C void NotifyDataAvailable(TRequestStatus& aStatus) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   347
	IMPORT_C TInt NotifyDataAvailableCancel() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   348
	IMPORT_C void NotifyOutputEmpty(TRequestStatus& aStatus) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   349
	IMPORT_C TInt NotifyOutputEmptyCancel() const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   350
	IMPORT_C TInt GetFlowControlStatus(TFlowControl& aFlowControl) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   351
	IMPORT_C TInt GetRole(TCommRole& aRole) const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   352
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   353
	IMPORT_C TInt SetAccessMode(TCommAccess aNewMode);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   354
	IMPORT_C TInt DebugState(TCommDebugInfo&);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   355
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   356
#ifdef _DEBUG_DEVCOMM
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   357
	IMPORT_C TInt RComm::DebugInfo(TDes8& aDes);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   358
#endif
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   359
private:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   360
	TPtr8 iSignalsNotification; ///< pointer to the signals to be changed during notification
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   361
	TPtr8 iFlowNotification;    ///< pointer to the flow control to be changed during notification
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   362
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   363
	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   364
#include <c32comm.inl>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   365
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   366
#endif // C32COMM_H