SDK Home Glossary Index Left Right Up

CommServ class


Section contents


Overview

Defined in

ccomms.oxh


Construction / destruction


NewCommServ - Constructor

Usage

this& = NewCommServ&:

Description

Creates a comms server object and returns a handle which allows the object to be manipulated.

Return Value
this& An value which represents the created object
Error Handling

If the object could not be created then an error is generated which should be trapped by an ONERR handler.

Example
  LOCAL this&

  this& = NewCommServ&:
  DeleteCommServ:(this&) 

DeleteCommServ - Destructor

Usage

DeleteCommServ:(BYREF this&)

Description

Destroys the comms server object.

Arguments
BYREF this& A handle to a comms server object
Example
  LOCAL this&

  this& = NewCommServ&:
  DeleteCommServ:(this&) 

Methods provided


CommServClose

Usage

CommServClose:(this&)

Description

Closes a connection to the comms server.

Arguments
this& A handle to a comms server object
Example
  LOCAL this&,result%

  this& = NewCommServ&:
  result% = CommServConnect%:(this&)
  CommServClose:(this&)
  DeleteCommServ:(this&) 
See Also

CommServConnect


CommServConnect

Usage

result% = CommServConnect%:(this&)

Description

Opens a connection to the comms server.

Arguments
this& A handle to a comms server object
Return value
result% An error code
Example
  LOCAL this&,result%

  this& = NewCommServ&:
  result% = CommServConnect%:(this&)
  CommServClose:(this&)
  DeleteCommServ:(this&) 
See Also

CommServClose


CommServGetPortInfo

Usage

result% = CommServGetPortInfo%:(this&,name$,info&)

Description

Obtains the port information for a comms module specified by name (for example, ECUART for RS232).

Arguments
this& A handle to a comms server object
name$ A name of a serial port
info& A handle to a serial information object
Return value
result% An error code
Example
  LOCAL this&,info&,result%

  this& = NewCommServ&:
  info& = NewSerialInfo&:
  result% = CommServConnect%:(this&)
  result% = CommServGetPortInfo%:(this&,"ECUART",info&)
  CommServClose:(this&)
  DeleteSerialInfo:(info&)
  DeleteCommServ:(this&) 
See Also

CommServGetPortInfo2


CommServGetPortInfo2

Usage

result% = CommServGetPortInfo2%:(this&,index&,module&,info&)

Description

Obtains the port information for a comms module specified 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 CommServNumPorts.

Arguments
this& A handle to a comms server object
index& Index of the port (starting at 0)
modeul& A descriptor to return the name of a loaded module
info& A handle to a serial information object
Return value
result% An error code
See Also

CommServGetPortInfo


CommServLoadCommModule

Usage

result% = CommServLoadCommModule%:(this&,name$)

Description

Use this function to load a comms module.

Arguments
this& A handle to a comms server object
Return value
result% An error code
Notes
  1. There is no need for an extension (.CSY) is automatically appended by this function.
  2. This function automatically searches the /System/Libs directories on all drives for this file
  3. Two module are always available as standard. ECUART drives the built in serial port on an ARM in RS232 mode. IRCOMM drives the infra-red port on an ARM in infra-red mode.
Example
 LOCAL this&

  this& = NewCommServ&:
  result% = CommServConnect%:(this&)
  result% = CommServLoadCommModule%:(this&,"IRCOMM")
  result% = CommServUnloadCommModule%:(this&,"IRCOMM")
  CommServClose:(this&)
  DeleteCommServ:(this&) 
See Also

CommServUnloadCommModule


CommServNumPorts

Usage

result% = CommServNumPorts%:(this&,BYREF num&)

Description

Use this function to find out how many comms module (CSYs) are loaded

Arguments
this& A handle to a comms server object
BYREF num& On return, holds the number of loaded CSYs
Return value
result% An error code

CommServUnloadCommModule

Usage

result% = CommServUnloadCommModule%:(this&,name$)

Description

Use this function to unload a comms module  — for instance, if switching from RS232 to infra-red operation.

Arguments
this& A handle to a comms server object
Return value
result% An error code
Example
 LOCAL this&

  this& = NewCommServ&:
  result% = CommServConnect%:(this&)
  result% = CommServLoadCommModule%:(this&,"IRCOMM")
  result% = CommServUnloadCommModule%:(this&,"IRCOMM")
  CommServClose:(this&)
  DeleteCommServ:(this&) 
Note

There is no need to unload a comms module when the connection to the server is closed, as this is done automatically.

See Also

CommServLoadCommModule


CommServVersion

Usage

version& = CommServVersion&:(this&)

Description

Creates and returns a handle to a version object.

The version number may be incremented in future releases of the file server. If extra features are added in such releases, the version number may be used by application programs as a basis for assessing the capabilities of the file server

Arguments
this& A handle to a comms server object
Return value
version& A handle to a version object. This must be freeded with a call to DeleteVersion:
Example
 LOCAL this&,version&

  this& = NewCommServ&:
  version& = CommServVersion&:(this&)
  DeleteVersion:(version&)
  DeleteCommServ:(this&) 

  SDK Home Glossary Index Left Right Up