User Manual

Table Of Contents
225
CATC MERLINS WAND 1.22 APPENDIX C
Users Manual Merlin’s Wand Scripting Commands
Comments
Receives data from a device connected via RFCOMM. Waits Timeout mil-
liseconds (or infinitely if 0 is specified) for the device to begin sending data
to Merlin's Wand.
Example
#Get the data; stop when no data is received for 5 secs
result = RFReceiveData(Device, DLCI, 5000);
while(result[0] == "Success")
{
Trace("Number of data bytes received: ", result[1],
"\n");
result = RFReceiveData(Device, DLCI, 5000);
}
RFWaitForConnection()
RFWaitForConnection(ServerID, Timeout)
Return value
Returns a list with three values: status, DLCI, and BluetoothDevice.
Status (element 0) is one of the following:
“Success”
“Timed out”
“Failure”
DLCI (element 1) is the data link connection identifier.
BluetoothDevice (element 2) is the address of the connecting device.
Comments
Waits Timeout milliseconds for a device to establish an RFCOMM connec-
tion with Merlin’s Wand. This function will block the specified amount of
time (or infinitely if 0 is specified) unless a connection is established. If an
Parameter Meaning Default Value Comments
ServerID Service ID for
RFCOMM
channel
Timeout Time in ms to
wait for an
RFCOMM
connection
0 (Infinite
wait)
Use 0 as the timeout value to wait infinitely.