Hi Dojo,
Does someone has example code for taking ownership of an alarm?
Hi Jens,
I have the following code on a connector:
public static void TakeAlarmOwnership(this SLProtocol protocol, int dmaId, int alarmId, string message)
{
if (protocol == null)
{
throw new ArgumentNullException("protocol");
}
var setAlarmStateMessage = new SetAlarmStateMessage(dmaId, alarmId, 2 /*Take Owner*/, message);
protocol.SLNet.SendMessage(setAlarmStateMessage);
}
public static void ReleaseAlarmOwnership(this SLProtocol protocol, int dmaId, int alarmId)
{
if (protocol == null)
{
throw new ArgumentNullException("protocol");
}
var setAlarmStateMessage = new SetAlarmStateMessage(dmaId, alarmId, 3 /*Release Owner*/, string.Empty);
protocol.SLNet.SendMessage(setAlarmStateMessage);
}