Section 2. methods, Autoconnect method, Carddata method – MagTek BLUETOOTH SWIPE READER User Manual

Page 9: Autoconnect, Method, Carddata

Advertising
background image

3

SECTION 2. METHODS

In general, most methods return an integer of 0 to indicate a successful call. Otherwise, a non-
zero integer value is returned to inform that there is an error, and the error message can be
retrieved with the “GetLastErrMessage()” method.

AUTOCONNECT METHOD

Returns an integer value.

Syntax
int AutoConnect()

Remarks
The Java Applet uses the default setting and tries to connect to the available ports in the system
until it finds the first MagTek Bluetooth MSR reader that it can communicate with. AutoConnect
returns a zero (0) if the connection is established, otherwise a non-zero for an unsuccessful auto-
connection. Moreover, it is recommended that one should use function named
SetReaderType(readerType) prior to AutoConnect () call, where readerType of 1 is MagTek
Bluetooth card reader, and readerType of 0 is for a standard RS232 reader type.

Default Serial Port Parameters
Baud Rate: 9600
Parity: N
Data Bits: 8
Stop Bits: 1

Example
int SetReaderType(1);

// 1: Bluetooth; 0: standard RS232 card reader.

int AutoConnect();

The AutoConnect returns zero (0) if the connection is established with a MagTek Bluetooth card
reader.

CARDDATA METHOD

Returns a string value indicating the whole card-data-swiped.

Syntax
String CardData()

Advertising