Esempio n. 1
0
        static TokenizedAtrAdapter()
        {
            IPropertyAdapterFactory <TokenizedAtrAdapter> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <TokenizedAtrAdapter>();

            TokenizedAtrAdapter.preambleAdapter = PropertyFactory.Create(
                nameof(TokenizedAtrAdapter.Preamble),
                instance => new AtrPreambleTokenAdapter(instance.tokenizedAtr.Preamble)
                );
            TokenizedAtrAdapter.interfaceByteGroupsAdapter = PropertyFactory.Create(
                nameof(TokenizedAtrAdapter.InterfaceBytesGroups),
                instance => instance.tokenizedAtr.InterfaceByteGroups,
                (instance, group) => new AtrInterfaceByteGroupTokenAdapter(group)
                );
            TokenizedAtrAdapter.historicalCharactersAdapter = PropertyFactory.Create(
                nameof(TokenizedAtrAdapter.HistoricalCharacters),
                instance => new AtrHistoricalCharactersTokenAdapter(instance.tokenizedAtr.HistoricalCharacters)
                );
            TokenizedAtrAdapter.checksumAdapter = PropertyFactory.Create(
                nameof(TokenizedAtrAdapter.Checksum),
                instance => new AtrChecksumTokenAdapter(instance.tokenizedAtr.AtrChecksum)
                );
            TokenizedAtrAdapter.extraBytesAdapter = PropertyFactory.Create(
                nameof(TokenizedAtrAdapter.ExtraBytes),
                instance => new AtrExtraBytesAdapter(instance.tokenizedAtr.ExtraBytes)
                );
        }
        static InterpretedAtrAdapter()
        {
            IPropertyAdapterFactory <InterpretedAtrAdapter> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <InterpretedAtrAdapter>();

            InterpretedAtrAdapter.globalInterfaceBytesAdapter = PropertyFactory.Create(
                nameof(InterpretedAtrAdapter.GlobalInterfaceBytes),
                instance => new GlobalInterfaceBytesAdapter(instance.atr.GlobalInterfaceBytes)
                );
            InterpretedAtrAdapter.protocolParametersAdapter = PropertyFactory.Create(
                nameof(InterpretedAtrAdapter.ProtocolParameters),
                instance => instance.atr.ProtocolParameters,
                (instance, parameter) => ProtocolParameterAdapterBase.GetObject(parameter)
                );
            InterpretedAtrAdapter.historicalCharactersAdapter = PropertyFactory.Create(
                nameof(InterpretedAtrAdapter.HistoricalCharacters),
                instance => AtrHistoricalBytesAdapterBase.GetObject(instance.atr.HistoricalCharacters, instance)
                );
            InterpretedAtrAdapter.possibleTypesToIndicateAdditionallyAdapter = PropertyFactory.Create(
                nameof(InterpretedAtrAdapter.PossibleTypesToIndicateAdditionally),
                instance => EnumerationAdapter <ProtocolType> .Items.Where(
                    type => type != ProtocolType.RfuF &&
                    instance.atr.ProtocolParameters.Any(_ => _.ProtocolType == type) == false
                    )
                );
        }
