rfOpen (Function) |
Top Previous Next |
This function will open the RF interface. Calling this function is required before the RF interface can be used. It is necessary to call rfClose after using the interface.
The ID must be specified when calling rfOpen and is used for the filtering of packages. Only packages sent with rfSend that have the specified ID as their destination or are sent out as a broadcast will be received (see RF Functions for details).
The communication speed set by the "baud" parameter must be equal for peers to communicate. A lower communication speed will yield a longer transmission range.
Calling rfOpen will revert the power level set by rfSetPower to the default value.
Input: id : INT ( 1..254 ) ID - used for filtering of incoming packages.
baud : DINT (1200,2400,4800,9600,38400) (default 4800) Baud rate. A lower baud rate will increase the communication range.
Returns: INT
Declaration: FUNCTION rfOpen : INT;
Example: INCLUDE rtcu.inc |