> 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/sdks-and-tools/sdks-and-software-libraries/magnesafe-v5-sdks/programmers-manual-ios/mtscra-delegate-methods/mtscra-delegate-methods-1-10.md).

# MTSCRA Delegate Methods 1-10

After issuing the methods in section 3 Important Information About Bluetooth LE, the MTSCRA SDK libraries will call these Delegate methods (callback functions) to provide the requested data and / or a detailed response. For details about data received by these functions, see the *Programmer's Manual (COMMANDS)* for the specific device with which you are communicating.

For details about registering Delegate methods, see the demo application included with the SDK.

#### trackDataReadyNotification <a href="#id-5.1_trackdatareadynotification" id="id-5.1_trackdatareadynotification"></a>

The SDK sends this notification when card data is available from the device.

#### &#x20;devConnectionNotification <a href="#id-5.2_devconnectionnotification" id="id-5.2_devconnectionnotification"></a>

The SDK sends this notification when the connection status of the device changes.

#### onDataReceived <a href="#id-5.3_ondatareceived" id="id-5.3_ondatareceived"></a>

Return a card object type with card swipe data.

<table data-header-hidden><thead><tr><th width="150.66668701171875" 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">cardDataObj</td><td valign="top">MTCardData object</td></tr><tr><td valign="top">instance</td><td valign="top">Instance ID</td></tr></tbody></table>

#### cardSwipeDidStart <a href="#id-5.4_cardswipedidstart" id="id-5.4_cardswipedidstart"></a>

Card swipe has started.

<table data-header-hidden><thead><tr><th width="154" 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">instance</td><td valign="top">Instance ID</td></tr></tbody></table>

#### cardSwipeDidGetTransError <a href="#id-5.5_cardswipedidgettranserror" id="id-5.5_cardswipedidgettranserror"></a>

Card swipe got an error during transmission.

#### onDeviceConnectionDidChange <a href="#id-5.6_ondeviceconnectiondidchange" id="id-5.6_ondeviceconnectiondidchange"></a>

Device connection changed whether from close to open or vice versa.

<table data-header-hidden><thead><tr><th width="159.3333740234375" 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">deviceType</td><td valign="top">MTSCRADeviceType object</td></tr><tr><td valign="top"><p> </p><p>connected</p></td><td valign="top"><p>Boolean for connection state. True = Connected</p><p>False = Not connected</p></td></tr><tr><td valign="top">instance</td><td valign="top">Instance ID</td></tr></tbody></table>

#### bleReaderConnected <a href="#id-5.7_blereaderconnected" id="id-5.7_blereaderconnected"></a>

Bluetooth LE Reader was connected.

<table data-header-hidden><thead><tr><th width="152" 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">peripheral</td><td valign="top">CBPeripheral object</td></tr></tbody></table>

#### bleReaderDidDisconnected <a href="#id-5.8_blereaderdiddisconnected" id="id-5.8_blereaderdiddisconnected"></a>

Bluetooth LE Reader was disconnected.

<table data-header-hidden><thead><tr><th width="160" 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">connectionInfo</td><td valign="top">MTConnectionInfo object</td></tr></tbody></table>

#### bleReaderDidDiscoverPeripheral <a href="#id-5.9_blereaderdiddiscoverperipheral" id="id-5.9_blereaderdiddiscoverperipheral"></a>

Bluetooth LE Reader was discovered.

#### bleReaderStateUpdated <a href="#id-5.10_blereaderstateupdated" id="id-5.10_blereaderstateupdated"></a>

Bluetooth LE state changed. Enumerated possible values that would arrive via this delegate are:

<table data-header-hidden><thead><tr><th width="147.33331298828125" 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">state</td><td valign="top">MTSCRABLEState</td></tr></tbody></table>


---

# 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/sdks-and-tools/sdks-and-software-libraries/magnesafe-v5-sdks/programmers-manual-ios/mtscra-delegate-methods/mtscra-delegate-methods-1-10.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.
