# MTSCRA Class Methods - 1 - 10

After creating an instance of the MTSCRA class in your custom software project, use the methods described in this section to communicate with SCRA device.

#### setConnectionType <a href="#id-3.1_setconnectiontype" id="id-3.1_setconnectiontype"></a>

This method sets the connection type of the device.

```
public void setConnectionType(MTConnectionType connectionType)
```

Parameters:

<table data-header-hidden><thead><tr><th width="166.727294921875" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>connectionType</p></td><td valign="top">MTConnectionType value: MTConnectionType.Unknown, MTConnectionType.Audio, MTConnectionType.BLE, MTConnectionType.BLEEMV, MTConnectionType.Bluetooth, MTConnectionType.USB, MTConnectionType.Serial, MTConnectionType.Net, MTConnectionType.Net_TLS12, MTConnectionType.Net_TLS12_Trust_All, MTConnectionType.BLEEMVT, MTConnectionType.AIDL</td></tr></tbody></table>

The following table shows the connection types supported by the various SCRA devices:

<table data-header-hidden><thead><tr><th width="187.18182373046875" valign="top"></th><th width="212.72735595703125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Connection Type</td><td valign="top">SCRA Device</td><td valign="top">Note</td></tr><tr><td valign="top">Audio</td><td valign="top">aDynamo uDynamo</td><td valign="top"> </td></tr><tr><td valign="top">Bluetooth LE</td><td valign="top">DynaMAX</td><td valign="top">Android 4.4.2 and above</td></tr><tr><td valign="top">Bluetooth LE EMV</td><td valign="top">eDynamo</td><td valign="top">Android 4.4.2 and above</td></tr><tr><td valign="top">Bluetooth LE EMVT</td><td valign="top">tDynamo</td><td valign="top">Android 4.4.2 and above</td></tr><tr><td valign="top">Bluetooth</td><td valign="top">BulleT</td><td valign="top">Card swipe only</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p>USB</p></td><td valign="top"><p>BulletT DynaMag DynaMAX eDynamo tDynamo DynaWave iDynamo 6</p><p>iDynamo 5 (Gen III)</p></td><td valign="top"><p> </p><p> </p><p> </p><p>Host must support USB On- The-Go.</p></td></tr><tr><td valign="top">Serial</td><td valign="top">DynaGlass</td><td valign="top">Android 7.1.2</td></tr><tr><td valign="top">Serial</td><td valign="top">DynaWave</td><td valign="top">Android 4.4.2 and above</td></tr><tr><td valign="top">AIDL</td><td valign="top">DynaGlass</td><td valign="top">Android 7.1.2</td></tr></tbody></table>

Return Value: None

#### setConnectionRetry <a href="#id-3.2_setconnectionretry" id="id-3.2_setconnectionretry"></a>

This function when set to True instructs the SDK to automatically retry to connect to the Bluetooth LE reader upon pairing. If set to False, the Bluetooth LE reader will be disconnected after pairing. This function is set to False by default in the SDK, but MagTek highly recommends to set this flag to True in your application in order to make sure that you'll have a successful secure connection between Android OS and Bluetooth LE reader after the paring.

```
public void setConnectionRetry(boolean connectionRetry)
```

Parameters:

<table data-header-hidden><thead><tr><th width="189.45458984375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top"><p> </p><p>connectionRetry</p></td><td valign="top"><p>Connection retry value:</p><p>True = SDK will retry the conection after pairing.</p><p>False = SDK will not retry the connection after pairing.</p></td></tr></tbody></table>

Return Value: None

#### setAddress <a href="#id-3.3_setaddress" id="id-3.3_setaddress"></a>

This method sets the address of the device.

```
public void setAddress(String deviceAddress)
```

Parameters:

<table data-header-hidden><thead><tr><th width="184.90911865234375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">deviceAddress</td><td valign="top">String value of the address.</td></tr></tbody></table>

Return Value: None

#### setDeviceConfiguration <a href="#id-3.4_setdeviceconfiguration" id="id-3.4_setdeviceconfiguration"></a>

