For the complete documentation index, see llms.txt. This page is also available as Markdown.

Appendix A - API Walk Through

CoreAPI Walk Through

The following walks through how to create instances of a device.

  • CoreAPI.createDevice() --> IDevice

  • CoreAPI.setDeviceType()

  • CoreAPI.startScanningForPeripherals --> onDeviceList()

These examples demonstrate methods for creating an IDevice to be used in the MagTek Universal SDK. This also shows how to establish a device specific API, which is not used with the MagTek Universal SDK.

Here, a single IDevice is established.

// Access MMS with Universal SDK using createDevice()

var mtmms: IDevice = CoreAPI.createDevice( 
        MTU_DeviceType_MMS,
        connection: MTU_ConnectionType_ WEBSOCKET, 
        address: "ws://b123456.magtek.com",
        model: "DynaFlex", 
        name: webSocketAddress, 
        serial: "B123456", 
        cert: Certificate)

BLE device

iAP2 Lightning device.

The following walks through how to make use of IDevice.

  • Implement device events within the class to receive events.

  • CoreAPI --> IDevice.

  • IDevice --> subscribeAll().

  • IDevice à other functions.

  • IDevice à startTransaction().

Example

Handling Events

Application Main window may extent the IEventSubscriber. This example demonstrates how to parse for the various event types.

Example

Various events are separately shown below.

IDeviceControl Walk Through

The following walks through how to make use of IDeviceControl.

  • IDevice --> IDeviceControl.

  • IDeviceControl --> open().

  • IDeviceControl --> other functions.

  • IDeviceControl --> close().

Example

ConnectionInfo Walk Through

The following walks through how to make use of ConnectionInfo.

  • ConnectionInfo --> getAddress()

  • ConnectionInfo --> getConnectionType()

  • ConnectionInfo --> getDeviceType() Example

IDeviceCapability Walk Through

The following walks through how to make use of IDeviceCapability.

  • IDeviceCapability à BatteryBackedClock() to check if date/time should be set.

  • IDeviceCapability à PaymentMethods() to check card types supported.

  • IDeviceCapability à other functions.

IDeviceConfiguration Walk Through

The following walks through how to make use of IDeviceConfiguration.

  • IDevice à getDeviceConfiguration().

  • IDeviceConfiguration à updateFirmware().

  • IDeviceConfiguration à getConfiguration().

  • IDeviceConfiguration à setConfiguration().

  • IDeviceConfiguration à other functions.

Example

Handling Events

Application Main window may extent the IConfigurationCallback Delegates. This example demonstrates how to parse for the various events.

Example

Last updated