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

Appendix B - API Walk Through

CoreAPI Walk Trough

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

  • CoreAPI.createDevice à IDevice

  • CoreAPI.getDeviceList à List<IDevice>

  • CoreAPI.createPPSCRA à MTPPSCRA

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 of IDevice is established.

// Access MMS with Universal SDK using createDevice()

IDevice mtmms = CoreAPI.createDevice( 
    DeviceType.MMS, 
    ConnectionType.USB,
    "",
    "",
    "DynaFlex", "");
mtmms.requestSignature(0xff);

Here, a list of IDevice is established. The first device is accessed at index 0.

// Acess MMS with Universal SDK using getDeviceList()

List<IDevice> mtmms = CoreAPI.getDeviceList(DeviceType.MMS); 
mtmms[0].requestSignature(0xff); 

Here the CoreAPI creates an instance of MTPPSCRA. The MTPPSCRANET is referenced and its library file is included in the application development project.

IDevice Walk Through

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 Delegate, or events can be interfaced by a separate class. This example uses a separate class and 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.

  • IDevice --> ConnectionInfo.

  • ConnectionInfo --> getAddress()

  • ConnectionInfo --> getConnectionType()

  • ConnectionInfo --> getDeviceType() Example

IDeviceCapabilities Walk Through

The following walks through how to make use of IDeviceCapabilities.

· IDevice à IDeviceCapabilities.

· IDeviceCapabilities à BatteryBackedClock() to check if date/time should be set.

· IDeviceCapabilities à PaymentMethods() to check card types supported.

· IDeviceCapabilities à 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 or can be extended by a separate class. This example uses a separate class and demonstrates how to parse for the various events.

Example

Last updated