Esempio n. 3
0
        /* ISO 7816-4 ch. 8.3 Optional COMPACT-TLV data objects
         * The coding of the COMPACT-TLV data objects is deduced from the basic encoding rules af ASN.1 (see
         * ISO/IEC 8825 and annex D) for BER-TLV data objects with tag='4X' and length='0Y'. The coding of
         * such data objects is replaced by 'XY' followed by 'Y' bytes of data. In this clause, 'X' is
         * referred to as the tag number and 'Y' as the length.
         * Besides the data objects defined in this clause, the historical bytes may contain data objects
         * defined in part 4 of ISO/IEC 7816. In this case the coding of the tags and length fields defined in
         * part 5 shall be modified as above.
         * When COMPACT-TLV data objects defined in this clause appear in the ATR file, they shall be encoded
         * according to the basic encoding rules of ASN.1 (i.e tag='4X', length='0Y').
         * All application-class tags not defined in ISO/IEC 7816 are reserved for ISO.
         *
         * 8.4 Status information
         * If the category indicator is valued to '80', then the status information may be present in a
         * COMPACT-TLV data object. In this case, the tag number is '8'. When the length is '1', then the
         * value is the card life status. When the length is '2', then the value is SW1-SW2. When the length
         * is '3', then the value is the card life status followed by SW1-SW2. Other values of the length are
         * reserved for ISO.
         */
        public AtrCompactTlvHistoricalCharacters(Atr owner)
            : base(owner)
        {
            this.dataObjects = new Dictionary <byte, CompactTlvDataObjectBase>
            {
                { 0x40, new CompactTlvDataObjectRfu(this, 0x40) },
                { 0x41, new CompactTlvDataObjectCountryCode(this) },
                { 0x42, new CompactTlvDataObjectIssuerIdentificationNumber(this) },
                { 0x43, new CompactTlvDataObjectCardServiceData(this) },
                { 0x44, new CompactTlvDataObjectInitialAccessData(this) },
                { 0x45, new CompactTlvDataObjectCardIssuerData(this) },
                { 0x46, new CompactTlvDataObjectPreIssuingData(this) },
                { 0x47, new CompactTlvDataObjectCardCapabilities(this) },
                { 0x48, new CompactTlvDataObjectStatusIndicator(this) },
                { 0x49, new CompactTlvDataObjectRfu(this, 0x49) },
                { 0x4A, new CompactTlvDataObjectRfu(this, 0x4A) },
                { 0x4B, new CompactTlvDataObjectRfu(this, 0x4B) },
                { 0x4C, new CompactTlvDataObjectRfu(this, 0x4C) },
                { 0x4D, new CompactTlvDataObjectRfu(this, 0x4D) },
                { 0x4E, new CompactTlvDataObjectRfu(this, 0x4E) },
                { 0x4F, new CompactTlvDataObjectApplicationIdentifier(this) }
            };

            this.dataObjectsAdapter = this.CreatePropertyAdapter(
                nameof(this.DataObjects),
                () => from DataObject in this.dataObjects.Values where DataObject.IsApplicable select DataObject,
                _ => _
                );
        }
        static AtrInterfaceByteGroupTokenAdapter()
        {
            ObservableObject.IPropertyAdapterFactory <AtrInterfaceByteGroupTokenAdapter> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <AtrInterfaceByteGroupTokenAdapter>();
            AtrInterfaceByteGroupTokenAdapter.groupNumberAdatper = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.GroupNumber),
                instance => instance.atrInterfaceByteGroupToken.Number
                );
            AtrInterfaceByteGroupTokenAdapter.typeAdatper = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.Type),
                instance => EnumerationAdapter <InterfaceByteGroupType> .GetInstanceFor(instance.atrInterfaceByteGroupToken.Type)
                );
            AtrInterfaceByteGroupTokenAdapter.taAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.Ta),
                instance => instance.atrInterfaceByteGroupToken.Ta.HasValue ? instance.atrInterfaceByteGroupToken.Ta.Value.ToHexString() : null,
                (instance, value) => instance.atrInterfaceByteGroupToken.Ta = !string.IsNullOrEmpty(value)?byte.Parse(value.Substring(0, Math.Min(value.Length, 2)), NumberStyles.HexNumber):(byte?)null
                );
            AtrInterfaceByteGroupTokenAdapter.tbAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.Tb),
                instance => instance.atrInterfaceByteGroupToken.Tb.HasValue ? instance.atrInterfaceByteGroupToken.Tb.Value.ToHexString() : null,
                (instance, value) => instance.atrInterfaceByteGroupToken.Tb = !string.IsNullOrEmpty(value) ? byte.Parse(value.Substring(0, Math.Min(value.Length, 2)), NumberStyles.HexNumber) : (byte?)null
                );
            AtrInterfaceByteGroupTokenAdapter.tcAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.Tc),
                instance => instance.atrInterfaceByteGroupToken.Tc.HasValue ? instance.atrInterfaceByteGroupToken.Tc.Value.ToHexString() : null,
                (instance, value) => instance.atrInterfaceByteGroupToken.Tc = !string.IsNullOrEmpty(value) ? byte.Parse(value.Substring(0, Math.Min(value.Length, 2)), NumberStyles.HexNumber) : (byte?)null
                );
            AtrInterfaceByteGroupTokenAdapter.nextGroupTypeAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.NextGroupType),
                instance => EnumerationAdapter <InterfaceByteGroupType> .GetInstanceFor(instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator != null?instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.GroupType:(InterfaceByteGroupType?)null)
                );
            AtrInterfaceByteGroupTokenAdapter.nextBytesTypeAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.NextBytes),
                instance => instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator != null?AtrTokenAdapterBase.ToString(instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.TaExists, instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.TbExists, instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.TcExists, instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.TdExists):"not set"
                );

            AtrInterfaceByteGroupTokenAdapter.possibleTypesToChangeToAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.PossibleTypesToChangeTo),
                instance => ((InterfaceByteGroupType[])Enum.GetValues(typeof(InterfaceByteGroupType)))
                .Where(_ => _ != InterfaceByteGroupType.Global)                                                                                                                                                         //gloabl cannot be set; the first group automatically is global
                .Where(_ => instance.atrInterfaceByteGroupToken.NextGroup != null)                                                                                                                                      //nothing cannot be set if no next group
                .Where(_ => _ != instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.GroupType)                                                                                                             //we can skip what is already set
                .OrderBy(_ => (int)_)                                                                                                                                                                                   //Sort by id
                .SkipWhile(value => value < instance.atrInterfaceByteGroupToken.Type)                                                                                                                                   //Next Group cannot be less than this group. Same is OK
                .TakeWhile(value => instance.atrInterfaceByteGroupToken.NextGroup.NextInterfaceBytesIndicator == null || value <= instance.atrInterfaceByteGroupToken.NextGroup.NextInterfaceBytesIndicator.GroupType), //next group cannot be higher than next to next group. Same is OK
                (instance, item) => EnumerationAdapter <InterfaceByteGroupType> .GetInstanceFor(item)
                );
            AtrInterfaceByteGroupTokenAdapter.possibleTypesToAddNextGroupAdapter = PropertyFactory.Create(
                nameof(AtrInterfaceByteGroupTokenAdapter.PossibleTypesToAddNextGroup),
                instance => ((InterfaceByteGroupType[])Enum.GetValues(typeof(InterfaceByteGroupType)))
                .Where(_ => _ != InterfaceByteGroupType.Global)                                                                                                                                     //gloabl cannot be set; the first group automatically is global
                .OrderBy(_ => (int)_)                                                                                                                                                               //Sort by id
                .SkipWhile(value => value < instance.atrInterfaceByteGroupToken.Type)                                                                                                               //Next Group cannot be less than this group. Same is OK
                .TakeWhile(value => instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator == null || value <= instance.atrInterfaceByteGroupToken.NextInterfaceBytesIndicator.GroupType), //next group cannot be higher than next to next group. Same is OK
                (instance, item) => EnumerationAdapter <InterfaceByteGroupType> .GetInstanceFor(item)
                );
        }
