Esempio n. 1
0
        private void SendInhibit(byte cmd)
        {
            try
            {
                mut.WaitOne();
                ComDll.SetInhibit(buffer, cmd);
                length = (int)buffer[1];
                Port.Write(buffer, 0, length);
                System.Threading.Thread.Sleep(100);

                ServiceStatus.IsDone = true;//Wait for 100ms.
                mut.ReleaseMutex();
            }
            catch (Exception e)
            {
                ServiceStatus.IsDone         = false;
                ServiceStatus.error.HasError = true;
                ServiceStatus.error.Message  = e.Message;
            }
        }
Esempio n. 2
0
        public static void init(byte[] buffer, int length, ID003CommandCreater ComDll, SerialPort Port)
        {
            //This method does the BV setup in order to accept bills
            byte enable1 = 0;
            byte enable2 = 0;



            //Sending the reset command
            ComDll.Reset(buffer);
            length = (int)buffer[1];
            Port.Write(buffer, 0, length);
            System.Threading.Thread.Sleep(100); //wait for 100ms (poll rate should be between 100ms and 200ms)

            //Enabling denominations ($1, $5, $10, $20, $50, $100)
            ComDll.SetEnableDeno(buffer, enable1, enable2);
            length = (int)buffer[1];
            Port.Write(buffer, 0, length);
            System.Threading.Thread.Sleep(100);

            //Setting standard security enable1= 0x00, enable2= 0x00
            ComDll.SetSecurity(buffer, enable1, enable2);
            length    = (int)buffer[1];
            buffer[5] = 0x01;
            System.Threading.Thread.Sleep(10);
            Port.Write(buffer, 0, length);
            System.Threading.Thread.Sleep(100);


            //No optional functions enable1= 0x00, enable2= 0x00
            ComDll.SetOpFunction(buffer, enable1, enable2);
            length = (int)buffer[1];
            Port.Write(buffer, 0, length);
            System.Threading.Thread.Sleep(100);

            //Enabling bill acceptor enable=0x00 (0x01 to disable)
            ComDll.SetInhibit(buffer, enable1);
            length = (int)buffer[1];
            Port.Write(buffer, 0, length);
            System.Threading.Thread.Sleep(100);
        }