Page 2 of 2

Re: Envisalink 2DS - TPI C# Framework (first try)

Posted: Tue Nov 27, 2012 7:26 am
by martin
turnerj42 wrote:Hey Martin,
Wondering how complicated it would be to make this code send an email any time a zone is faulted? And then closed. Just wanting to set up zone follower type behaviour without loading down the eyez-on's servers so I think this program is on the right track but I am useless with this level of programming. THe running a service is quite the touch as well. Impressed!
Thanks

Thats quite easy, the ZoneHandler example included pretty much does the trick (almost).
Created a quick ZoneFollower; Get the .zip file and extract the .dll file to your plugin-directory (and remove the plugin.dll, thats for testing/demostration) and restart the service, if the mail function worked before, this one should mail you when someone opens and/or closes a section.

Note; wireless IR-detectors, goes into sleep mode when trigger to often, and will not send any events during their "sleep".

Quick look at the code; Included tamper, alarm and fault as well.

Code: Select all

public override void EventOccured(IResponse response, IReciever r)
{
	if (response.Command == ResponseCommand.ZoneOpen)
	{
		_mailSender.SendMail("Alarm - ZoneOpen", response.Date + "\r\nZone opened: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneRestored)
	{
		_mailSender.SendMail("Alarm - ZoneRestored", response.Date + "\r\nZone restored (closed): " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneAlarm)
	{
		_mailSender.SendMail("Alarm - ZoneAlarm", response.Date + "\r\nAlarm at zone: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneTamper)
	{
		_mailSender.SendMail("Alarm - ZoneTamper", response.Date + "\r\nTamper at zone: " + response.Data.Substring(1));
	}
	else if (response.Command == ResponseCommand.ZoneFault)
	{
		_mailSender.SendMail("Alarm - ZoneFault", response.Date + "\r\nFault at zone: " + response.Data.Substring(1));
	}
}

Re: Envisalink 2DS - TPI C# Framework (first try)

Posted: Sat Dec 08, 2012 5:48 pm
by tinkerfailure
Cheers Martin,

Not had chance to try it yet. I'll let you know how I get on.

Chris

Re: Envisalink 2DS - TPI C# Framework (first try)

Posted: Mon May 13, 2013 10:35 pm
by luk2009
Hi

I want to make an application in delphi for envisalink data.

I want to use the indy. I would like to know your opinions

thank you

Re: Envisalink 2DS - TPI C# Framework (first try)

Posted: Fri Mar 28, 2014 1:38 am
by kingfetty
There is an error in your SimpleDSC upload.

Common\Commands\ResponseClass.cs

GetNumberOfBytes function

Line:

Code: Select all

 var intValueAsString =  attribs.Length >= 1 ? attribs[1].CommandValue : "0";
Should be:

Code: Select all

var intValueAsString =  attribs.Length >= 1 ? attribs[0].NumBytes.ToString() : "0";

Re: Envisalink 2DS - TPI C# Framework (first try)

Posted: Fri Apr 06, 2018 8:00 pm
by EVL4user
Hi guys,

Did anybody got this code working in C#? I noticed that mistake for GetNumberOfBytes function but whenever I try to SendKeystrokeString or "arm" or "disarm" or anything else - nothing happens.
These lines of code:

var request = new TpiRequest(RequestCommand.SendKeystrokeString, "1234");
or
var request = new TpiRequest(RequestCommand.PartitionArmControl, "1234");

do nothing so I can not arm or disarm system from C# code.
Does anybody know why? (I am using EVL-4 and from web/mobile EyezOn app I can disarm or arm system, just when I run C# code I can not do anything )