예제 #1
0
        public void DelayAcquisitionCommand(int commonAddress, CauseOfTransmission cot, IeTime16 time)
        {
            var aSdu = new ASdu(TypeId.C_CD_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[] { new InformationObject(0, new[] { new InformationElement[] { time } }) });

            Send(aSdu);
        }
예제 #2
0
        public void Interrogation(int commonAddress, CauseOfTransmission cot, IeQualifierOfInterrogation qualifier)
        {
            var aSdu = new ASdu(TypeId.C_IC_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[] { new InformationObject(0, new[] { new InformationElement[] { qualifier } }) });

            Send(aSdu);
        }
예제 #3
0
        public void Send(ASdu aSdu)
        {
            acknowledgedReceiveSequenceNumber = receiveSequenceNumber;
            var requestAPdu = new APdu(sendSequenceNumber, receiveSequenceNumber, APdu.ApciType.I_FORMAT, aSdu);

            sendSequenceNumber = (sendSequenceNumber + 1) % 32768;

            if (maxTimeNoAckSentFuture != null)
            {
                maxTimeNoAckSentFuture.Cancel();
                maxTimeNoAckSentFuture = null;
            }

            if (maxTimeNoAckReceivedFuture == null)
            {
                ScheduleMaxTimeNoAckReceivedFuture();
            }

            var length = requestAPdu.Encode(buffer, settings);

            writer.Write(buffer, 0, length);
            writer.Flush();

            ResetMaxIdleTimeTimer();
        }
예제 #4
0
 public void SendASdu(ASdu asdu)
 {
     if (_connection != null)
     {
         _connection.Send(asdu);
     }
 }
예제 #5
0
        public void TestCommandWithTimeTag(int commonAddress, IeTestSequenceCounter testSequenceCounter, IeTime56 time)
        {
            var aSdu = new ASdu(TypeId.C_TS_TA_1, false, CauseOfTransmission.ACTIVATION, false, false, originatorAddress,
                                commonAddress, new[]
            {
                new InformationObject(0, new[] { new InformationElement[] { testSequenceCounter, time } })
            });

            Send(aSdu);
        }
예제 #6
0
        public void TestCommand(int commonAddress)
        {
            var aSdu = new ASdu(TypeId.C_TS_NA_1, false, CauseOfTransmission.ACTIVATION, false, false, originatorAddress,
                                commonAddress, new[]
            {
                new InformationObject(0,
                                      new[] { new InformationElement[] { new IeFixedTestBitPattern() } })
            });

            Send(aSdu);
        }
예제 #7
0
        public void SendDirectory(int commonAddress, int informationObjectAddress, InformationElement[][] directory)
        {
            var aSdu = new ASdu(TypeId.F_DR_TA_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress, new[]
            {
                new InformationObject(
                    informationObjectAddress, directory)
            });

            Send(aSdu);
        }
예제 #8
0
        public void ResetProcessCommand(int commonAddress, IeQualifierOfResetProcessCommand qualifier)
        {
            var aSdu = new ASdu(TypeId.C_RP_NA_1, false, CauseOfTransmission.ACTIVATION, false, false, originatorAddress,
                                commonAddress, new[]
            {
                new InformationObject(0,
                                      new[] { new InformationElement[] { qualifier } })
            });

            Send(aSdu);
        }
예제 #9
0
        public void SynchronizeClocks(int commonAddress, IeTime56 time)
        {
            var io = new InformationObject(0, new[] { new InformationElement[] { time } });

            InformationObject[] ios = { io };

            var aSdu = new ASdu(TypeId.C_CS_NA_1, false, CauseOfTransmission.ACTIVATION, false, false, originatorAddress,
                                commonAddress, ios);

            Send(aSdu);
        }
예제 #10
0
        public void ReadCommand(int commonAddress, int informationObjectAddress)
        {
            var aSdu = new ASdu(TypeId.C_RD_NA_1, false, CauseOfTransmission.REQUEST, false, false, originatorAddress,
                                commonAddress, new[]
            {
                new InformationObject(informationObjectAddress,
                                      new InformationElement[][] {})
            });

            Send(aSdu);
        }
예제 #11
0
        public void FileReady(int commonAddress, int informationObjectAddress, IeNameOfFile nameOfFile,
                              IeLengthOfFileOrSection lengthOfFile, IeFileReadyQualifier qualifier)
        {
            var aSdu = new ASdu(TypeId.F_FR_NA_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress, new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { nameOfFile, lengthOfFile, qualifier } })
            });

            Send(aSdu);
        }
예제 #12
0
        public void ParameterActivation(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                        IeQualifierOfParameterActivation qualifier)
        {
            var aSdu = new ASdu(TypeId.P_AC_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { qualifier } })
            });

            Send(aSdu);
        }
예제 #13
0
        public void ParameterShortFloatCommand(int commonAddress, int informationObjectAddress, IeShortFloat shortFloat,
                                               IeQualifierOfParameterOfMeasuredValues qualifier)
        {
            var aSdu = new ASdu(TypeId.P_ME_NC_1, false, CauseOfTransmission.ACTIVATION, false, false, originatorAddress,
                                commonAddress, new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { shortFloat, qualifier } })
            });

            Send(aSdu);
        }
예제 #14
0
        public void SetNormalizedValueCommand(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                              IeNormalizedValue normalizedValue, IeQualifierOfSetPointCommand qualifier)
        {
            var aSdu = new ASdu(TypeId.C_SE_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { normalizedValue, qualifier } })
            });

            Send(aSdu);
        }
예제 #15
0
        public void DoubleCommand(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                  IeDoubleCommand doubleCommand)
        {
            var aSdu = new ASdu(TypeId.C_DC_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { doubleCommand } })
            });

            Send(aSdu);
        }
