.net c# homeseer homeseer 3 hs3

HomeSeer Communication Framework

One of the big changes in HS3 is its communication framework. HS3 introduced HSCF.dll, from the HS3 SDK documentation:

“Plug-in’s communicate with HomeSeer through a simple TCP connection on port 10400. A communication framework called HSCF is used for 2-way communications and the connection remains open as long as the plug-in is connected. If a connection is lost, HomeSeer will attempt to re-connect with the plug- in. The communication framework also does its best to maintain the connection. This framework was chosen over Windows WCF due to its high performance, simplicity, and better compatibility with Linux.”

Wanting to know more on the framework I stumbled upon Tinks post on the homeseer board:

“Yes, we created a framework for HS3 based upon a 3rd party product and turned it into the HSCF library that we use.
There are a lot of technical reasons why WCF would not work, reflection and uni-directionality being part of it, this framework eliminates a lot of those issues.”

Basically what we need to do to get connected to HS3 is:

using System;
using HSCF.Communication.Scs.Communication.EndPoints.Tcp;
using HSCF.Communication.ScsServices.Client;
using HomeSeerAPI;

namespace HomeSeerClientApp
{
class Program
{
static void Main()
{
ScsTcpEndPoint endpoint = new ScsTcpEndPoint ("127.0.0.1", 10400);
IScsServiceClient<IHSApplication> client = ScsServiceClientBuilder.CreateClient<IHSApplication>(endpoint);
client.Connect();

// ...

client.Disconnect();
}
}
}

Ok – that looks oddly similar to:

using System;
using Hik.Communication.Scs.Client;
using Hik.Communication.Scs.Communication.EndPoints.Tcp;
using Hik.Communication.Scs.Communication.Messages;

/* Check out full source @ https://github.com/hikalkan/scs/blob/master/samples/SimpleMessaging/ClientApp/Program.cs */

namespace ClientApp
{
class Program
{
static void Main()
{
var client = ScsClientFactory.CreateClient(new ScsTcpEndPoint("127.0.0.1", 10085));
client.Connect(); //Connect to the server

// ...

client.Disconnect(); //Close connection to server
}
}
}

So, it looks like we found the “3rd party product” Tink refers to on the homeseer board.
I couldn’t find any license delivered with the HS3 binaries, nor could I find any reference to the original product. So giving the original framework author some credit, here are some references: