![Magtek Universal SDK Скачать руководство пользователя страница 53](http://html1.mh-extra.com/html/magtek/universal-sdk/universal-sdk_programmers-manual_3704653053.webp)
Appendix B - API Walk Through
MagTek Universal SDK| For MMS Devices | Programmer’s Manual ( Java )
Page 53
B.6
IDeviceConfiguration Walk Through
The following walks through how to make use of
IDevice
getDeviceConfiguration().
IDeviceConfiguration
updateFirmware().
IDeviceConfiguration
getConfiguration().
IDeviceConfiguration
setConfiguration().
IDeviceConfiguration
other functions.
Example
// Establish a device from CoreAPI.
List<IDevice> deviceList = CoreAPI.getDeviceList();
IDevice device = deviceList.get(0);
IDeviceConfiguration devConfig = device.getDeviceConfiguration();
IDeviceControl devControl = device.getDeviceControl();
devControl.open();
/* To handle events from some other class.
ConfigCallBacks configCallBacks = new ConfigCallBacks();
*/
// Update firmware.
byte[] data = File.ReadAllBytes(“filepath”);
int return = devConfig.updateFirmware(0x01, data, this);
/* Get configuration.
Device-Driven Fallback OID = 1.2.1.1.1.1
contructed OID = E2 08 E1 06 E1 04 E1 02 C1 00
Note: first digit of OID is ommited in the custruction and instead
is passed as the configType.
*/
data = new byte[] {0xE2,0x08,0xE1,0x06,0xE1,0x04,0xE1,0x02,0xC1,0x00
};
byte[] response = devConfig.getConfigInfo(0x01, data);
/* Set configuation.
Device-Driven Fallback OID is 1.2.1.1.1.1
Disabled contructed OID = E2 09 E1 07 E1 05 E1 03 C1 01 00
Enabled contructed OID = E2 09 E1 07 E1 05 E1 03 C1 01 01
Note: first digit of OID is ommited in the custruction and instead
is passed as the configType.
*/
data = new byte[]
{0xE2,0x09,0xE1,0x07,0xE1,0x05,0xE1,0x03,0xC1,0x01,0x00 };
result = devConfig.getConfigInfo(0x01, data);