예제 #16
0
        public void BitStringCommandWithTimeTag(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                                IeBinaryStateInformation binaryStateInformation, IeTime56 timeTag)
        {
            var aSdu = new ASdu(TypeId.C_BO_TA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { binaryStateInformation, timeTag } })
            });

            Send(aSdu);
        }
예제 #17
0
        public void SetShortFloatCommand(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                         IeShortFloat shortFloat, IeQualifierOfSetPointCommand qualifier)
        {
            var aSdu = new ASdu(TypeId.C_SE_NC_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { shortFloat, qualifier } })
            });

            Send(aSdu);
        }
예제 #18
0
        public void CallOrSelectFiles(int commonAddress, CauseOfTransmission cot, int informationObjectAddress,
                                      IeNameOfFile nameOfFile, IeNameOfSection nameOfSection, IeSelectAndCallQualifier qualifier)
        {
            var aSdu = new ASdu(TypeId.F_SC_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { nameOfFile, nameOfSection, qualifier } })
            });

            Send(aSdu);
        }
예제 #19
0
        public void RegulatingStepCommandWithTimeTag(int commonAddress, CauseOfTransmission cot,
                                                     int informationObjectAddress, IeRegulatingStepCommand regulatingStepCommand, IeTime56 timeTag)
        {
            var aSdu = new ASdu(TypeId.C_RC_TA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { regulatingStepCommand, timeTag } })
            });

            Send(aSdu);
        }
예제 #20
0
        public void AckFileOrSection(int commonAddress, int informationObjectAddress, IeNameOfFile nameOfFile,
                                     IeNameOfSection nameOfSection, IeAckFileOrSectionQualifier qualifier)
        {
            var aSdu = new ASdu(TypeId.F_AF_NA_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress, new[]
            {
                new InformationObject(
                    informationObjectAddress,
                    new[] { new InformationElement[] { nameOfFile, nameOfSection, qualifier } })
            });

            Send(aSdu);
        }
예제 #21
0
        public void SetScaledValueCommandWithTimeTag(int commonAddress, CauseOfTransmission cot,
                                                     int informationObjectAddress, IeScaledValue scaledValue, IeQualifierOfSetPointCommand qualifier,
                                                     IeTime56 timeTag)
        {
            var aSdu = new ASdu(TypeId.C_SE_TB_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { scaledValue, qualifier, timeTag } })
            });

            Send(aSdu);
        }
예제 #22
0
        public void LastSectionOrSegment(int commonAddress, int informationObjectAddress, IeNameOfFile nameOfFile,
                                         IeNameOfSection nameOfSection, IeLastSectionOrSegmentQualifier qualifier, IeChecksum checksum)
        {
            var aSdu = new ASdu(TypeId.F_LS_NA_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress, new[]
            {
                new InformationObject(
                    informationObjectAddress,
                    new[] { new InformationElement[] { nameOfFile, nameOfSection, qualifier, checksum } })
            });

            Send(aSdu);
        }
예제 #23
0
        public void QueryLog(int commonAddress, int informationObjectAddress, IeNameOfFile nameOfFile,
                             IeTime56 rangeStartTime, IeTime56 rangeEndTime)
        {
            var aSdu = new ASdu(TypeId.F_SC_NB_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress, new[]
            {
                new InformationObject(
                    informationObjectAddress,
                    new[] { new InformationElement[] { nameOfFile, rangeStartTime, rangeEndTime } })
            });

            Send(aSdu);
        }
예제 #24
0
        public void SendSegment(int commonAddress, int informationObjectAddress, IeNameOfFile nameOfFile,
                                IeNameOfSection nameOfSection, IeFileSegment segment)
        {
            var aSdu = new ASdu(TypeId.F_SG_NA_1, false, CauseOfTransmission.FILE_TRANSFER, false, false,
                                originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { nameOfFile, nameOfSection, segment } })
            });

            Send(aSdu);
        }
예제 #25
0
        public void SingleCommand(int commonAddress, int informationObjectAddress, IeSingleCommand singleCommand)
        {
            var cot = singleCommand.IsCommandStateOn()
                ? CauseOfTransmission.ACTIVATION
                : CauseOfTransmission.DEACTIVATION;

            var aSdu = new ASdu(TypeId.C_SC_NA_1, false, cot, false, false, originatorAddress, commonAddress,
                                new[]
            {
                new InformationObject(informationObjectAddress,
                                      new[] { new InformationElement[] { singleCommand } })
            });

            Send(aSdu);
        }
예제 #26
0
        public void SendConfirmation(ASdu aSdu)
        {
            var cot = aSdu.GetCauseOfTransmission();

            if (cot == CauseOfTransmission.ACTIVATION)
            {
                cot = CauseOfTransmission.ACTIVATION_CON;
            }
            else if (cot == CauseOfTransmission.DEACTIVATION)
            {
                cot = CauseOfTransmission.DEACTIVATION_CON;
            }

            Send(new ASdu(aSdu.GetTypeIdentification(), aSdu.IsSequenceOfElements, cot, aSdu.IsTestFrame(),
                          aSdu.IsNegativeConfirm(), aSdu.GetOriginatorAddress(), aSdu.GetCommonAddress(),
                          aSdu.GetInformationObjects()));
        }
예제 #27
0
 public void SendASdu(ASdu asdu)
 {
     _connection?.Send(asdu);
 }
예제 #28
0
 public void SendASdu(ASdu asdu)
 {
     this.Publish("send", asdu);
 }
예제 #29
0
 public void SendASdu(ASdu asdu)
 {
     _pubSubHub.Publish(this, "send", asdu);
 }