Exemple #1
0
            public override SiDriverState Receive(SiMessageQueue queue, ICommWriter writer, SiHandler siHandler)
            {
                SiMessage message = PollAnswer(queue, SiMessage.GET_SYSTEM_VALUE);

                si6_192PunchesMode = (message.Sequence(6) & 0xFF) == 0xFF;
                GecoSiLogger.Info("SiCard6 192 Punches Mode " + (si6_192PunchesMode ? "Enabled" : "Disabled"));
                return(STARTUP_COMPLETE.Send(writer, siHandler));
            }
Exemple #2
0
        protected int ExtractNumberOfDataBlocks(SiMessage firstBlock, int nbPunchesIndex)
        {
            int nbPunches         = firstBlock.Sequence(nbPunchesIndex) & 0xFF;
            int nbPunchesPerBlock = 32;
            int nbPunchDataBlocks = (nbPunches / nbPunchesPerBlock) + Math.Min(1, nbPunches % nbPunchesPerBlock);

            GecoSiLogger.Info(String.Format("Nb punches/Data blocks: {0}/{1}", nbPunches, nbPunchDataBlocks));
            return(nbPunchDataBlocks + 1);
        }
Exemple #3
0
 public override SiDriverState Receive(SiMessageQueue queue, ICommWriter writer, SiHandler siHandler)
 {
     try
     {
         PollAnswer(queue, SiMessage.SI_CARD_REMOVED);
         return(DISPATCH_READY);
     }
     catch (TimeoutException e)
     {
         GecoSiLogger.Info("Timeout on SiCard removal");
         return(DISPATCH_READY);
     }
     catch (InvalidMessage e)
     {
         return(ErrorFallback(siHandler, "Invalid message: " + e.ReceivedMessage()));
     }
 }