Esempio n. 5
0
        static ProtocolParameterAdapterBase()
        {
            IPropertyAdapterFactory <ProtocolParameterAdapterBase> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <ProtocolParameterAdapterBase>();

            ProtocolParameterAdapterBase.protocolParameterBytes = PropertyFactory.Create(
                nameof(ProtocolParameterAdapterBase.ProtocolParameterBytes),
                instance => instance.protocolParameters.ParameterBytes,
                (instance, parameterByte) => ProtocolParameterByteAdapterBase.GetObject(parameterByte)
                );
        }
        public ModelInspectorWindowModel(IModelInspectorModel model)
        {
            this.model         = model;
            this.groupsAdapter = this.CreatePropertyAdapter(
                nameof(ModelInspectorWindowModel.Groups),
                () => model.Groups,
                group => new ModelGroupAdapter(this, group)
                );

            this.dragDropHandler = DragDropTarget.GetFactory()
                                   .AddTypeHandler <ModelNodeBaseAdapter>(
                DragDropEffects.Copy,
                DragDropEffect.Copy,
                (value, effect, info) =>
            {
                int Count            = this.model.Groups.Count;
                int NewIndex         = info.GetInfoOrDefault <DropIndex>(Count);
                IModelGroup NewGroup = new ModelGroup(value.Name);
                NewGroup.Models.Add(new ModelInfo(value.Model.Value, value.Name, false));
                this.model.Groups.Insert(NewIndex, NewGroup);
            }
                ).AddTypeHandler <ModelInfoAdapter>(
                DragDropEffects.Move | DragDropEffects.Copy,
                DragDropEffect.Move,
                (value, effect, info) =>
            {
                int NewIndex         = info.GetInfoOrDefault <DropIndex>(this.model.Groups.Count);
                IModelGroup NewGroup = new ModelGroup(value.Name);
                NewGroup.Models.Add(new ModelInfo(value.Model.Root.Value, value.Model.Name, effect == DragDropEffect.Move?value.Model.NonClosable:false));
                this.model.Groups.Insert(NewIndex, NewGroup);
            }
                ).AddTypeHandler <ModelGroupAdapter>(
                DragDropEffects.Move | DragDropEffects.Copy,
                DragDropEffect.Move,
                (value, effect, info) =>
            {
                int NewIndex     = info.GetInfoOrDefault <DropIndex>(this.model.Groups.Count);
                ModelGroup Group = new ModelGroup(value.Group.Name);
                value.Group.Models.ForEach(modelInfo => Group.Models.Add(new ModelInfo(modelInfo.Root.Value, modelInfo.Name, effect == DragDropEffect.Move?modelInfo.NonClosable:false)));
                this.model.Groups.Insert(NewIndex, Group);
            }
                ).Create();

            this.ZoomModel = new ZoomModel();
#if DEBUG
            System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(
                (System.Action) delegate
            {
                ModelGroup Group = new ModelGroup("Model Inspector");
                Group.Models.Add(new ModelInfo(this, "Model Inspector", true));
                model.Groups.Add(Group);
            });
#endif
        }
