Beispiel #1
0
        /**
         * Convenience constructor for IP addresses remote to this network.
         *
         * @param network
         * @param ipAddress
         * @param port
         */

        public Address(ushort networkNumber, byte[] ipAddress, int port)
        {
            this.networkNumber = new Unsigned16(networkNumber);

            byte[] ipMacAddress = new byte[ipAddress.Length + 2];
            Array.Copy(ipAddress, 0, ipMacAddress, 0, ipAddress.Length);
            ipMacAddress[ipAddress.Length]     = (byte)(port >> 8);
            ipMacAddress[ipAddress.Length + 1] = (byte)port;
            MacAddress = new OctetString(ipMacAddress);
        }
Beispiel #2
0
 public Address(Unsigned16 networkNumber, OctetString macAddress)
 {
     this.networkNumber = networkNumber;
     this.MacAddress    = macAddress;
 }
Beispiel #3
0
        /**
         * Convenience constructor for MS/TP addresses remote to this network.
         *
         * @param network
         * @param station
         */

        public Address(ushort networkNumber, byte station)
        {
            this.networkNumber = new Unsigned16(networkNumber);
            MacAddress         = new OctetString(new[] { station });
        }
Beispiel #4
0
 public Address(ByteStream queue)
 {
     networkNumber = (Unsigned16)read(queue, typeof(Unsigned16));
     MacAddress    = (OctetString)read(queue, typeof(OctetString));
 }