TANGO Device Server
Device Commands Description
Serial Class
Revision: 1.5 - Author: taurel
1 - Init
- Description: This commands re-initialise a device keeping the same network connection.
After an Init command executed on a device, it is not necessary for client to re-connect to the device.
This command first calls the device delete_device() method and then execute its init_device() method.
For C++ device server, all the memory allocated in the nit_device() method must be freed in the delete_device() method.
The language device desctructor automatically calls the delete_device() method.
 
- Argin:
DEV_VOID
: none.
 
- Argout:
DEV_VOID
: none.
 
- Command allowed for:
 
2 - State
- Description: This command gets the device state (stored in its device_state data member) and returns it to the caller.
 
- Argin:
DEV_VOID
: none.
 
- Argout:
DEV_STATE
: State Code
 
- Command allowed for:
 
3 - Status
- Description: This command gets the device status (stored in its device_status data member) and returns it to the caller.
 
- Argin:
DEV_VOID
: none.
 
- Argout:
CONST_DEV_STRING
: Status descrition
 
- Command allowed for:
 
4 - DevSerWriteString
- Description: Write a string of characters to a serial line and return
the number of characters written.
 
- Argin:
DEV_STRING
: String to write
 
- Argout:
DEV_LONG
: Number of characters written
 
- Command allowed for:
 
5 - DevSerWriteChar
- Description: Write N characters to a seria line and return the
number of characters written.
 
- Argin:
DEVVAR_CHARARRAY
: Characters to write
 
- Argout:
DEV_LONG
: Number of characters written
 
- Command allowed for:
 
6 - DevSerReadString
- Description: Win32 method :
Read a string of characters, the type of read is specified in the
input parameter SL_RAW SL_NCHAR SL_LINE
 
- Argin:
DEV_LONG
: type of read SL_RAW SL_NCHAR SL_LINE
 
- Argout:
DEV_STRING
: String read
 
- Command allowed for:
 
7 - DevSerReadChar
- Description: Win32 method :
Read an array of characters, the type of read is specified in the
input parameter, it can be SL_RAW SL_NCHAR SL_LINE
 
- Argin:
DEV_LONG
: type of read SL_RAW SL_NCHAR SL_LINE
 
- Argout:
DEVVAR_CHARARRAY
: Array of characters read
 
- Command allowed for:
 
8 - WriteRead
- Description: This method permit to send a request to a device throw the serial line and returns the
response of the device.
The commands write and read don't return until they have not finished.
 
- Argin:
DEVVAR_LONGSTRINGARRAY
: type of reading strategy(RAW,NCHAR..),command to write on the port com
 
- Argout:
DEV_STRING
: response of the device behind the serial line
 
- Command allowed for:
 
9 - DevSerGetNChar
- Description: Return the number of chars available in receiving buffer
 
- Argin:
DEV_VOID
: no argin
 
- Argout:
DEV_LONG
: number of char available in receiving buffer
 
- Command allowed for:
 
10 - DevSerReadNChar
- Description: Read a string of N characters from the serial line
If there are no characters to be read returns an empty string.
 
- Argin:
DEV_LONG
: number of the caracters to read on the serial line
 
- Argout:
DEV_STRING
: pointer to the string read updated
 
- Command allowed for:
 
11 - DevSerReadRaw
- Description: read a string from the serialline device in mode raw (no end
of string expected, just empty the entire serialline receiving buffer).
 
- Argin:
DEV_VOID
: no argin
 
- Argout:
DEV_STRING
: pointer to the string read updated
 
- Command allowed for:
 
12 - DevSerReadLine
- Description: read a string from the serialline device in mode line (up to
and including the character specified by the NewLine property
 
- Argin:
DEV_VOID
: no argin
 
- Argout:
DEV_STRING
: pointer to the string read updated
 
- Command allowed for:
 
13 - DevSerFlush
- Description: Win32 method :
Flush serial line port according to argin passed.
 
- Argin:
DEV_LONG
: flush to do 0=input 1=output 2=both
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
14 - DevSerSetParameter
- Description: Set serial line parameters
 
- Argin:
DEVVAR_LONGARRAY
: device parameters in pair
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
15 - DevSerSetTimeout
- Description: This command sets the new timeout (in ms).
 
- Argin:
DEV_SHORT
: Value of the timeout to set
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
16 - DevSerSetParity
- Description: Sets the new parity of the serial line.
NONE 0
ODD 1
EVEN 3
 
- Argin:
DEV_SHORT
: The new parity to set.
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
17 - DevSerSetCharLength
- Description: Sets the new charlength.
0 = 8 bits
1 = 7 bits
2 = 6 bits
3 = 5 bits
 
- Argin:
DEV_SHORT
: The new charlength to set
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
18 - DevSerSetStopbit
- Description: Sets the new stop bit.
0 = none
1 = one stop
2 = 1.5 stop bit
 
- Argin:
DEV_SHORT
: The new stopbit to set
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
19 - DevSerSetBaudrate
- Description: Sets the new baudrateof the serial line ( up to 4 Mega).
Default is 9600.
 
- Argin:
DEV_ULONG
: The new baudrate to set
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
20 - DevSerSetNewline
- Description: The new ending character in hexa.
Default is 0x13 (=CR
 
- Argin:
DEV_SHORT
: The new line character to set
 
- Argout:
DEV_VOID
: no argout
 
- Command allowed for:
 
21 - DevSerReadRetry
- Description: read a string from the serialline device in mode raw (no end
of string expected, just empty the entire serialline receiving buffer).
If read successfull, read again "nretry" times.
 
- Argin:
DEV_LONG
: number of reading retries
 
- Argout:
DEV_STRING
: pointer to the string read updated
 
- Command allowed for:
 
22 - DevSerReadNBinData
- Description: Read the specified number of char from the serial line.
If the number of caracters is greater than caracters avaiable, this command returns
all caracters avaiables.
If there are no characters to be read returns an empty array.
 
- Argin:
DEV_LONG
: nb char to read
 
- Argout:
DEVVAR_CHARARRAY
: array of data
 
- Command allowed for:
 
ESRF - Software Engineering Group