Exemplo n.º 1
0
        public bool SendDESFireCmd(DESFireCmd cmd, byte[] abyData, byte[] abyResultBuf, ref int nNumBytes)
        {
            byte cCmd   = (byte)desFireCmd2bb(cmd);
            uint b_retv = m_clsRFReader.DESFire(cCmd, abyData, abyResultBuf);

            nNumBytes = abyResultBuf[0];
            if (b_retv.Equals(0))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
 Bluebird.RFID.DESFireCmd desFireCmd2bb(DESFireCmd cmd)
 {
     switch (cmd)
     {
         case DESFireCmd.cSAMOnOff: return Bluebird.RFID.DESFireCmd.cSAMOnOff;
         case DESFireCmd.cAuthenticate: return Bluebird.RFID.DESFireCmd.cAuthenticate;
         case DESFireCmd.cChangeKeySettings: return Bluebird.RFID.DESFireCmd.cChangeKeySettings;
         case DESFireCmd.cGetKeySettings: return Bluebird.RFID.DESFireCmd.cGetKeySettings;
         case DESFireCmd.cChangeKey: return Bluebird.RFID.DESFireCmd.cChangeKey;
         case DESFireCmd.cGetKeyVersion: return Bluebird.RFID.DESFireCmd.cGetKeyVersion;
         case DESFireCmd.cCreateApplication: return Bluebird.RFID.DESFireCmd.cCreateApplication;
         case DESFireCmd.cGetApplicationIDs: return Bluebird.RFID.DESFireCmd.cGetApplicationIDs;
         case DESFireCmd.cSelectApplication: return Bluebird.RFID.DESFireCmd.cSelectApplication;
         case DESFireCmd.cFormatPICC: return Bluebird.RFID.DESFireCmd.cFormatPICC;
         case DESFireCmd.cGetVersion: return Bluebird.RFID.DESFireCmd.cGetVersion;
         case DESFireCmd.cGetFileIDs: return Bluebird.RFID.DESFireCmd.cGetFileIDs;
         case DESFireCmd.cGetFileSettings: return Bluebird.RFID.DESFireCmd.cGetFileSettings;
         case DESFireCmd.cChangeFileSettings: return Bluebird.RFID.DESFireCmd.cChangeFileSettings;
         case DESFireCmd.cCreateStandardDataFile: return Bluebird.RFID.DESFireCmd.cCreateStandardDataFile;
         case DESFireCmd.cCreateBackupDataFile: return Bluebird.RFID.DESFireCmd.cCreateBackupDataFile;
         case DESFireCmd.cCreateValueFile: return Bluebird.RFID.DESFireCmd.cCreateValueFile;
         case DESFireCmd.cCreateLinearRecordFile: return Bluebird.RFID.DESFireCmd.cCreateLinearRecordFile;
         case DESFireCmd.cCreateCyclicRecordFile: return Bluebird.RFID.DESFireCmd.cCreateCyclicRecordFile;
         case DESFireCmd.cReadData: return Bluebird.RFID.DESFireCmd.cReadData;
         case DESFireCmd.cReadRecords: return Bluebird.RFID.DESFireCmd.cReadRecords;
         case DESFireCmd.cWriteData: return Bluebird.RFID.DESFireCmd.cWriteData;
         case DESFireCmd.cWriteRecords: return Bluebird.RFID.DESFireCmd.cWriteRecords;
         case DESFireCmd.cGetValue: return Bluebird.RFID.DESFireCmd.cGetValue;
         case DESFireCmd.cCredit: return Bluebird.RFID.DESFireCmd.cCredit;
         case DESFireCmd.cDebit: return Bluebird.RFID.DESFireCmd.cDebit;
         case DESFireCmd.cCommitTransaction: return Bluebird.RFID.DESFireCmd.cCommitTransaction;
         case DESFireCmd.cAbortTransaction: return Bluebird.RFID.DESFireCmd.cAbortTransaction;
         case DESFireCmd.cSetFileSettings: return Bluebird.RFID.DESFireCmd.cSetFileSettings;
         case DESFireCmd.cChangeKeyEntry: return Bluebird.RFID.DESFireCmd.cChangeKeyEntry;
         case DESFireCmd.cGetKeyEntry: return Bluebird.RFID.DESFireCmd.cGetKeyEntry;
         case DESFireCmd.cGetVersionSAM: return Bluebird.RFID.DESFireCmd.cGetVersionSAM;
         case DESFireCmd.cAuthenticateHost: return Bluebird.RFID.DESFireCmd.cAuthenticateHost;
         default:  // something is missing (TODO)
         case DESFireCmd.cSetLogicalChannel: return Bluebird.RFID.DESFireCmd.cSetLogicalChannel;
     }
 }
Exemplo n.º 3
0
        Bluebird.RFID.DESFireCmd desFireCmd2bb(DESFireCmd cmd)
        {
            switch (cmd)
            {
            case DESFireCmd.cSAMOnOff: return(Bluebird.RFID.DESFireCmd.cSAMOnOff);

            case DESFireCmd.cAuthenticate: return(Bluebird.RFID.DESFireCmd.cAuthenticate);

            case DESFireCmd.cChangeKeySettings: return(Bluebird.RFID.DESFireCmd.cChangeKeySettings);

            case DESFireCmd.cGetKeySettings: return(Bluebird.RFID.DESFireCmd.cGetKeySettings);

            case DESFireCmd.cChangeKey: return(Bluebird.RFID.DESFireCmd.cChangeKey);

            case DESFireCmd.cGetKeyVersion: return(Bluebird.RFID.DESFireCmd.cGetKeyVersion);

            case DESFireCmd.cCreateApplication: return(Bluebird.RFID.DESFireCmd.cCreateApplication);

            case DESFireCmd.cGetApplicationIDs: return(Bluebird.RFID.DESFireCmd.cGetApplicationIDs);

            case DESFireCmd.cSelectApplication: return(Bluebird.RFID.DESFireCmd.cSelectApplication);

            case DESFireCmd.cFormatPICC: return(Bluebird.RFID.DESFireCmd.cFormatPICC);

            case DESFireCmd.cGetVersion: return(Bluebird.RFID.DESFireCmd.cGetVersion);

            case DESFireCmd.cGetFileIDs: return(Bluebird.RFID.DESFireCmd.cGetFileIDs);

            case DESFireCmd.cGetFileSettings: return(Bluebird.RFID.DESFireCmd.cGetFileSettings);

            case DESFireCmd.cChangeFileSettings: return(Bluebird.RFID.DESFireCmd.cChangeFileSettings);

            case DESFireCmd.cCreateStandardDataFile: return(Bluebird.RFID.DESFireCmd.cCreateStandardDataFile);

            case DESFireCmd.cCreateBackupDataFile: return(Bluebird.RFID.DESFireCmd.cCreateBackupDataFile);

            case DESFireCmd.cCreateValueFile: return(Bluebird.RFID.DESFireCmd.cCreateValueFile);

            case DESFireCmd.cCreateLinearRecordFile: return(Bluebird.RFID.DESFireCmd.cCreateLinearRecordFile);

            case DESFireCmd.cCreateCyclicRecordFile: return(Bluebird.RFID.DESFireCmd.cCreateCyclicRecordFile);

            case DESFireCmd.cReadData: return(Bluebird.RFID.DESFireCmd.cReadData);

            case DESFireCmd.cReadRecords: return(Bluebird.RFID.DESFireCmd.cReadRecords);

            case DESFireCmd.cWriteData: return(Bluebird.RFID.DESFireCmd.cWriteData);

            case DESFireCmd.cWriteRecords: return(Bluebird.RFID.DESFireCmd.cWriteRecords);

            case DESFireCmd.cGetValue: return(Bluebird.RFID.DESFireCmd.cGetValue);

            case DESFireCmd.cCredit: return(Bluebird.RFID.DESFireCmd.cCredit);

            case DESFireCmd.cDebit: return(Bluebird.RFID.DESFireCmd.cDebit);

            case DESFireCmd.cCommitTransaction: return(Bluebird.RFID.DESFireCmd.cCommitTransaction);

            case DESFireCmd.cAbortTransaction: return(Bluebird.RFID.DESFireCmd.cAbortTransaction);

            case DESFireCmd.cSetFileSettings: return(Bluebird.RFID.DESFireCmd.cSetFileSettings);

            case DESFireCmd.cChangeKeyEntry: return(Bluebird.RFID.DESFireCmd.cChangeKeyEntry);

            case DESFireCmd.cGetKeyEntry: return(Bluebird.RFID.DESFireCmd.cGetKeyEntry);

            case DESFireCmd.cGetVersionSAM: return(Bluebird.RFID.DESFireCmd.cGetVersionSAM);

            case DESFireCmd.cAuthenticateHost: return(Bluebird.RFID.DESFireCmd.cAuthenticateHost);

            default:      // something is missing (TODO)
            case DESFireCmd.cSetLogicalChannel: return(Bluebird.RFID.DESFireCmd.cSetLogicalChannel);
            }
        }
Exemplo n.º 4
0
 public bool SendDESFireCmd(DESFireCmd cmd, byte[] abyData, byte[] abyResultBuf, ref int nNumBytes)
 {
     byte cCmd = (byte)desFireCmd2bb(cmd);
     uint b_retv = m_clsRFReader.DESFire(cCmd, abyData, abyResultBuf);
     nNumBytes = abyResultBuf[0];
     if (b_retv.Equals(0))
         return true;
     return false;
 }