> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/products/card-readers/magnetic-stripe-readers/idynamo-5-gen-iii/documentation/developers-manuals/programmers-manual-ios/mtscra-functions/mtscra-functions-11-20.md).

# MTSCRA Functions - 11 - 20

#### clearBuffers

This function clears the SDK library’s local cache of card swipe data.

> (void) clearBuffers

Parameters: None&#x20;

Return Value: None

#### listenForEvents <a href="#id-4.12_listenforevents" id="id-4.12_listenforevents"></a>

This function sets a callback function to notify when the device has card data to send to the host or when the device state changes. See example in Open Device code example.

```
(void) listenForEvents:(UInt32)event
```

Parameters: Event

<table data-header-hidden><thead><tr><th width="114.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"><p> </p><p> </p><p>event</p></td><td valign="top"><p>Event type.</p><ul><li>TRANS_EVENT_OK = Transaction succeeded.</li><li>TRANS_EVENT_START = Reader started sending data.</li><li>TRANS_EVENT_ERROR = Reader failed sending data.</li></ul></td></tr></tbody></table>

Return Value: None

#### getMaskedTracks \[iDynamo/uDynamo Only] <a href="#id-4.13_getmaskedtracks_-idynamo-udynamo_on" id="id-4.13_getmaskedtracks_-idynamo-udynamo_on"></a>

This function retrieves masked card track data after a cardholder swipes a card. Only available on iDynamo/uDynamo; other devices will return an empty string.

```
(NSString *) getMaskedTracks
```

Parameters: None&#x20;

Return Value:

Return stored masked track data string. Tracks are delimited with start and end sentinels.

#### getTrack1Masked <a href="#id-4.14_gettrack1masked" id="id-4.14_gettrack1masked"></a>

This function retrieves masked track 1 data after a cardholder swipes a card.

```
(NSString *) getTrack1Masked
```

Parameters: None

Return Value: Return stored masked track1 data string.

#### getTrack2Masked <a href="#id-4.15_gettrack2masked" id="id-4.15_gettrack2masked"></a>

This function retrieves masked track 2 data, if any, after a cardholder swipes a card.

```
(NSString *) getTrack2Masked
```

Parameters: None

Return Value: Return stored masked track2 data string.

#### getTrack3Masked <a href="#id-4.16_gettrack3masked" id="id-4.16_gettrack3masked"></a>

This function retrieves masked track 3 data, if any, after a cardholder swipes a card.

```
(NSString *) getTrack3Masked
```

Parameters: None

Return Value: Return stored masked track3 data string.

#### getCardPAN <a href="#id-4.17_getcardpan" id="id-4.17_getcardpan"></a>

This function retrieves masked PAN data, if any, after a cardholder swipes a card.

```
(NSString *) getCardPAN
```

Parameters: None

Return Value: Return stored masked PAN data string.

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

This function retrieves the card’s track 1 data in encrypted format after a cardholder swipes a card.

```
(NSString *) getTrack1
```

Parameters: None

Return Value: String containing encrypted track 1 data.

#### getTrack2 <a href="#id-4.19_gettrack2" id="id-4.19_gettrack2"></a>

This function retrieves the card’s track 2 data in encrypted format, if any, after a cardholder swipes a card.

```
(NSString *) getTrack2
```

Parameters: None

Return Value: String containing encrypted track 2 data.

#### getTrack3 <a href="#id-4.20_gettrack3" id="id-4.20_gettrack3"></a>

This function retrieves the card’s track 3 data in encrypted format, if any, after a cardholder swipes a card.

```
(NSString *) getTrack3
```

Parameters: None

Return Value: String containing encrypted track 3 data.q


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/products/card-readers/magnetic-stripe-readers/idynamo-5-gen-iii/documentation/developers-manuals/programmers-manual-ios/mtscra-functions/mtscra-functions-11-20.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
