/// <summary> /// Starts automated periodic transmission of a message /// </summary> /// <param name="PeriodicMessage">Periodic message object</param> /// <returns>Message index</returns> public int StartPeriodicMessage(PeriodicMessage PeriodicMessage) { using (HeapInt hMessageID = new HeapInt()) using (HeapMessage hPeriodicMessage = new HeapMessage(ProtocolID, PeriodicMessage)) { lock (sync) { API.CheckResult(API.PTStartPeriodicMsg(channelId, (IntPtr)hPeriodicMessage, (IntPtr)hMessageID, PeriodicMessage.Interval)); PeriodicMessage.MessageID = hMessageID.Value; periodicMsgList.Add(PeriodicMessage); } return(periodicMsgList.IndexOf(PeriodicMessage)); } }
/// <summary> /// Starts automated periodic transmission of a message using the channel protocol /// </summary> /// <param name="PeriodicMessage">Periodic message object</param> /// <returns>Message index</returns> public int StartPeriodicMessage(PeriodicMessage PeriodicMessage) { return(StartPeriodicMessage(PeriodicMessage, ProtocolID)); }