background image

Appendix C -  Sample Code 

 

Dynamag, DynaMAX, and eDynamo| Secure Card Reader Authenticator | Programmer’s Reference (WCF) 

 
Page 29 

Appendix C

 

Sample Code 

C.1

 

Query devices, openDevice and closeDevice. 

This example shows how to use the getDeviceList function to get devices and open the first device 
connected to the host. 
 

            MTSCRAWCF.MTSCRAWCF wcf = new MTSCRAWCF.MTSCRAWCF(); 
 
            var devList = wcf.getDeviceList(); 
 
            Console.WriteLine(devList); 
 
            var devs = devList.Split(','); 
 
            foreach (var dev in devs) 
                Console.WriteLine(dev); 
 
            var open = wcf.openDevice(devs[0]); 
 
            Console.WriteLine("open " +  devs[0] + " -> " + open); 
 
            if (open == 0) 
                wcf.closeDevice(); 
 
/* 
  Output in Console : 
USB://MagTek SCRA 1,BLEEMV://eDynamo-B306F96 
USB://MagTek SCRA 1 
BLEEMV://eDynamo-B306F96 
open USB://MagTek SCRA 1 -> 1 
 */ 

C.2

 

SendCommand to device and get response. 

This example shows how to use the SendCommand function to send command to device and get device 
response. 
 

            var response = wcf.sendCommand("0001"); 
            Console.WriteLine(response); 
 
 
/* 
  Output in Console : 
*/ 

Содержание DYNAMAG

Страница 1: ...A 90740 I Phone 562 546 6400 I Technical Support 888 624 8350 www magtek com Dynamag DynaMAX and eDynamo Secure Card Reader Authenticator Programmer s Reference WCF November 2015 Manual Part Number D9...

Страница 2: ...e updated in the next publication release No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical for any purpose without the express written per...

Страница 3: ...reement are automatically terminated COPYRIGHT The Software is copyrighted Licensee may not copy the Software except for archival purposes or to load for execution purposes All other copies of the Sof...

Страница 4: ...all inure to the benefit of MagTek Incorporated its successors or assigns ACKNOWLEDGMENT LICENSEE ACKNOWLEDGES THAT HE HAS READ THIS AGREEMENT UNDERSTANDS ALL OF ITS TERMS CONDITIONS AND RESTRICTIONS...

Страница 5: ...Demo 9 2 2 1 Connect web service in C Project 9 2 2 2 Connect ajax service in web page javascript 11 2 3 How to Connect DynaMAX or eDynamo to a Windows Host via BLE 11 3 MTSCRA Library Functions 16 3...

Страница 6: ...4 4 5 User Selection Request 24 4 6 ARQC 25 4 7 Transaction Result 25 Appendix A TLV Data Format 27 A 1 ARQC Message Format 27 A 2 ARQC Response from online processing 27 A 3 Transaction Result Messag...

Страница 7: ...l terms device and host are used in different often incompatible ways in a multitude of specifications and contexts For example host may have different meanings in the context of USB communication tha...

Страница 8: ...ework 4 5 installed Tested development environments Windows 8 1 with Microsoft Visual Studio 2013 1 5 Interfaces for Operating Systems The following table matches the device interface to operating sys...

Страница 9: ...bit machine launch Visual Studio 2013 and open C Program Files x86 MagTek SCRA Windows SDK Sample Code CPP Source VCDemo vcxproj 2 For 32 bit machine launch Visual Studio 2013 and open C Program File...

Страница 10: ...ow to Set Up the MagTek SCRA Libraries Dynamag DynaMAX and eDynamo Secure Card Reader Authenticator Programmer s Reference WCF Page 10 3 Input the base address to reference the WCF service then click...

Страница 11: ...sert ScriptManager object asp ScriptManager ID ScriptManager1 runat server asp ScriptManager This step will enable the microsoftajax js module 4 Insert javascript referent to WCF script src http local...

