Senddatasync method, Senddatasyncwlen method, Senddatasync – MagTek BLUETOOTH SWIPE READER User Manual
Page 20: Method, Senddatasyncwlen

Bluetooth Java Applet Reference Manual
14
Remarks
Send specific command to the Bluetooth reader. The length of the sRequest is not automatically
calculated by the component. If the command fails or encounters an error, the error will be return
and the user needs to parse it.
The SendDataWlen method has this part:
Example
String response = SendDataWlen(“000110”);
The response will be a hexadecimal string returned from the reader. An empty string returned
indicates that the communication between the applet and the reader might most likely be
disconnected.
SENDDATASYNC METHOD
Returns an integer indicating the execution of the command.
Syntax
int SendDataSync(String sRequest, byte[] response)
Remarks
Send specific command to the Bluetooth reader. The length of the sRequest is automatically
calculated by the component. The result is sent through the response parameter and the result can
also be retrieved with SwipeCommandOutput() method. If SendDataSync returns a zero (0) the
command executes successfully, otherwise a non-zero for error.
The SendDataSync method has these parts:
Example
byte [] response;
int stat = SendDataSync(“0010”, response);
This returns a zero (0) if the command executes successfully. To retrieve the output, use
SwipeCommandOutput() method.
The response will be the data part of the returning hex string from the reader.
SENDDATASYNCWLEN METHOD
Returns an integer indicating the execution of the command.
Part
Data Type
Description
sRequest
String
Command
Part
Data Type
Description
sRequest
String
Command
response
Byte[]
Response by reference