Rfwaitforconnection() – Teledyne LeCroy Merlins Wand - Users Manual User Manual

Page 240

Advertising
background image

224

CATC M

ERLIN

S

W

AND

2.00

C

HAPTER

C

User’s Manual

Merlin’s Wand Scripting Commands

Return value

Returns a list with three values: status, number of bytes, and data array.

Status (element 0) is one of the following:

“Success”

“Not connected”

“Timed out”

Number of bytes (element 1) is the number of bytes received.

Data array (element 2) is the sequence of data bytes received.

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)

Timeout

Time in ms to

wait for an
RFCOMM
connection

0 (Infinite

wait)

Use 0 as the timeout value to wait infinitely

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.

Parameter

Meaning

Default Value

Comments

Advertising