public void setCardConfigEx(IntPtr sdkContext, UInt32 deviceID, bool isMasterDevice) { BS2CardConfigEx config = Util.AllocateStructure <BS2CardConfigEx>(); config.seos.oid_ADF[0] = 0x01; config.seos.oid_ADF[1] = 0x02; config.seos.oid_DataObjectID[0] = 0xD0; config.seos.oid_DataObjectID[1] = 0xD1; config.seos.size_DataObject[0] = 90; config.seos.size_DataObject[1] = 100; config.seos.primaryKeyAuth[0] = 0x01; config.seos.primaryKeyAuth[1] = 0xFE; config.seos.secondaryKeyAuth[0] = 0x01; config.seos.secondaryKeyAuth[1] = 0x1E; Console.WriteLine("Trying to set CardConfigEx configuration."); BS2ErrorCode result = (BS2ErrorCode)API.BS2_SetCardConfigEx(sdkContext, deviceID, ref config); if (result != BS2ErrorCode.BS_SDK_SUCCESS) { Console.WriteLine("Got error({0}).", result); } }
void print(IntPtr sdkContext, BS2CardConfigEx config) { Console.WriteLine(">>>> CardEx configuration "); Console.WriteLine(" |--oid_ADF : {0}", BitConverter.ToString(config.seos.oid_ADF)); Console.WriteLine(" |--size_ADF : {0}", config.seos.size_ADF); Console.WriteLine(" |--oid_DataObjectID : {0}", BitConverter.ToString(config.seos.oid_DataObjectID)); Console.WriteLine(" |++size_DataObject"); for (int i = 0; i < 8; ++i) { Console.WriteLine(" |--size{0} : {1}", i, config.seos.size_DataObject[i]); } Console.WriteLine(" |--primaryKeyAuth : {0}", BitConverter.ToString(config.seos.primaryKeyAuth)); Console.WriteLine(" |--secondaryKeyAuth : {0}", BitConverter.ToString(config.seos.secondaryKeyAuth)); Console.WriteLine("<<<< "); }