datacommsserver/networkcontroller/ts_common/etel.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __ETEL_H__
       
    17 #define __ETEL_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 /** Major version number.*/
       
    22 const TUint KEtelMajorVersionNumber=1;
       
    23 /** Minor version number. */
       
    24 const TUint KEtelMinorVersionNumber=0;
       
    25 /** Build number. */
       
    26 const TUint KEtelBuildVersionNumber=606;
       
    27 /**
       
    28 @internalComponent
       
    29 */
       
    30 IMPORT_C void PanicClient(TInt aFault);
       
    31 
       
    32 //
       
    33 // Etel Core Error Definitions
       
    34 //
       
    35 
       
    36 const TInt KErrEtelCoreBase = -2000;
       
    37 
       
    38 /** The client is not the call owner and has attempted to perform an operation 
       
    39 that requires ownership.*/
       
    40 const TInt KErrEtelNotCallOwner=KErrEtelCoreBase;
       
    41 /** An attempt has been made to load an ETel (TSY) module which contains a phone 
       
    42 with the same name as one already loaded. */
       
    43 const TInt KErrEtelDuplicatePhoneName=KErrEtelCoreBase-1;
       
    44 /** An attempt has been made to acquire call ownership when the requesting client 
       
    45 is already the call owner. */
       
    46 const TInt KErrEtelAlreadyCallOwner=KErrEtelCoreBase-2;
       
    47 /** A connection has been terminated because the carrier has been lost. */
       
    48 const TInt KErrEtelNoCarrier=KErrEtelCoreBase-3;
       
    49 /** An attempt to establish a connection with the RCall::Dial() function has failed 
       
    50 because the remote party's line was busy. */
       
    51 const TInt KErrEtelBusyDetected=KErrEtelCoreBase-4;
       
    52 /** An attempt has been made to transfer call ownership, but no other clients are 
       
    53 interested in acquiring ownership. */
       
    54 const TInt KErrEtelNoClientInterestedInThisCall=KErrEtelCoreBase-5;
       
    55 /** The TSY has failed to initialise the modem. This may be occur if the modem 
       
    56 is disconnected during initialisation, or if an attempt is made to initialise 
       
    57 an unsupported modem. */
       
    58 const TInt KErrEtelInitialisationFailure=KErrEtelCoreBase-6;
       
    59 /** An attempt has been made to perform an operation which requires the call to 
       
    60 be connected - when the call is not connected. E.g. RCall:LoanDataPort(). */
       
    61 const TInt KErrEtelCallNotActive=KErrEtelCoreBase-7;
       
    62 /** A connection request has failed because there is no answer. */
       
    63 const TInt KErrEtelNoAnswer=KErrEtelCoreBase-8;
       
    64 /** A connection request has failed because there is no dial tone. For example, 
       
    65 if there is no connection between the modem and the network. */
       
    66 const TInt KErrEtelNoDialTone=KErrEtelCoreBase-9;
       
    67 /** An attempt to configure the port has failed because the hardware cannot match 
       
    68 the desired configuration. For example, if an attempt is made to configure 
       
    69 the comms port to a baud rate it cannot support. */
       
    70 const TInt KErrEtelConfigPortFailure=KErrEtelCoreBase-10;
       
    71 /** Out of memory error - global chunk cannot be created. */
       
    72 const TInt KErrEtelFaxChunkNotCreated=KErrEtelCoreBase-11;
       
    73 /** The client is not the fax owner and has attempted to perform an operation that 
       
    74 requires fax ownership.
       
    75 
       
    76 The fax client should be used to access fax functionality. Consequently, client 
       
    77 code should not return this error. */
       
    78 const TInt KErrEtelNotFaxOwner=KErrEtelCoreBase-12;
       
    79 /** An attempt has been made to perform an operation which requires port ownership. 
       
    80 However, the client does not own the port. */
       
    81 const TInt KErrEtelPortNotLoanedToClient=KErrEtelCoreBase-13;
       
    82 /** An operation has failed because the modem has been incorrectly configured. */
       
    83 const TInt KErrEtelWrongModemType=KErrEtelCoreBase-14;
       
    84 /** An operation has failed because the modem does not understand the request - 
       
    85 possible bug in modem. */
       
    86 const TInt KErrEtelUnknownModemCapability=KErrEtelCoreBase-15;
       
    87 /** The call has already placed an 'answer incoming call' request. Only 1 request 
       
    88 of a type (e.g. fax, voice, data) can be outstanding on the server at a time. */
       
    89 const TInt KErrEtelAnswerAlreadyOutstanding=KErrEtelCoreBase-16;
       
    90 /** An attempt to establish a connection with the modem has failed because the 
       
    91 modem cannot be detected. */
       
    92 const TInt KErrEtelModemNotDetected=KErrEtelCoreBase-17;
       
    93 /** Operation failed because the modem settings are corrupt. */
       
    94 const TInt KErrEtelModemSettingsCorrupt=KErrEtelCoreBase-18;
       
    95 /** The Data port is in use by another call or application. */
       
    96 const TInt KErrEtelPortAlreadyLoaned=KErrEtelCoreBase-19;
       
    97 /** Another call active. Close it before opening a new one. */
       
    98 const TInt KErrEtelCallAlreadyActive=KErrEtelCoreBase-20;
       
    99 class CEtelBehaviourBase;
       
   100 //
       
   101 //
       
   102 // RTelSubSessionBase
       
   103 //
       
   104 //
       
   105 /**
       
   106 A base class used in the derivation of RCall, RLine, and RPhone. It has no user
       
   107 accessible functions. 
       
   108 
       
   109 @publishedPartner
       
   110 @released
       
   111 */
       
   112 class RTelSubSessionBase 
       
   113 	{
       
   114 public:
       
   115 	inline RTelSubSessionBase() {};
       
   116 	};
       
   117 class RTelServer : public CBase
       
   118 	{
       
   119 public:
       
   120 	TInt Connect();
       
   121 	void Close();
       
   122 
       
   123 	enum TNetworkType
       
   124 		{
       
   125 		ENetworkTypeWiredAnalog,
       
   126 		ENetworkTypeWiredDigital,
       
   127 		ENetworkTypeMobileAnalog,
       
   128 		ENetworkTypeMobileDigital,
       
   129 		ENetworkTypeUnknown
       
   130 		};
       
   131 	
       
   132 	struct  TPhoneInfo
       
   133 		{
       
   134 		TNetworkType iNetworkType;
       
   135 		TName iName;
       
   136 		TUint iNumberOfLines;
       
   137 		TUint iExtensions;
       
   138 		};
       
   139 	
       
   140 	TInt EnumeratePhones(TInt& aNoOfPhones) const;
       
   141 	TInt GetPhoneInfo(const TInt aIndex,TPhoneInfo& aInfo) const;
       
   142 	TInt GetTsyName(const TInt aIndexOfPhone, TDes& aTsyName) const;
       
   143 
       
   144 	TInt LoadPhoneModule(const TDesC& aFileName);
       
   145 	TInt UnloadPhoneModule(const TDesC& aFileName) const;
       
   146 
       
   147 	CEtelBehaviourBase* TestBehaviour() const;
       
   148 
       
   149 private:
       
   150 	static CEtelBehaviourBase* CreateTestBehaviourL(const TDesC& aFileName);
       
   151 
       
   152 private:
       
   153 	CEtelBehaviourBase* iTestBehaviour;
       
   154 	};
       
   155 
       
   156 class RPhone
       
   157 	{
       
   158 public:
       
   159 	TInt Open(RTelServer& aSession,const TDesC& aName);
       
   160 	void Close();
       
   161 
       
   162 	void CancelAsyncRequest(TInt aReqToCancel) const;
       
   163 	
       
   164 	enum TCapsFlags
       
   165 		{
       
   166 		KCapsUnknown=0x00000001,
       
   167 		KCapsData=0x00000002,
       
   168 		KCapsFaxClassOne=0x0000004,
       
   169 		KCapsFaxClassOnePointZero=0x0000008,
       
   170 		KCapsFaxClassTwo=0x00000010,
       
   171 		KCapsFaxClassTwoPointZero=0x00000020,
       
   172 		KCapsFaxClassTwoPointOne=0x00000040,
       
   173 		KCapsVoice=0x00000080,
       
   174 		KCapsEventModemDetection=0x00010000,
       
   175 		KCapsStealCommPort=0x00020000
       
   176 		};
       
   177 
       
   178 	struct TCaps
       
   179 		{
       
   180 		TUint iFlags;
       
   181 		};
       
   182 
       
   183 	TInt GetCaps(TCaps& aCaps) const;
       
   184 
       
   185 	CEtelBehaviourBase* TestBehaviour() const;
       
   186 
       
   187 protected:
       
   188 	CEtelBehaviourBase* iTestBehaviour;
       
   189 	};
       
   190 
       
   191 class RCall
       
   192 	{
       
   193 public:
       
   194 	struct  TCommPort
       
   195 		{
       
   196 		TFileName iCsy;
       
   197 		TName iPort;
       
   198 		};
       
   199 	};
       
   200 
       
   201 
       
   202 #endif // __ETEL_H__
       
   203