Location:
c32comm.h
Link against: c32.lib
RCommServ
Supported from 5.0
Represents a session with the comms server. Functions are provided for connection to the server and for loading and unloading different comms modules, and services for finding out the name and numbers of the available ports.
|
Defined in RCommServ
:
Connect()
, GetPortInfo()
, LoadCommModule()
, NumPorts()
, RCommServ()
, UnloadCommModule()
, Version()
Inherited from RHandleBase
:
Close()
,
Duplicate()
,
Handle()
,
SetHandle()
Inherited from RSessionBase
:
Attach()
,
CreateSession()
,
EAutoAttach
,
EExplicitAttach
,
Send()
,
SendReceive()
,
SetRetry()
,
Share()
,
TAttachMode
TInt Connect();
Connects a client process to the comms server.
As with any server, the connection should be closed after use.
RHandleBase
provides the necessary Close()
function,
which should be called when the server session is no longer required.
|
TInt LoadCommModule(const TDesC &aFileName);
Loads a comms module.
Note:
There is no need for an extension, as ".CSY" is automatically appended by this function.
This function automatically searches the /System/Libs directories on all drives for this file
Two module are available as standard. ECUART provides serial port services. IRCOMM provides infra-red services.
|
|
TInt UnloadCommModule(const TDesC &aName);
Unloads a comms module — for instance, if switching from RS232 to infra-red operation.
There is no need to unload a comms module when the connection to the server is closed, as this is done automatically.
|
|
TInt NumPorts(TInt& aNum);
Gets how many comms module (CSYs) are loaded.
|
|
TInt GetPortInfo(const TDesC &aName,TSerialInfo &aInfo);
TInt GetPortInfo(TInt aIndex, TDes &aModuleName, TSerialInfo &aInfo);
Gets information about the serial ports that are available. It is overloaded and can be called in two versions.
The first obtains the port information for a comms module specified by
name (for example, COMM for RS232). The second version is similar, but allows
you to specify the comms modules by an index number from 0. This allows you to
enumerate through the loaded comms modules. You can obtain the current number
of loaded comms modules by calling NumPorts()
.
|
|