Esempio n. 7
0
 public ModelAdapter(IModel model)
 {
     this.enumerablePropertyAdapter = this.CreatePropertyAdapter(
         () => this.EnumerableProperty,
         () => from Byte in model.SourceProperty
         where Byte != 0x00
         orderby Byte.GetHiNibble() ascending
         select Byte,
         item => SourcePropertyElementAdapter.GetObject(item)
         );
 }
 static ModelComplexNodeAdapter()
 {
     ObservableObject.IPropertyAdapterFactory <ModelComplexNodeAdapter> Factory = ObservableObject.GetPropertyAdapterFactory <ModelComplexNodeAdapter>();
     ModelComplexNodeAdapter.typenameAdapter = Factory.Create(
         nameof(ModelComplexNodeAdapter.Typename),
         instance => instance.model.Type.Name
         );
     ModelComplexNodeAdapter.childrenAdapter = Factory.Create(
         nameof(ModelComplexNodeAdapter.Children),
         instance => instance.model.Properties,
         (instance, value) => ModelNodeBaseAdapter.GetAdapter(instance, value)
         );
 }
        static AtrCompactTlvHistoricalBytesAdapter()
        {
            ObservableObject.IPropertyAdapterFactory <AtrCompactTlvHistoricalBytesAdapter> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <AtrCompactTlvHistoricalBytesAdapter>();

            AtrCompactTlvHistoricalBytesAdapter.dataObjectAdapter = PropertyFactory.Create(
                nameof(AtrCompactTlvHistoricalBytesAdapter.DataObjects),
                instance => instance.historicalCharacters.DataObjects,
                (instance, value) => DataObjectBaseAdapter.GetObject(value)
                );

            EnumerationAdapter <FileIoServices> .Items = new []
            {
                new EnumerationAdapter <FileIoServices>(FileIoServices.ReadBinary, "Read Binary", "Read Binary"),
                new EnumerationAdapter <FileIoServices>(FileIoServices.ReadRecord, "Read Record(s)", "Read Record(s)")
            };

            EnumerationAdapter <StatusWordIndication> .Items = new[]
            {
                new EnumerationAdapter <StatusWordIndication>(StatusWordIndication.NormalProcessing, "Normal Processing", "Normal Processing 0x9000"),
                new EnumerationAdapter <StatusWordIndication>(StatusWordIndication.StatusNotIndicated, "Status not indicated", "Status not indicated 0x0000"),
                new EnumerationAdapter <StatusWordIndication>(StatusWordIndication.Rfu, "RFU", "RFU")
            };

            EnumerationAdapter <KnownLifeCycle> .Items = new[]
            {
                new EnumerationAdapter <KnownLifeCycle>(KnownLifeCycle.NotIndicated, "Not Indicated", "Not Indicated 0x00"),
                new EnumerationAdapter <KnownLifeCycle>(KnownLifeCycle.Rfu, "RFU", "RFU")
            };

            EnumerationAdapter <StatusWordCoding> .Items = new[]
            {
                new EnumerationAdapter <StatusWordCoding>(StatusWordCoding.WithinTlvData, "Within TLV data objects", "Within TLV data objects"),
                new EnumerationAdapter <StatusWordCoding>(StatusWordCoding.FollowingTlvData, "Following the TLV data", "Following the TLV data")
            };

            EnumerationAdapter <LogicalChannelAssignment> .Items = new []
            {
                new EnumerationAdapter <LogicalChannelAssignment>(LogicalChannelAssignment.AssignedByCard, "Assigned by card", "Assigned by card (01)"),
                new EnumerationAdapter <LogicalChannelAssignment>(LogicalChannelAssignment.AssignedbyInterfaceDevice, "Assigned by interface device", "Assigned by interface device (10)"),
                new EnumerationAdapter <LogicalChannelAssignment>(LogicalChannelAssignment.NoLogicalChannel, "No logical channel", "No logical channel (00)"),
                new EnumerationAdapter <LogicalChannelAssignment>(LogicalChannelAssignment.Rfu11, "RFU 11", "RFU (11)")
            };

            EnumerationAdapter <WriteFunctionsBehaviour> .Items = new[]
            {
                new EnumerationAdapter <WriteFunctionsBehaviour>(WriteFunctionsBehaviour.OneTimeWrite, "One time write", "One time write (00)"),
                new EnumerationAdapter <WriteFunctionsBehaviour>(WriteFunctionsBehaviour.Proprietary, "Proprietary", "Proprietary (01)"),
                new EnumerationAdapter <WriteFunctionsBehaviour>(WriteFunctionsBehaviour.WriteAnd, "Write AND", "Write AND (10)"),
                new EnumerationAdapter <WriteFunctionsBehaviour>(WriteFunctionsBehaviour.WriteOr, "Write OR", "Write OR (11)")
            };
        }
