Beispiel #1
0
        public void WriteParameters(byte?destinationUnit, byte?destinationGroup, byte?sourceUnit, byte?sourceGroup, List <Parameter> parameters)
        {
            bool UseOpcode167 = ParameterListIsContiguous <Parameter>(parameters);

            if (UseOpcode167)
            {
                var request  = new OpCode166Request(destinationUnit.GetValueOrDefault(DeviceAddress), destinationGroup.GetValueOrDefault(DeviceGroup), sourceUnit.GetValueOrDefault(HostAddress), sourceGroup.GetValueOrDefault(HostGroup), parameters);
                var response = Transport.UnicastMessage <OpCode166Response>(request);
            }
            else
            {
                var request  = new OpCode181Request(destinationUnit.GetValueOrDefault(DeviceAddress), destinationGroup.GetValueOrDefault(DeviceGroup), sourceUnit.GetValueOrDefault(HostAddress), sourceGroup.GetValueOrDefault(HostGroup), parameters);
                var response = Transport.UnicastMessage <OpCode181Response>(request);
            }
        }
Beispiel #2
0
 public void WriteParameter <T>(byte?destinationUnit, byte?destinationGroup, byte?sourceUnit, byte?sourceGroup, T parameter) where T : Parameter
 {
     var request  = new OpCode166Request(destinationUnit.GetValueOrDefault(DeviceAddress), destinationGroup.GetValueOrDefault(DeviceGroup), sourceUnit.GetValueOrDefault(HostAddress), sourceGroup.GetValueOrDefault(HostGroup), new List <Parameter>(new T[] { parameter }));
     var response = Transport.UnicastMessage <OpCode166Response>(request);
 }