예제 #1
0
 public void openfunction()
 {
     ListEvent("Bill Acceptor Open.");
     try
     {
         billacceptor.Open(comportname, pupmode);
     }
     catch (Exception err)
     {
         ListEvent("Unable to open the bill acceptor on com port <" + comportname + "> " + err.Message);
     }
 }
예제 #2
0
        static void utilizandoPayout()
        {
            Console.WriteLine("     ");
            Console.WriteLine("Comenzando conexion con bill acceptor");
            bool seguir = true;

            billAccept = new MPOST.Acceptor();
            try
            {
                billAccept.OnPowerUp         += new PowerUpEventHandler(handlePowerUp);
                billAccept.OnConnected       += new ConnectedEventHandler(handleConnected);
                billAccept.OnStacked         += new StackedEventHandler(handleStack);
                billAccept.OnPowerUpComplete += new PowerUpCompleteEventHandler(handlePowerUpCompleted);
                billAccept.OnEscrow          += new EscrowEventHandler(handleEscrow);

                billAccept.Open("COM6", MPOST.PowerUp.A);

                while (seguir)
                {
                    if (billAccept.DeviceState == State.Disconnected)
                    {
                        //habilitar();
                        //Console.WriteLine("Estado : {0}", billAccept.DeviceState);
                    }

                    if (billAccept.DeviceState == State.Escrow)
                    {
                        //Thread.Sleep(5000);
                        //billAccept.EscrowReturn();
                    }
                }

                //billAccept.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: {0}", e.Message);
            }


            //scr.DeviceStateChanged += new DeviceStateEventHandler(obtenerStatusEvento);
            //scr.DocumentStatusReported += new DocumentStatusEventHandler(obtenerStatusDocumento);
            //scr.EscrowSessionSummaryReported += new EscrowSessionSummaryEventHandler(obtenerEstatus);
            //scr.EnableAcceptance();
        }