Esempio n. 10
0
        static ModelGroupAdapter()
        {
            IPropertyAdapterFactory <ModelGroupAdapter> Factory = ObservableObject.GetPropertyAdapterFactory <ModelGroupAdapter>();

            ModelGroupAdapter.modelsAdapter = Factory.Create(
                nameof(ModelGroupAdapter.Models),
                instance => instance.Group.Models,
                (instance, model) => new ModelInfoAdapter(instance, model)
                );
            ModelGroupAdapter.nameAdapter = Factory.Create(
                nameof(ModelGroupAdapter.Name),
                instance => instance.Group.Name,
                (instance, value) => instance.Group.Name = value
                );
        }
Esempio n. 11
0
        static ModelPropertyNodeAdapter()
        {
            IPropertyAdapterFactory <ModelPropertyNodeAdapter> Factory = ObservableObject.GetPropertyAdapterFactory <ModelPropertyNodeAdapter>();

            ModelPropertyNodeAdapter.internalValueAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.InternalValue),
                instance => ModelNodeBaseAdapter.GetAdapter(instance, instance.propertyNode.Value)
                );
            ModelPropertyNodeAdapter.modelAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.Model),
                instance => instance.InternalValue.Model
                );
            ModelPropertyNodeAdapter.nameAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.Name),
                instance => instance.propertyNode.Name
                );
            ModelPropertyNodeAdapter.typenameAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.Typename),
                instance => instance.InternalValue.Typename
                );
            ModelPropertyNodeAdapter.valueAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.Value),
                instance => instance.InternalValue.Value
                );
            ModelPropertyNodeAdapter.hasValueAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.HasValue),
                instance => instance.InternalValue.HasValue
                );
            ModelPropertyNodeAdapter.supportsValidationAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.SupportsValidation),
                instance => instance.propertyNode.SupportsValidation
                );
            ModelPropertyNodeAdapter.validationSeverityAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.ValidationSeverity),
                instance => instance.propertyNode.ValidationSeverity
                );
            ModelPropertyNodeAdapter.validationResultsAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.ValidationResults),
                instance => instance.propertyNode.ValidationResults,
                (instance, message) => message
                );
            ModelPropertyNodeAdapter.childrenAdapter = Factory.Create(
                nameof(ModelPropertyNodeAdapter.Children),
                instance => instance.InternalValue.Children
                );
        }
