コード例 #1
0
ファイル: ORCACard.cs プロジェクト: cyberkitsune/ZaibatsuPass
        public ORCACard(PhysicalCard.PhysicalCard card) : base(card)
        {
            // get serial no and friends.

            PhysicalCard.Desfire.DesfireCard c = card as PhysicalCard.Desfire.DesfireCard;
            serial  = (int)c.getApplication(AID_SPECIAL).getFile(0xF).Data.MakeLong(5, 3);
            balance = c.getApplication(AID_ORCA).getFile(0x04).Data.MakeUint16(41, false);
        }
コード例 #2
0
        public static TransitCard parseTransitCard(PhysicalCard.PhysicalCard card)
        {
            foreach (TransitCardFilter f in filters)
            {
                if (f.filterFunc(card))
                {
                    return((TransitCard)(Activator.CreateInstance(f.InstanciationType, card)));
                }
            }

            return(null);
        }
コード例 #3
0
        public ORCACard(PhysicalCard.PhysicalCard card) : base(card)
        {
            // get serial no and friends.

            PhysicalCard.Desfire.DesfireCard c = card as PhysicalCard.Desfire.DesfireCard;
            serial  = (int)c.getApplication(AID_SPECIAL).getFile(0xF).Data.MakeLong(5, 3);
            balance = c.getApplication(AID_ORCA).getFile(0x04).Data.MakeUint16(41, false);

            PhysicalCard.Desfire.File.RecordFile recFile = (PhysicalCard.Desfire.File.RecordFile)(c.getApplication(AID_ORCA).getFile(0x02));

            PhysicalCard.Desfire.File.Settings.RecordSettings recSettings = (PhysicalCard.Desfire.File.Settings.RecordSettings)recFile.Settings;

            ORCATransitEvent[] evs = new ORCATransitEvent[recSettings.CurRecords];

            for (int evIdx = 0; evIdx < recSettings.CurRecords; evIdx++)
            {
                evs[evIdx] = ORCATransitEvent.parseRecrd(recFile[evIdx]);
            }
            events = evs;
        }
コード例 #4
0
ファイル: MykiCard.cs プロジェクト: zaibatsutel/ZaibatsuPass
 public MykiCard(PhysicalCard.PhysicalCard c) : base(c)
 {
     if (c is PhysicalCard.Desfire.DesfireCard)
     {
         PhysicalCard.Desfire.DesfireCard dCard = (c as PhysicalCard.Desfire.DesfireCard);
         try
         {
             byte[] meta = dCard.getApplication(AID_MYKI_A).getFile(15).Data.CopyReverseFrom(0, 16);
             serialUpper = meta.getBitsFromBuffer(96, 32);
             serialLower = meta.getBitsFromBuffer(64, 32);
         }
         catch
         {
             throw new ArgumentException("Could not parse Myki data.");
         }
     }
     else
     {
         throw new ArgumentException("Not a Myki card");
     }
 }
コード例 #5
0
 /// <summary>
 /// This is to make sure that every TransitCard implementation has a constructor.
 /// What this gives is a member, mCard, which is available to children of the implementation so that they are not required to remember where they put it...
 /// </summary>
 /// <param name="c">a PhysicalCard snapshot.</param>
 protected TransitCard(PhysicalCard.PhysicalCard c)
 {
     mCard = c;
 }
コード例 #6
0
 /// <summary>
 /// This is to make sure that every TransitCard implementation has a constructor.
 /// What this gives is a member, mCard, which is available to children of the implementation so that they are not required to remember where they put it...
 /// </summary>
 /// <param name="c">a PhysicalCard snapshot.</param>
 protected TransitCard(PhysicalCard.PhysicalCard c)
 {
     mCard = c;
 }