/// <summary> /// Create a opspec for nxp gen2i change config /// </summary> /// <param name="tagOperation"></param> /// <returns>PARAM_Custom</returns> private PARAM_Custom BuildNxpG2IChangeConfig(Gen2.NXP.G2I.ChangeConfig tagOperation) { PARAM_ThingMagicNXPG2IChangeConfig nxpG2IChangeConfig = null; if (!(tagOperation is Gen2.NXP.G2I.ChangeConfig)) { throw new FeatureNotSupportedException("ChangeConfig works only for G2I tags."); } else { nxpG2IChangeConfig = new PARAM_ThingMagicNXPG2IChangeConfig(); //Set access password nxpG2IChangeConfig.AccessPassword = tagOperation.AccessPassword; //Build Thingmagic NXP config word PARAM_ThingMagicNXPConfigWord nxpConfigWord = new PARAM_ThingMagicNXPConfigWord(); Gen2.NXP.G2I.ConfigWord config = new Gen2.NXP.G2I.ConfigWord(); config = config.GetConfigWord(tagOperation.ConfigWord); nxpConfigWord.ConditionalReadRangeReduction_OnOff = config.ConditionalReadRangeReduction_onOff; nxpConfigWord.ConditionalReadRangeReduction_OpenShort = config.ConditionalReadRangeReduction_openShort; nxpConfigWord.DataMode = config.DataMode; nxpConfigWord.DigitalOutput = config.DigitalOutput; nxpConfigWord.ExternalSupply = config.ExternalSupply; nxpConfigWord.InvertDigitalOutput = config.InvertDigitalOutput; nxpConfigWord.MaxBackscatterStrength = config.MaxBackscatterStrength; nxpConfigWord.PrivacyMode = config.PrivacyMode; nxpConfigWord.PSFAlarm = config.PsfAlarm; nxpConfigWord.ReadProtectEPC = config.ReadProtectEPC; nxpConfigWord.ReadProtectTID = config.ReadProtectTID; nxpConfigWord.ReadProtectUser = config.ReadProtectUser; nxpConfigWord.TamperAlarm = config.TamperAlarm; nxpConfigWord.TransparentMode = config.TransparentMode; nxpG2IChangeConfig.ThingMagicNXPConfigWord = nxpConfigWord; //Set the OpSpecID to a unique number. nxpG2IChangeConfig.OpSpecID = ++OpSpecID; return nxpG2IChangeConfig; } }
/// <summary> /// Parse tag opspec result type /// </summary> /// <param name="opSpecResult"></param> /// <param name="tag"></param> private void ParseTagOpSpecResultType(UNION_AccessCommandOpSpecResult opSpecResult, ref TagReadData tag) { // TODO: Generalize ReaderCodeExceptions to cover all types of readers, not just Serial if (opSpecResult[0].GetType() == typeof(PARAM_C1G2ReadOpSpecResult)) { switch (((PARAM_C1G2ReadOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2ReadResultType.Success: tag._data = ByteConv.ConvertFromUshortArray(((PARAM_C1G2ReadOpSpecResult)opSpecResult[0]).ReadData.data.ToArray()); tagOpResponse = ((PARAM_C1G2ReadOpSpecResult)opSpecResult[0]).ReadData.data.ToArray(); break; case ENUM_C1G2ReadResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2ReadResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2ReadResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); case ENUM_C1G2ReadResultType.Memory_Locked_Error: throw new ReaderCodeException("Tag memory locked error", FAULT_GEN2_PROTOCOL_MEMORY_LOCKED_Exception.StatusCode); case ENUM_C1G2ReadResultType.Memory_Overrun_Error: throw new ReaderCodeException("Tag memory overrun error", FAULT_GEN2_PROTOCOL_MEMORY_OVERRUN_BAD_PC_Exception.StatusCode); } } else if (opSpecResult[0].GetType() == typeof(PARAM_C1G2WriteOpSpecResult)) { switch (((PARAM_C1G2WriteOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2WriteResultType.Success: break; case ENUM_C1G2WriteResultType.Insufficient_Power: throw new ReaderCodeException("Insufficient power", FAULT_GEN2_PROTOCOL_INSUFFICIENT_POWER_Exception.StatusCode); case ENUM_C1G2WriteResultType.Tag_Memory_Locked_Error: throw new ReaderCodeException("Tag memory locked error", FAULT_GEN2_PROTOCOL_MEMORY_LOCKED_Exception.StatusCode); case ENUM_C1G2WriteResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2WriteResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2WriteResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); case ENUM_C1G2WriteResultType.Tag_Memory_Overrun_Error: throw new ReaderCodeException("Tag memory overrun error", FAULT_GEN2_PROTOCOL_MEMORY_OVERRUN_BAD_PC_Exception.StatusCode); } } else if (opSpecResult[0].GetType() == typeof(PARAM_C1G2KillOpSpecResult)) { switch (((PARAM_C1G2KillOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2KillResultType.Success: break; case ENUM_C1G2KillResultType.Insufficient_Power: throw new ReaderCodeException("Insufficient power", FAULT_GEN2_PROTOCOL_INSUFFICIENT_POWER_Exception.StatusCode); case ENUM_C1G2KillResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2KillResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2KillResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); case ENUM_C1G2KillResultType.Zero_Kill_Password_Error: throw new ReaderException("Zero kill password error"); } } else if (opSpecResult[0].GetType() == typeof(PARAM_C1G2BlockWriteOpSpecResult)) { switch (((PARAM_C1G2BlockWriteOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2BlockWriteResultType.Success: break; case ENUM_C1G2BlockWriteResultType.Insufficient_Power: throw new ReaderCodeException("Insufficient power", FAULT_GEN2_PROTOCOL_INSUFFICIENT_POWER_Exception.StatusCode); case ENUM_C1G2BlockWriteResultType.Tag_Memory_Locked_Error: throw new ReaderCodeException("Tag memory locked error", FAULT_GEN2_PROTOCOL_MEMORY_LOCKED_Exception.StatusCode); case ENUM_C1G2BlockWriteResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2BlockWriteResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2BlockWriteResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); case ENUM_C1G2BlockWriteResultType.Tag_Memory_Overrun_Error: throw new ReaderCodeException("Tag memory overrun error", FAULT_GEN2_PROTOCOL_MEMORY_OVERRUN_BAD_PC_Exception.StatusCode); } } else if (opSpecResult[0].GetType() == typeof(PARAM_C1G2LockOpSpecResult)) { switch (((PARAM_C1G2LockOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2LockResultType.Success: break; case ENUM_C1G2LockResultType.Insufficient_Power: throw new ReaderCodeException("Insufficient power", FAULT_GEN2_PROTOCOL_INSUFFICIENT_POWER_Exception.StatusCode); case ENUM_C1G2LockResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2LockResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2LockResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); } } else if (opSpecResult[0].GetType() == typeof(PARAM_C1G2BlockEraseOpSpecResult)) { switch (((PARAM_C1G2BlockEraseOpSpecResult)opSpecResult[0]).Result) { case ENUM_C1G2BlockEraseResultType.Success: break; case ENUM_C1G2BlockEraseResultType.Insufficient_Power: throw new ReaderCodeException("Insufficient power", FAULT_GEN2_PROTOCOL_INSUFFICIENT_POWER_Exception.StatusCode); case ENUM_C1G2BlockEraseResultType.No_Response_From_Tag: throw new ReaderCodeException("No response from tag", FAULT_PROTOCOL_NO_DATA_READ_Exception.StatusCode); case ENUM_C1G2BlockEraseResultType.Nonspecific_Reader_Error: throw new ReaderException("Non-specific reader error"); case ENUM_C1G2BlockEraseResultType.Nonspecific_Tag_Error: throw new ReaderCodeException("Non-specific tag error", FAULT_GENERAL_TAG_ERROR_Exception.StatusCode); case ENUM_C1G2BlockEraseResultType.Tag_Memory_Locked_Error: throw new ReaderCodeException("Tag memory locked error", FAULT_GEN2_PROTOCOL_MEMORY_LOCKED_Exception.StatusCode); case ENUM_C1G2BlockEraseResultType.Tag_Memory_Overrun_Error: throw new ReaderCodeException("Tag memory overrun error", FAULT_GEN2_PROTOCOL_MEMORY_OVERRUN_BAD_PC_Exception.StatusCode); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicBlockPermalockOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicBlockPermalockOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicBlockPermalockOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tagOpResponse = ByteConv.ConvertFromUshortArray(((PARAM_ThingMagicBlockPermalockOpSpecResult)opSpecResult[0]).PermalockStatus.data.ToArray()); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicWriteTagOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicWriteTagOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicHiggs2PartialLoadImageOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicHiggs2PartialLoadImageOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicHiggs2FullLoadImageOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicHiggs2FullLoadImageOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2XResetReadProtectOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2XResetReadProtectOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicHiggs3FastLoadImageOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicHiggs3FastLoadImageOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicHiggs3LoadImageOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicHiggs3LoadImageOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicHiggs3BlockReadLockOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicHiggs3BlockReadLockOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2ICalibrateOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2ICalibrateOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicNXPG2ICalibrateOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tagOpResponse = ((PARAM_ThingMagicNXPG2ICalibrateOpSpecResult)opSpecResult[0]).CalibrateData.ToArray(); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2IChangeConfigOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2IChangeConfigOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicNXPG2IChangeConfigOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { Gen2.NXP.G2I.ConfigWord word = new Gen2.NXP.G2I.ConfigWord(); tagOpResponse = word.GetConfigWord(((PARAM_ThingMagicNXPG2IChangeConfigOpSpecResult)opSpecResult[0]).ConfigData); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2IChangeEASOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2IChangeEASOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2IResetReadProtectOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2IResetReadProtectOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2ISetReadProtectOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2ISetReadProtectOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2XCalibrateOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2XCalibrateOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicNXPG2XCalibrateOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tagOpResponse = ((PARAM_ThingMagicNXPG2XCalibrateOpSpecResult)opSpecResult[0]).CalibrateData.ToArray(); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2XChangeEASOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2XChangeEASOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2XSetReadProtectOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2XSetReadProtectOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicImpinjMonza4QTReadWriteOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicImpinjMonza4QTReadWriteOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicImpinjMonza4QTReadWriteOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { Gen2.Impinj.Monza4.QTPayload qtPayload = new Gen2.Impinj.Monza4.QTPayload(); int res = ((PARAM_ThingMagicImpinjMonza4QTReadWriteOpSpecResult)opSpecResult[0]).Payload; //Construct QTPayload if ((res & 0x8000) != 0) { qtPayload.QTSR = true; } if ((res & 0x4000) != 0) { qtPayload.QTMEM = true; } tagOpResponse = qtPayload; } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2IEASAlarmOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2IEASAlarmOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicNXPG2IEASAlarmOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tagOpResponse = ((PARAM_ThingMagicNXPG2IEASAlarmOpSpecResult)opSpecResult[0]).EASAlarmCode; } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicNXPG2XEASAlarmOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicNXPG2XEASAlarmOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicNXPG2XEASAlarmOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tagOpResponse = ((PARAM_ThingMagicNXPG2XEASAlarmOpSpecResult)opSpecResult[0]).EASAlarmCode; } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicISO180006BReadOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicISO180006BReadOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicISO180006BReadOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tag._data = ((PARAM_ThingMagicISO180006BReadOpSpecResult)opSpecResult[0]).ReadData.ToArray(); tagOpResponse = ((PARAM_ThingMagicISO180006BReadOpSpecResult)opSpecResult[0]).ReadData.ToArray(); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicISO180006BLockOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicISO180006BLockOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicISO180006BWriteOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicISO180006BWriteOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AGetBatteryLevelOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AGetBatteryLevelOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900AGetBatteryLevelOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tag._data = ByteConv.EncodeU16(((PARAM_ThingMagicIDSSL900AGetBatteryLevelOpSpecResult)opSpecResult[0]).ThingMagicIDSBatteryLevel.reply); Gen2.IDS.SL900A.BatteryLevelReading batteryLevel = new Gen2.IDS.SL900A.BatteryLevelReading(((PARAM_ThingMagicIDSSL900AGetBatteryLevelOpSpecResult)opSpecResult[0]).ThingMagicIDSBatteryLevel.reply); tagOpResponse = batteryLevel; } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASensorValueOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASensorValueOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900ASensorValueOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tag._data = ByteConv.EncodeU16(((PARAM_ThingMagicIDSSL900ASensorValueOpSpecResult)opSpecResult[0]).reply); Gen2.IDS.SL900A.SensorReading sensorReading = new Gen2.IDS.SL900A.SensorReading(((PARAM_ThingMagicIDSSL900ASensorValueOpSpecResult)opSpecResult[0]).reply); tagOpResponse = sensorReading; } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASetCalibrationDataOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASetCalibrationDataOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AGetCalibrationDataOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AGetCalibrationDataOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900AGetCalibrationDataOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { PARAM_ThingMagicIDSCalibrationData data = ((PARAM_ThingMagicIDSSL900AGetCalibrationDataOpSpecResult)opSpecResult[0]).ThingMagicIDSCalibrationData; LTKD.ByteArray calibrationValue = data.calibrationValueByteStream; tag._data = calibrationValue.ToArray(); tagOpResponse = new Gen2.IDS.SL900A.CalSfe(calibrationValue.ToArray(), 0); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AEndLogOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AEndLogOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AInitializeOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AInitializeOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ALogStateOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ALogStateOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900ALogStateOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray logStateByteArray = ((PARAM_ThingMagicIDSSL900ALogStateOpSpecResult)opSpecResult[0]).LogStateByteStream; tag._data = logStateByteArray.ToArray(); tagOpResponse = new Gen2.IDS.SL900A.LogState(logStateByteArray.ToArray()); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASetLogModeOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASetLogModeOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AStartLogOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AStartLogOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASetSFEParamsOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASetSFEParamsOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AGetMeasurementSetupOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AGetMeasurementSetupOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900AGetMeasurementSetupOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray measurementByteArray = ((PARAM_ThingMagicIDSSL900AGetMeasurementSetupOpSpecResult)opSpecResult[0]).measurementByteStream; tag._data = measurementByteArray.ToArray(); tagOpResponse = new Gen2.IDS.SL900A.MeasurementSetupData(measurementByteArray.ToArray(), 0); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AAccessFIFOReadOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AAccessFIFOReadOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900AAccessFIFOReadOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray readPayLoad = ((PARAM_ThingMagicIDSSL900AAccessFIFOReadOpSpecResult)opSpecResult[0]).readPayLoad; tag._data = readPayLoad.ToArray(); tagOpResponse = readPayLoad.ToArray(); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AAccessFIFOWriteOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AAccessFIFOWriteOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900AAccessFIFOStatusOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900AAccessFIFOStatusOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicIDSSL900AAccessFIFOStatusOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { tag._data = ByteConv.EncodeU16(Convert.ToUInt16(((PARAM_ThingMagicIDSSL900AAccessFIFOStatusOpSpecResult)opSpecResult[0]).FIFOStatusRawByte)); tagOpResponse = new Gen2.IDS.SL900A.FifoStatus(((PARAM_ThingMagicIDSSL900AAccessFIFOStatusOpSpecResult)opSpecResult[0]).FIFOStatusRawByte); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASetLogLimitsOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASetLogLimitsOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSetShelfLifeOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSetShelfLifeOpSpecResult)opSpecResult[0]).Result); } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicIDSSL900ASetPasswordOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicIDSSL900ASetPasswordOpSpecResult)opSpecResult[0]).Result); } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVActivateSecureModeOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVActivateSecureModeOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVActivateSecureModeOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray activateSecureModeValue = ((PARAM_ThingMagicDenatranIAVActivateSecureModeOpSpecResult)opSpecResult[0]).ActivateSecureModeByteStream; tag._data = activateSecureModeValue.ToArray(); tagOpResponse = activateSecureModeValue.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVActivateSiniavModeOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVActivateSiniavModeOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVActivateSiniavModeOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray activateSiniavModeValue = ((PARAM_ThingMagicDenatranIAVActivateSiniavModeOpSpecResult)opSpecResult[0]).ActivateSiniavModeByteStream; tag._data = activateSiniavModeValue.ToArray(); tagOpResponse = activateSiniavModeValue.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVAuthenticateOBUOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVAuthenticateOBUOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVAuthenticateOBUOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray authenticateOBUValue = ((PARAM_ThingMagicDenatranIAVAuthenticateOBUOpSpecResult)opSpecResult[0]).AuthenitcateOBUByteStream; tag._data = authenticateOBUValue.ToArray(); tagOpResponse = authenticateOBUValue.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass1OpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass1OpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass1OpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray authenticateFullPass1Value = ((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass1OpSpecResult)opSpecResult[0]).OBUAuthenticateFullPass1ByteStream; tag._data = authenticateFullPass1Value.ToArray(); tagOpResponse = authenticateFullPass1Value.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass2OpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass2OpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass2OpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray authenticateFullPass2Value = ((PARAM_ThingMagicDenatranIAVOBUAuthenticateFullPass2OpSpecResult)opSpecResult[0]).OBUAuthenticateFullPass2ByteStream; tag._data = authenticateFullPass2Value.ToArray(); tagOpResponse = authenticateFullPass2Value.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVOBUAuthenticateIDOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVOBUAuthenticateIDOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVOBUAuthenticateIDOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray authenticateIDValue = ((PARAM_ThingMagicDenatranIAVOBUAuthenticateIDOpSpecResult)opSpecResult[0]).OBUAuthenticateIDByteStream; tag._data = authenticateIDValue.ToArray(); tagOpResponse = authenticateIDValue.ToArray(); } } else if(opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVOBUReadFromMemMapOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVOBUReadFromMemMapOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVOBUReadFromMemMapOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray readMemoryMapValue = ((PARAM_ThingMagicDenatranIAVOBUReadFromMemMapOpSpecResult)opSpecResult[0]).OBUReadMemoryMapByteStream; tag._data = readMemoryMapValue.ToArray(); tagOpResponse = readMemoryMapValue.ToArray(); } } else if (opSpecResult[0].GetType() == typeof(PARAM_ThingMagicDenatranIAVOBUWriteToMemMapOpSpecResult)) { ParseCustomTagOpSpecResultType(((PARAM_ThingMagicDenatranIAVOBUWriteToMemMapOpSpecResult)opSpecResult[0]).Result); if (((PARAM_ThingMagicDenatranIAVOBUWriteToMemMapOpSpecResult)opSpecResult[0]).Result.Equals(ENUM_ThingMagicCustomTagOpSpecResultType.Success)) { LTKD.ByteArray writeMemoryMapValue = ((PARAM_ThingMagicDenatranIAVOBUWriteToMemMapOpSpecResult)opSpecResult[0]).OBUWriteMemoryMapByteStream; tag._data = writeMemoryMapValue.ToArray(); tagOpResponse = writeMemoryMapValue.ToArray(); } } }