This method sets the configuration parameters for the device.

```
public void setDeviceConfiguration(String configuration)
```

Parameters:

<table data-header-hidden><thead><tr><th width="149.45458984375" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">configuration</td><td valign="top">String value of the configuration parameters to be used for the device.</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="364.45452880859375" valign="top"></th><th></th><th></th></tr></thead><tbody><tr><td valign="top">Audio Reader Device Configuration</td><td></td><td></td></tr><tr><td valign="top">Parameter</td><td>Default Value</td><td>Configurable Values</td></tr><tr><td valign="top">PAN_MOD10_CHECKDIGIT</td><td>TRUE</td><td>FALSE, TRUE</td></tr><tr><td valign="top">INPUT_AUDIO_SOURE</td><td>VRECOG</td><td>MIC, VRECOG</td></tr><tr><td valign="top">INPUT_SAMPLE_RATE_IN_HZ</td><td>44100</td><td>32000, 44100, 48000</td></tr></tbody></table>

Return Value: None

#### openDevice <a href="#id-3.5_opendevice" id="id-3.5_opendevice"></a>

This method opens connection to the device.

```
public void openDevice()
```

Parameters: None&#x20;

Return Value: None

#### closeDevice <a href="#id-3.6_closedevice" id="id-3.6_closedevice"></a>

This method closes the connection to the device.

```
public void closeDevice()
```

Parameters: None&#x20;

Return Value: None

#### isDeviceConnected <a href="#id-3.7_isdeviceconnected" id="id-3.7_isdeviceconnected"></a>

This method returns whether the device is connected or not.

```
public boolean isDeviceConnected()
```

Parameters: None&#x20;

Return Value:

Return true if the device is connected. Otherwise, return false.

#### isDeviceEMV <a href="#id-3.8_isdeviceemv" id="id-3.8_isdeviceemv"></a>

This method returns whether the device supports EMV or not.

```
public boolean isDeviceEMV()
```

Parameters: None&#x20;

Return Value:

Return true if EMV is supported by the device. Otherwise, return false.

#### getMaskedTracks <a href="#id-3.9_getmaskedtracks" id="id-3.9_getmaskedtracks"></a>

Get stored masked tracks data. If decodable track data exists for a given track, it is located in the Masked Track Data field that corresponds to the track number. The length of each Masked Track Data field is fixed at 112 bytes, but the length of valid data in each field is determined by the Masked Track Data

Length field that corresponds to the track number. Masked Track Data located in positions greater than indicated in the Masked Track Data Length field are undefined and should be ignored.

The Masked Track Data is decoded and converted to ASCII and then it is masked. The Masked Track Data includes all data starting with the start sentinel and ending with the end sentinel. Much of the data is masked; a specified mask character is sent instead of the actual character read from the track. Which characters are masked depends on the format of the card. Only ISO/ABA (Financial Cards with Format Code B) and AAMVA cards are selectively masked; all other card types are either entirely masked or sent totally in the clear. There is a separate masking property for ISO/ABA cards and AAMVA cards. See *D99875475* for the ISO Track Masking property and the AAMVA Track Masking property for more information. See *D99875475* for a description on how ISO/ABA and AAMVA cards are identified.

Each of these properties allows the application to specify masking details for the Primary Account Number and Driver’s License / ID Number (DL/ID#), the masking character to be used, and whether a correction should be applied to make the Mod 10 9 (Luhn algorithm) digit at the end of the number be correct.

```
public String getMaskedTracks()
```

Parameters: None&#x20;

Return Value:

Return stored masked tracks data string.

#### getTrack1 <a href="#id-3.10_gettrack1" id="id-3.10_gettrack1"></a>

Get stored track1 data. This field contains the encrypted track data for track 1.

public String getTrack1()

Parameters: None&#x20;

Return Value:

Return stored track1 data string.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.magtek.com/hardware/card-readers/magnetic-stripe-readers/idynamo-5-gen-iii/documentation/developers-manuals/programmers-manual-android/mtscra-class-methods/mtscra-class-methods-1-10.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
