All Functions Modules Pages
ir

Functions

NUMBER ir.init ()
 We load and start the module to default 9600B. More...
 
NIL ir.baud (NUMBER baud)
 Configure the port with the desired speed. More...
 
BOOLEAN ir.state ()
 It allows to know the status of the IR module. More...
 
NUMBER ir.get ()
 Receives an ascii character port. More...
 
NUMBER ir.put (NUMBER data)
 Send an ascii character to the port. More...
 
STRING ir.read ()
 You receive a message via the port. More...
 
NUMBER ir.write (STRING msg)
 Send a message via the port. More...
 
NUMBER ir.term ()
 Stops the module and close all port activity. More...
 

Detailed Description

Infrared port management "IR".

Function Documentation

NUMBER ir.init ( )

We load and start the module to default 9600B.

Note
This module can only be used on models 1000 or FAT. This feature is used only once.
Returns
1/0 Will be 1 if either charge, otherwise 0.
NIL ir.baud ( NUMBER  baud)

Configure the port with the desired speed.

Parameters
baudIt is the rate at which configure the port.
Note
No predetermined speed, this is obtained, the device to which it is communicated.
Returns
Nothing.
BOOLEAN ir.state ( )

It allows to know the status of the IR module.

Returns
true/false Depending on whether the module is started.
NUMBER ir.get ( )

Receives an ascii character port.

Returns
A number from 0 to 255 ascii, character, or -1 if there is nothing in buffer.
NUMBER ir.put ( NUMBER  data)

Send an ascii character to the port.

Parameters
dataIt is the ascii number to send.
Returns
A number 1 if successful, 0 otherwise.
STRING ir.read ( )

You receive a message via the port.

Returns
A string with the data received and a number indicating the amount of data, or nil if there is nothing in buffer.
NUMBER ir.write ( STRING  msg)

Send a message via the port.

Parameters
msgis the string to send.
Returns
A number indicating the amount of data sent successfully, or -1 on error.
NUMBER ir.term ( )

Stops the module and close all port activity.

Returns
A number 1 if successful, 0 otherwise.