Esempio n. 12
0
        public SmartCardSelectionModel()
        {
            this.cardReadersAdapter = this.CreatePropertyAdapter(
                nameof(this.CardReaders),
                () => this.SmartCardService != null ? this.SmartCardService.CardReaders : (IEnumerable <ICardReader>) new ICardReader[0],
                reader => new CardReaderAdapter(reader)
                );
            ((INotifyCollectionChanged)this.CardReaders).CollectionChanged += this.CardReadersChanged;

            this.SelectedCardReader = this.CardReaders.FirstOrDefault();

            this.allowCloseAdapter = this.CreatePropertyAdapter(
                nameof(this.AllowClose),
                () => this.SelectedCardReader != null && (this.AcceptEmptyCardReader || this.SelectedCardReader.SmartCard != null)
                );
            this.smartCardMustBeInsertedAdapter = this.CreatePropertyAdapter(
                nameof(this.SmartCardMustBeInserted),
                () => this.AcceptEmptyCardReader == false && this.CardReaders.Any() && this.SelectedCardReader.SmartCard == null
                );
        }
        static GlobalInterfaceBytesAdapter()
        {
            IPropertyAdapterFactory <GlobalInterfaceBytesAdapter> PropertyFactory = ObservableObject.GetPropertyAdapterFactory <GlobalInterfaceBytesAdapter>();

            GlobalInterfaceBytesAdapter.protocolParameterBytes = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.ProtocolParameterBytes),
                instance => instance.globalInterfaceBytes.ParameterBytes,
                (instance, parameterByte) => ProtocolParameterByteAdapterBase.GetObject(parameterByte)
                );

            GlobalInterfaceBytesAdapter.diAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.Di),
                instance => EnumerationAdapter <Di> .GetInstanceFor(instance.globalInterfaceBytes.DiValue),
                (instance, value) => instance.globalInterfaceBytes.SetDiFiFmax(value, instance.globalInterfaceBytes.FiFmaxValue)
                );
            GlobalInterfaceBytesAdapter.fiFmaxAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.FiFmax),
                instance => EnumerationAdapter <FiFmax> .GetInstanceFor(instance.globalInterfaceBytes.FiFmaxValue),
                (instance, value) => instance.globalInterfaceBytes.SetDiFiFmax(instance.globalInterfaceBytes.DiValue, value)
                );
            GlobalInterfaceBytesAdapter.etuAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.Etu),
                instance => GlobalInterfaceBytesAdapter.CalculateEtu(instance.globalInterfaceBytes.FiFmaxValue, instance.globalInterfaceBytes.DiValue)
                );
            GlobalInterfaceBytesAdapter.diFiIsDefaultAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.DiFiIsDefault),
                instance => instance.globalInterfaceBytes.Di.HasValue == false && instance.globalInterfaceBytes.FiFmax.HasValue == false
                );
            GlobalInterfaceBytesAdapter.extraGuardTimeAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.ExtraGuardTime),
                instance => instance.globalInterfaceBytes.ExtraGuardTimeValue,
                (instance, value) => instance.globalInterfaceBytes.ExtraGuardTime = value
                );
            GlobalInterfaceBytesAdapter.extraGuardTimeIsDefaultAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.ExtraGuardTimeIsDefault),
                instance => instance.globalInterfaceBytes.ExtraGuardTime.HasValue == false
                );

            GlobalInterfaceBytesAdapter.specificModeSupportedAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpecificModeSupported),
                instance => instance.globalInterfaceBytes.CanChangeNegotiableSpecificMode.HasValue ||
                instance.globalInterfaceBytes.SpecificModeImplicitFiDi.HasValue ||
                instance.globalInterfaceBytes.SpecificModeProtocol.HasValue
                );
            GlobalInterfaceBytesAdapter.canChangeNegotiableSpecificModeAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.CanChangeNegotiableSpecificMode),
                instance => instance.globalInterfaceBytes.CanChangeNegotiableSpecificMode.HasValue
                          ? instance.globalInterfaceBytes.CanChangeNegotiableSpecificMode.Value
                          : false
                );
            GlobalInterfaceBytesAdapter.specificModeImplicitFiDiAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpecificModeImplicitFiDi),
                instance => instance.globalInterfaceBytes.SpecificModeImplicitFiDi.HasValue
                          ? instance.globalInterfaceBytes.SpecificModeImplicitFiDi.Value
                          : false
                );
            GlobalInterfaceBytesAdapter.specificModeProtocolAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpecificModeProtocol),
                instance => instance.globalInterfaceBytes.SpecificModeProtocol.HasValue
                          ? EnumerationAdapter <ProtocolType> .GetInstanceFor(instance.globalInterfaceBytes.SpecificModeProtocol.Value)
                          : null
                );
            GlobalInterfaceBytesAdapter.clockStopSupportAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.ClockStopSupport),
                instance => EnumerationAdapter <ClockStopSupport> .GetInstanceFor(instance.globalInterfaceBytes.ClockStopSupportValue)
                );
            GlobalInterfaceBytesAdapter.clockStopSupportAndOperatingConditionsIsDefaultAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.ClockStopSupportAndOperatingConditionsIsDefault),
                instance => instance.globalInterfaceBytes.ClockStopSupport.HasValue == false || instance.globalInterfaceBytes.OperatingConditions.HasValue == false
                );
            GlobalInterfaceBytesAdapter.operatingConditionsAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.OperatingConditions),
                instance => EnumerationAdapter <OperatingConditions> .GetInstanceFor(instance.globalInterfaceBytes.OperatingConditionsValue)
                );
            GlobalInterfaceBytesAdapter.spuUseAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuUse),
                instance => EnumerationAdapter <SpuUse> .GetInstanceFor(instance.globalInterfaceBytes.SpuUseValue)
                );
            GlobalInterfaceBytesAdapter.spuUseIsDefaultAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuUseIsDefault),
                instance => instance.globalInterfaceBytes.SpuUse.HasValue == false
                );
            GlobalInterfaceBytesAdapter.spuUseIsNotUsedAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuUseIsNotUsed),
                instance => instance.globalInterfaceBytes.SpuUse == Classes.ATR.SpuUse.NotUsed
                );
            GlobalInterfaceBytesAdapter.spuUseIsStandardAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuUseIsStandard),
                instance => instance.globalInterfaceBytes.SpuUse == Classes.ATR.SpuUse.Standard
                );
            GlobalInterfaceBytesAdapter.spuUseIsProprietaryAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuUseIsProprietary),
                instance => instance.globalInterfaceBytes.SpuUse == Classes.ATR.SpuUse.Proprietary
                );
            GlobalInterfaceBytesAdapter.spuIsInUseAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuIsInUse),
                instance => instance.globalInterfaceBytes.SpuUseValue != Classes.ATR.SpuUse.NotUsed
                );
            GlobalInterfaceBytesAdapter.spuTypeAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuType),
                instance => instance.globalInterfaceBytes.SpuType != null ? instance.globalInterfaceBytes.SpuType.Value.ToHexString() : null
                );
            GlobalInterfaceBytesAdapter.spuTypeEtsiCodingAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.SpuTypeEtsiCoding),
                instance => instance.globalInterfaceBytes.SpuType != null && instance.globalInterfaceBytes.SpuType.EtsiCoding != null ? new SpuTypeEtsiCodingAdapter(instance.globalInterfaceBytes, instance.globalInterfaceBytes.SpuType.EtsiCoding) : null
                );

            GlobalInterfaceBytesAdapter.isVppConnectedAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.IsVppConnected),
                instance => instance.globalInterfaceBytes.IsVppConnected
                );
            GlobalInterfaceBytesAdapter.isVppConnectedisDefaultAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.IsVppConnectedIsDefault),
                instance => instance.globalInterfaceBytes.IsVppConnected.HasValue == false
                );
            GlobalInterfaceBytesAdapter.vppProgrammingVoltageAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.VppProgrammingVoltage),
                instance => instance.globalInterfaceBytes.VppProgrammingVoltage != null?instance.globalInterfaceBytes.VppProgrammingVoltage.Value.ToString("F1"):null
                );
            GlobalInterfaceBytesAdapter.vppProgrammingCurrentAdapter = PropertyFactory.Create(
                nameof(GlobalInterfaceBytesAdapter.VppProgrammingCurrent),
                instance => EnumerationAdapter <VppProgrammingCurrent> .GetInstanceFor(instance.globalInterfaceBytes.VppProgrammingCurrent)
                );
        }