Handling Events - Magtek Universal SDK Programmer's Manual

Table of Contents

Advertisement

Appendix B - API Walk Through
B.6.1 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
// A class to handle configuration callback events.
public class ConfigCallbacks : MTUSDK.IConfigurationCallback
{
public void OnProgress(int progress)
{
/* Handle progress.
Progress is complete when progress = 100 */
}
public void OnResult(StatusCode status, byte[] data)
{
/* Handle result.
A configuration process is complete when
status = StatusCode.Success */
}
public IResult OnCalculateMAC(byte macType, byte[] data)
{
IResult result;
byte[] macBytes = null;
DeviceType deviceType =
device.getConnectionInfo().getDeviceType();
switch (deviceType)
{
case DeviceType.MMS:
macBytes = getDynaFlexMAC(macType, data);
break;
}
if (macBytes != null)
{
result = new Result(StatusCode.SUCCESS, new BaseData(macBytes));
}
return result;
}
}
MagTek Universal SDK| For MMS Devices | Programmer's Manual ( Java )
Page 54

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Universal SDK and is the answer not in the manual?

Questions and answers

Related Products for Magtek Universal SDK

Table of Contents