> 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/universal-sdk-documentation/linux/coreapi.md).

# CoreAPI

Use the CoreAPI to create an IDevice. IDevice is the bases for the MagTek Universal SDK.

## getDevice <a href="#id-3.1_getdevice" id="id-3.1_getdevice"></a>

This function returns an instance of a device.

{% code overflow="wrap" %}

```
IDevice* getDevice( 
    MTU_DEVICE_TYPE DeviceType,
    MTU_DEVICE_CONNECTION_TYPE ConnectionType, 
    string DeviceAddress);
```

{% endcode %}

{% code overflow="wrap" %}

```
IDevice* getDevice( 
    MTU_DEVICE_TYPE DeviceType,
    MTU_DEVICE_CONNECTION_TYPE ConnectionType, 
    string DeviceAddress,
    CertificateInfo cert);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="180.8182373046875" 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">Enumerated device type.</td></tr><tr><td valign="top">ConnectionType</td><td valign="top">Enumerated connection type.</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="162.6363525390625" 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> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>DeviceAddress</p></td><td valign="top"><p>Address for the device.</p><p> </p><p>For USB devices, address may be an empty string when only one device is attached. Otherwise address should be in the form:</p><p>USB://DEVICESERIALNUMBER</p><p>for example, USB://99261829170E0810</p><p> </p><p>For Ethernet devices, address should be in the form:</p><p>IP://IP-Address:PORT</p><p>for example, IP://10.57.10.180:26</p><p> </p><p>For Wireless DynaPro Go devices, address should be in the form: TLS12://TLSDEVICESERIALNUMBER TLS12TRUST://TLSDEVICESERIALNUMBER</p><p>for example, TLS12://TLS99261829170E0810 TLS12TRUST://TLS99261829170E0810</p><p> </p><p>For Bluetooth LE devices, address should be in the form:</p><p>BLEEMV://DEVICENAME</p><p>for example, BLEEMV://DynaPro Go-EB66</p><p>For WebSocket or Secure WebSocket devices, address should be in the form:</p><p>ws://IP-Address or DEVICEADDRESS wss://IP-Address or DEVICEADDRESS</p><p>for example, ws://10.57.10.1 or ws://b512345.magtek.com wss://192.168.1.150 or wss://b512345.magtek.com</p><p>For Serial devices, address should be in the form: PORT=[PORT],</p><p>BAUDRATE=[BAUDRATE], DATABITS=[DATABITS], PARITY=[PARITY], STOPBITS=[STOPBITS], HANDSHAKE=[HANDSHAKE], STARTINGBYTE=[STARTINGBYTE], ENDINGBYTE=[ENDINGBYTE], CRCMODE=[CRCMODE]</p></td></tr><tr><td valign="top"><p> </p><p>cert</p></td><td valign="top">Certificate information for TLS Trust and WebSocket WSS connection. Optional. See the following for details on installing a certificate chain: <mark style="color:red;"><strong>DYNAFLEX TLS CERTIFICATE INSTALLATION MANUAL</strong></mark></td></tr></tbody></table>

Return Value: IDevice\*.

### getDeviceList <a href="#id-3.2_getdevicelist" id="id-3.2_getdevicelist"></a>

This function retrieves a list of connected devices.

{% code overflow="wrap" %}

```
vector<IDevice*> CoreAPI::getDeviceList();

vector<IDevice*> CoreAPI::getDeviceList( 
    vector<MTU_DEVICE_TYPE> deviceTypes);

vector<IDevice*> CoreAPI::getDeviceList( 
    MTU_DEVICE_TYPE deviceType);
    
vector<IDevice*> CoreAPI::getDeviceList( 
    MTU_DEVICE_TYPE deviceType, 
    MTU_DEVICE_CONNECTION_TYPE connectionType);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="191.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">deviceType</td><td valign="top">Enumeration of MagTek readers device type.</td></tr><tr><td valign="top">deviceTypes</td><td valign="top">Enumeration of MagTek readers different device types.</td></tr><tr><td valign="top">connectionType</td><td valign="top">Enumerated connection type.</td></tr></tbody></table>

Return Value: vector\<IDevice\*>

## getConnectionTypes <a href="#id-3.3_getconnectiontypes" id="id-3.3_getconnectiontypes"></a>

This function returns a list of conection types supported from a device type.

{% code overflow="wrap" %}

```
vector<MTU_DEVICE_CONNECTION_TYPE> CoreAPI::getConnectionTypes( 
        MTU_DEVICE_TYPE deviceType);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="136.27276611328125" 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">Enumerated device type.</td></tr></tbody></table>

Return Value: vector\<MTU\_DEVICE\_CONNECTION\_TYPE>.

### getConnectionTypeString <a href="#id-3.4_getconnectiontypestring" id="id-3.4_getconnectiontypestring"></a>

This function returns a string for the connection type.

{% code overflow="wrap" %}

```
string CoreAPI::getConnectionTypeString( 
    MTU_DEVICE_CONNECTION_TYPE connectionType);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="196.27276611328125" 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">connectionType</td><td valign="top">Enumerated connection type.</td></tr></tbody></table>

Return Value: A string for the connection type.

### getConnectionTypeFromString <a href="#id-3.5_getconnectiontypefromstring" id="id-3.5_getconnectiontypefromstring"></a>

This function retrieves the connection type from a string.

{% code overflow="wrap" %}

```
MTU_DEVICE_CONNECTION_TYPE CoreAPI::getConnectionTypeFromString( 
    string connectionTypeString);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="237.18182373046875" 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">connectionTypeString</td><td valign="top">String value for a connection type.</td></tr></tbody></table>

Return Value: MTU\_DEVICE\_CONNECTION\_TYPE.

#### 1.6           getAPIVersion <a href="#id-3.6_getapiversion" id="id-3.6_getapiversion"></a>

This function returns the API version.

&#x20;

int CoreAPI::getAPIVersion();

&#x20;

Return Value: An integer representing the API version.

#### 1.7           isEnumerable <a href="#id-3.7_isenumerable" id="id-3.7_isenumerable"></a>

This function checks whether the device and connection type is enumerable.

{% code overflow="wrap" %}

```
bool CoreAPI::isEnumable( 
        MTU_DEVICE_TYPE deviceType,
        MTU_DEVICE_CONNECTION_TYPE connectionType);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="184.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">deviceType</td><td valign="top">Enumerated device type.</td></tr><tr><td valign="top">connectionType</td><td valign="top">Enumerated connection type.</td></tr></tbody></table>

Return Value: True if enumerable. Otherwise is false.

#### releaseDevice <a href="#id-3.8_releasedevice" id="id-3.8_releasedevice"></a>

This function releases a device.

{% code overflow="wrap" %}

```
void CoreAPI::releaseDevice(IDevice* Device);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="148.09100341796875" 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">Device</td><td valign="top">An IDevice.</td></tr></tbody></table>

Return Value: None

#### releaseDeviceList <a href="#id-3.9_releasedevicelist" id="id-3.9_releasedevicelist"></a>

This function releases a list of devices.

{% code overflow="wrap" %}

```
void CoreAPI::releaseDeviceList(vector<IDevice*>& devices);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="150.81817626953125" 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">devices</td><td valign="top">List of IDevice.</td></tr></tbody></table>

Return Value: None


---

# 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/universal-sdk-documentation/linux/coreapi.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.
