Elatec GmbH TWN3A1 User Manual

Page of 44
Elatec GmbH 
Page 36 of 44 
byte HostTestCmd(byte &Cmd, byte &CmdLen, byte MaxCmdLen) 
This command implements a generic method for receiving an array of bytes from the host. This 
enables the programmer to implement a simple interface, which executes commands sent from the 
host to the reader. A host command is any sequence of ASCII characters which is terminated by ‘\r’. 
The character ‘\n’ can be sent optionally but is ignored by the reader. 
Parameters: 
byte &Cmd
 
A reference to an array of bytes, which contains the received ASCII data 
from the host (without the ‘\r’). 
byte &CmdLen
 
The number of bytes, which have been received from the host. Even a 
command of the length 0 can be received. 
byte MaxCmdLen
 
This value specifies the maximum number of bytes the array of bytes 
Cmd can hold. 
Return: 
If a command has been received from the host, the return value is 
TRUE
, otherwise it is FALSE. 
 
7.2.5.3  Accessing LEDs 
void LEDSet(byte LEDs, byte Status) 
Set the state of the red and/or the green LED. 
Parameters: 
byte LEDs
 
Binary or of the LEDs to be switched. The green LED is represented by 
the constant GREEN, the red LED is represented by the constant RED. 
byte Status
 
The new status for the LEDs specified by LEDs. It may be either one of 
the following constants: 
OFF
 
Turn off 
ON
 
Turn on 
BLINK
:   
Blink 
TOGGLE
:  
Toggle on/off state. This has no 
   
 
influence on a blinking LED 
Return: 
None. 
 
Examples: 
LEDSet(GREEN | RED,ON);    // Turn on both green and red LED 
LEDSet(GREEN,BLINK);       // Let the green LED blink 
 
byte LEDGet(byte LED) 
Get the current status of a LED. Only the status of one LED can be retrieved at a time. 
Parameter: 
byte LED
 
Specifies either the value for the green (constant GREEN) or the red 
(constant RED) LED. 
Return: 
The current status of the LED specified by LED. 
OFF
 
The LED is off 
ON
 
The LED is on 
BLINK
:   
The LED is blinking