Exemple #1
0
        /// <summary>
        /// Constructs a new instance of FramingBerOutput.
        /// </summary>
        /// <param name="maximumPackageLength">The maximum length of a package.
        /// Must be greater than ProtocolParameters.MinimumHeaderLength and less than or equal to
        /// ProtocolParameters.MaximumPackageLength.</param>
        /// <param name="slotId">The S101 slot id</param>
        /// <param name="dtd">The dtd of the ember data to frame</param>
        /// <param name="packageReadyHandler">A callback that is attached to the PackageReady event. May be null.</param>
        public FramingBerOutput(int maximumPackageLength, int slotId, Dtd dtd, EventHandler<PackageReadyArgs> packageReadyHandler)
        {
            if(maximumPackageLength <= ProtocolParameters.MinimumHeaderLength)
            throw new ArgumentException("maximumPackageLength must be greater than ProtocolParameters.MinimumHeaderLength!");
             if(maximumPackageLength > ProtocolParameters.MaximumPackageLength)
            throw new ArgumentException("maximumPackageLength must not be greater than ProtocolParameters.MaxPackageLength!");

             MaximumPackageLength = maximumPackageLength;
             SlotId = slotId;
             Dtd = dtd;

             if(packageReadyHandler != null)
            PackageReady += packageReadyHandler;

             _isFirstPackage = true;
        }
        /// <summary>
        /// Constructs a new instance of FramingBerOutput.
        /// </summary>
        /// <param name="maximumPackageLength">The maximum length of a package.
        /// Must be greater than ProtocolParameters.MinimumHeaderLength and less than or equal to
        /// ProtocolParameters.MaximumPackageLength.</param>
        /// <param name="slotId">The S101 slot id</param>
        /// <param name="dtd">The dtd of the ember data to frame</param>
        /// <param name="packageReadyHandler">A callback that is attached to the PackageReady event. May be null.</param>
        public FramingBerOutput(int maximumPackageLength, int slotId, Dtd dtd, EventHandler <PackageReadyArgs> packageReadyHandler)
        {
            if (maximumPackageLength <= ProtocolParameters.MinimumHeaderLength)
            {
                throw new ArgumentException("maximumPackageLength must be greater than ProtocolParameters.MinimumHeaderLength!");
            }
            if (maximumPackageLength > ProtocolParameters.MaximumPackageLength)
            {
                throw new ArgumentException("maximumPackageLength must not be greater than ProtocolParameters.MaxPackageLength!");
            }

            MaximumPackageLength = maximumPackageLength;
            SlotId = slotId;
            Dtd    = dtd;

            if (packageReadyHandler != null)
            {
                PackageReady += packageReadyHandler;
            }

            _isFirstPackage = true;
        }
Exemple #3
0
 public PackageReceivedArgs(int slotId, byte messageId, byte command, Dtd? dtd, bool isFirst, bool isLast, bool isEmpty, byte[] appBytes)
 {
     SlotId = slotId;
     MessageId = messageId;
     Command = command;
     Dtd = dtd;
     IsFirstPackage = isFirst;
     IsLastPackage = isLast;
     IsEmptyPackage = isEmpty;
     ApplicationBytes = appBytes;
 }
 public DemoXmlRules(Dtd dtd) : base(dtd)
 {
 }
Exemple #5
0
 /// <summary>
 /// Renvoie un HashCode
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(base.GetHashCode() + 17 * Sexe.GetHashCode() + 17 * Pere.GetHashCode() + 17 + Mere.GetHashCode() + 17 * Dtn.GetHashCode() + 17 * Dtd.GetHashCode());
 }
Exemple #6
0
 public XmlRules(Dtd dtd)
 {
     this.Dtd = dtd;
 }