Страница 12: ...ynaMAX s batteries are installed and have adequate charge If using eDynamo make sure the device has an adequate charge 4 Test the batteries by powering on the DynaMAX or eDynamo device Provided the de...

Страница 13: ...ttom of the device Note the final four digits 10 Read through the list of pairable devices and locate the device called DynaMAX nnnn or eDynamo nnnn where nnnn is the last four digits of the device s...

Страница 14: ...asscode 000000 or the device s actual password if it has been configured differently then press the Next button Windows will return you to the Manage Bluetooth devices page After a short period of tim...

Страница 15: ...ext editor 14 The device consumes very little power when not transmitting card data so it is not necessary to power off the device to conserve power If the device appears as Not connected in the Windo...

Страница 16: ...elimited by If input is empty string or null means search all types Return Value A string with Devices URIs delimited by 3 2 getSDKVersion Retrieves SDK version string getSDKVersion Return Value The v...

Страница 17: ...mmand to device and returns the raw response from device string sendCommand string Command Parameter Description Command Hex string for command It does not include the length of command data Reference...

Страница 18: ...ard choose a language choose an application and online processing If this time is exceeded the transaction will be aborted and an appropriate Transaction Status will be available Value 0 is not allowe...

Страница 19: ...ro mode This single byte field indicates the level of Transaction Status notifications the host desires to receive during the course of this transaction 0x00 Termination Status only normal termination...

Страница 20: ...lection 0x00 User Selection Request completed see Selection Result 0x01 User Selection Request aborted cancelled by user 0x02 User Selection Request aborted timeout selection Indicates the menu item s...

Страница 21: ...onse data First two bytes indicate message length following TLV response message Reference to A 2 ARQC Response Return Value This function will always returns null To get the result code of this comma...

Страница 22: ...1d8 33e10070ba62f8d274fe55abee8855971364f716f4fa7d6fae47d078c7c98e7a220b84 4b127cc769344dc76bc14e3cf1638da8c4428daff38163b429037e8f80bc099e123f42 8fc06fb47743f8eeb633ba523a07 B9812000080006827 LAST FI...

Страница 23: ...t complete within this time it will be aborted 2 Current Transaction Progress Indicator This one byte field indicates the current processing stage for the transaction 0x00 No transaction in progress 0...

Страница 24: ...selection request this is 0x00 Application Selection 0x01 Language Selection Others TBD 1 Timeout Specifies the maximum time in seconds allowed to complete the selection process If this time is exceed...

Страница 25: ...5720000B001950542200080009B02E8009F1E0842333036463936209F1A 0208405F2A0208409F01060000000000019F2103183917DFDF4D263B35343133303030 3034303030313531333D303131343030303030303030303030303030303FDFDF52010...

Страница 26: ...700498009F2608C4751D62AEA184A59F270140 9F360200C59C01009F33032028C89F34035E03009F37049FA41BDA9F3901059F400572 0000B001950542200080009B02E8009F1E0842333036463936209F1A0208405F2A0208 409F010600000000000...

Страница 27: ...d Tag 9F1F TLV T1 DD len val DF36 Encrypted Tag 9F20 TLV T2 DD len val DF37 Encrypted Tag 9F61 TLV T2 CVC3 len val DF38 Encrypted Tag 9F62 TLV T1 PCVC3 len val DF39 Encrypted Tag DF812A TLV T1 DD len...

Страница 28: ...chant Data tags F8 len container tag for encrypted data DFDF56 Encrypted Transaction Data KSN len val DFDF57 Encrypted Transaction Data Encryption Type val FA len container for generic data DF30 Encry...

Страница 29: ...List wcf getDeviceList Console WriteLine devList var devs devList Split foreach var dev in devs Console WriteLine dev var open wcf openDevice devs 0 Console WriteLine open devs 0 open if open 0 wcf cl...

Отзывы: