示例#1
0
        public FstCodeChunk GetFstCodeChunk(byte?destinationUnit, byte?destinationGroup, byte?sourceUnit, byte?sourceGroup, byte fstNumber, byte offset, byte length)
        {
            if (fstNumber > 1)
            {
                throw new ArgumentOutOfRangeException();
            }

            var request  = new OpCode080Request(destinationUnit.GetValueOrDefault(DeviceAddress), destinationGroup.GetValueOrDefault(DeviceGroup), sourceUnit.GetValueOrDefault(HostAddress), sourceGroup.GetValueOrDefault(HostGroup), fstNumber == 0 ? OpCode080Function.ReadFst0Code : OpCode080Function.ReadFst1Code, offset, length);
            var response = Transport.UnicastMessage <OpCode080Response>(request);

            return(new FstCodeChunk(offset, length, new List <byte>(response.Data.ToArray())));
        }
示例#2
0
        public FstHeaderInfo GetFstHeaderInfo(byte?destinationUnit, byte?destinationGroup, byte?sourceUnit, byte?sourceGroup, byte fstNumber)
        {
            if (fstNumber > 1)
            {
                throw new ArgumentOutOfRangeException();
            }

            var request  = new OpCode080Request(destinationUnit.GetValueOrDefault(DeviceAddress), destinationGroup.GetValueOrDefault(DeviceGroup), sourceUnit.GetValueOrDefault(HostAddress), sourceGroup.GetValueOrDefault(HostGroup), fstNumber == 0 ? OpCode080Function.ReadFst0HeaderInformation : OpCode080Function.ReadFst1HeaderInformation, null, null);
            var response = Transport.UnicastMessage <OpCode080Response>(request);

            return(new FstHeaderInfo(fstNumber, response.FstVersion, response.FstDescription));
        }