예제 #1
0
        public void Dispense(int amount, bool present = false, string currency = "CNY")
        {
            WFSCDMDENOMINATION denomination = new WFSCDMDENOMINATION();

            denomination.cCurrencyID = currency.ToArray();
            denomination.lpulValues  = IntPtr.Zero;
            denomination.ulAmount    = amount;
            denomination.usCount     = 0;
            WFSCDMDISPENSE dispense = new WFSCDMDISPENSE();

            dispense.bPresent       = present;
            dispense.fwPosition     = OutputPosition.WFS_CDM_POSNULL;
            dispense.usMixNumber    = 1;
            dispense.lpDenomination = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WFSCDMDENOMINATION)));
            Marshal.StructureToPtr(denomination, dispense.lpDenomination, false);
            IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WFSCDMDISPENSE)));

            Marshal.StructureToPtr(dispense, ptr, false);
            int hResult = XfsApi.WFSAsyncExecute(hService, CDMDefinition.WFS_CMD_CDM_DISPENSE, ptr, 0, Handle, ref requestID);

            Marshal.FreeHGlobal(dispense.lpDenomination);
            Marshal.FreeHGlobal(ptr);
            if (hResult != XFSDefinition.WFS_SUCCESS)
            {
                OnDispenseError(hResult);
            }
        }
예제 #2
0
파일: PTR.cs 프로젝트: tsengee/XFS4NET
        public void RejectAndCut()
        {
            try
            {
                L4Logger.Info(MethodBase.GetCurrentMethod().Name + "  Start");
                this.Invoke(new Action(() =>
                {
                    //L4Logger.Info("PTR Execute => WFS_CMD_PTR_CONTROL_MEDIA");
                    WFSPTRCONTROLMEDIA ptrmedia = new WFSPTRCONTROLMEDIA();
                    ptrmedia.dwMediaControl     = (int)PTRCapsFwControl.WFS_PTR_CTRLEJECT | (int)PTRCapsFwControl.WFS_PTR_CTRLCUT;

                    IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WFSPTRCONTROLMEDIA)));
                    Marshal.StructureToPtr(ptrmedia, ptr, false);

                    int hResult = XfsApi.WFSAsyncExecute(hService, PTRDefinition.WFS_CMD_PTR_CONTROL_MEDIA, ptr, 0, Handle, ref requestID);
                    //L4Logger.Info(string.Format("PTR RejectAndCut requestID {0}  Result = {1}", requestID, hResult));
                    if (hResult != XFSDefinition.WFS_SUCCESS)
                    {
                        OnPrintErrorError(hResult);
                    }
                    else
                    {
                        OnPrintCompleted();
                    }
                }));
            }
            catch (Exception ex)
            {
                L4Logger.Info(ex.ToString());
            }
        }
예제 #3
0
파일: IDC.cs 프로젝트: xxmedxx/XFS.Net
        public void EjectCard()
        {
            int hResult = XfsApi.WFSAsyncExecute(hService, IDCDefinition.WFS_CMD_IDC_EJECT_CARD, IntPtr.Zero, 0, Handle, ref requestID);

            if (hResult != XFSDefinition.WFS_SUCCESS)
            {
                OnEjectError(hResult);
            }
        }
예제 #4
0
        public void Present()
        {
            OutputPosition pos     = OutputPosition.WFS_CDM_POSNULL;
            int            hResult = XfsApi.WFSAsyncExecute(hService, CDMDefinition.WFS_CMD_CDM_PRESENT, new IntPtr(&pos), 0, Handle, ref requestID);

            if (hResult != XFSDefinition.WFS_SUCCESS)
            {
                OnPresetError(hResult);
            }
        }
예제 #5
0
파일: IDC.cs 프로젝트: xxmedxx/XFS.Net
        public void ReadRawData(IDCDataSource sources)
        {
            int hResult = XfsApi.WFSAsyncExecute(hService, IDCDefinition.WFS_CMD_IDC_READ_RAW_DATA, new IntPtr(&sources), 0,
                                                 Handle, ref requestID);

            if (hResult != XFSDefinition.WFS_SUCCESS)
            {
                OnReadRawDataError(hResult);
            }
        }
예제 #6
0
파일: SIU.cs 프로젝트: tsengee/XFS4NET
        public void SetGuidLight(int pos, LightControl con)
        {
            WFSSIUSETGUIDLIGHT guidLight = new WFSSIUSETGUIDLIGHT();

            guidLight.fwCommand  = con;
            guidLight.wGuidLight = (ushort)pos;
            IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WFSSIUSETGUIDLIGHT)));

            Marshal.StructureToPtr(guidLight, ptr, false);
            int hResult = XfsApi.WFSAsyncExecute(hService, SIUDefinition.WFS_CMD_SIU_SET_GUIDLIGHT, ptr, 0, Handle, ref requestID);
        }
예제 #7
0
        public void GetData(ushort maxLen, bool autoEnd, XFSPINKey activeKeys, XFSPINKey terminateKeys, XFSPINKey activeFDKs = XFSPINKey.WFS_PIN_FK_UNUSED,
                            XFSPINKey terminateFDKs = XFSPINKey.WFS_PIN_FK_UNUSED)
        {
            WFSPINGETDATA inputData = new WFSPINGETDATA();

            inputData.usMaxLen        = maxLen;
            inputData.bAutoEnd        = autoEnd;
            inputData.ulActiveFDKs    = activeFDKs;
            inputData.ulActiveKeys    = activeKeys;
            inputData.ulTerminateFDKs = terminateFDKs;
            inputData.ulTerminateKeys = terminateKeys;
            int    len = Marshal.SizeOf(typeof(WFSPINGETDATA));
            IntPtr ptr = Marshal.AllocHGlobal(len);

            Marshal.StructureToPtr(inputData, ptr, false);
            int hResult = XfsApi.WFSAsyncExecute(hService, PINDefinition.WFS_CMD_PIN_GET_DATA, ptr, 0, Handle, ref requestID);

            Marshal.FreeHGlobal(ptr);
            if (hResult != XFSDefinition.WFS_SUCCESS)
            {
                OnGetDataError(hResult);
            }
        }