Ejemplo n.º 1
0
        internal static Events GetEvents(SlaveMessage message)
        {
            message &= eventMask;
            Events result = Events.None;

            if ((message & SlaveMessage.Stacked) == SlaveMessage.Stacked)
            {
                result |= Events.Stacked;
            }
            if ((message & SlaveMessage.Returned) == SlaveMessage.Returned)
            {
                result |= Events.Returned;
            }
            if ((message & SlaveMessage.Cheated) == SlaveMessage.Cheated)
            {
                result |= Events.Cheated;
            }
            if ((message & SlaveMessage.BillRejected) == SlaveMessage.BillRejected)
            {
                result |= Events.BillRejected;
            }
            if ((message & SlaveMessage.PowerUp) == SlaveMessage.PowerUp)
            {
                result |= Events.PowerUp;
            }
            if ((message & SlaveMessage.InvalidCommand) == SlaveMessage.InvalidCommand)
            {
                result |= Events.InvalidCommand;
            }

            return(result);
        }
Ejemplo n.º 2
0
        internal static States GetState(SlaveMessage message)
        {
            // Clear non-state bits
            message &= StateMask;

            if ((message & SlaveMessage.Failure) == SlaveMessage.Failure)
            {
                return(States.AcceptorFailure);
            }

            if ((message & SlaveMessage.StackerFull) == SlaveMessage.StackerFull)
            {
                return(States.StackerFull);
            }

            if ((message & SlaveMessage.BillJammed) == SlaveMessage.BillJammed)
            {
                return(States.BillJammed);
            }

            if ((message & SlaveMessage.Returning) == SlaveMessage.Returning)
            {
                return(States.Returning);
            }

            if ((message & SlaveMessage.Stacking) == SlaveMessage.Stacking)
            {
                return(States.Stacking);
            }

            if ((message & SlaveMessage.Escrowed) == SlaveMessage.Escrowed)
            {
                return(States.Escrowed);
            }

            if ((message & SlaveMessage.Accepting) == SlaveMessage.Accepting)
            {
                return(States.Accepting);
            }

            if ((message & SlaveMessage.Idling) == SlaveMessage.Idling)
            {
                return(States.Idling);
            }

            return(States.Offline);
        }
Ejemplo n.º 3
0
        internal static Events GetEvents(SlaveMessage message)
        {
            message &= eventMask;
            Events result = Events.None;

            if ((message & SlaveMessage.Stacked) == SlaveMessage.Stacked)
                result |= Events.Stacked;
            if ((message & SlaveMessage.Returned) == SlaveMessage.Returned)
                result |= Events.Returned;
            if ((message & SlaveMessage.Cheated) == SlaveMessage.Cheated)
                result |= Events.Cheated;
            if ((message & SlaveMessage.BillRejected) == SlaveMessage.BillRejected)
                result |= Events.BillRejected;
            if ((message & SlaveMessage.PowerUp) == SlaveMessage.PowerUp)
                result |= Events.PowerUp;
            if ((message & SlaveMessage.InvalidCommand) == SlaveMessage.InvalidCommand)
                result |= Events.InvalidCommand;

            return result;
        }
Ejemplo n.º 4
0
        internal static int GetCredit(SlaveMessage message)
        {
            message &= creditMask;

            return (int)message >> 19;
        }
Ejemplo n.º 5
0
        internal static bool IsCashboxPresent(SlaveMessage message)
        {
            message &= cbOkayMask;

            return (message & SlaveMessage.StackerPresent) == SlaveMessage.StackerPresent;
        }
Ejemplo n.º 6
0
        internal static States GetState(SlaveMessage message)
        {
            // Clear non-state bits
            message &= stateMask;

            if ((message & SlaveMessage.Failure) == SlaveMessage.Failure)
                return States.AcceptorFailure;
            if ((message & SlaveMessage.StackerFull) == SlaveMessage.StackerFull)
                return States.StackerFull;
            if ((message & SlaveMessage.BillJammed) == SlaveMessage.BillJammed)
                return States.BillJammed;
            if ((message & SlaveMessage.Returning) == SlaveMessage.Returning)
                return States.Returning;
            if ((message & SlaveMessage.Stacking) == SlaveMessage.Stacking)
                return States.Stacking;
            if ((message & SlaveMessage.Escrowed) == SlaveMessage.Escrowed)
                return States.Escrowed;
            if ((message & SlaveMessage.Accepting) == SlaveMessage.Accepting)
                return States.Accepting;
            if ((message & SlaveMessage.Idling) == SlaveMessage.Idling)
                return States.Idling;

            return States.Offline;
        }
Ejemplo n.º 7
0
        internal static int GetCredit(SlaveMessage message)
        {
            message &= CreditMask;

            return((int)message >> 19);
        }
Ejemplo n.º 8
0
        internal static bool IsCashboxPresent(SlaveMessage message)
        {
            message &= CbOkayMask;

            return((message & SlaveMessage.StackerPresent) == SlaveMessage.StackerPresent);
        }