void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState) { if (NewState == Connection.CallbackConnectionState.Connected && DataStorage == null) { DataStorage = new CDODataStorageEntity(Uplink, Orchestrator); } }
void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState) { if (NewState == Connection.CallbackConnectionState.Connected && DataController == null) { DataController = new CDODataController(Uplink, Orchestrator, "ENTITYIDHERE"); } }
void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState) { if (NewState != Connection.CallbackConnectionState.Connected) { Console.WriteLine("Still not connected: {0}", NewState); return; } Console.WriteLine("Connecting to CDO"); CDOUplink = new CDOController(Uplink, new JID("cdo.sandbox.clayster.com"), null, null); }
public void OnConnectionStateChanged(Connection.CallbackConnectionState State) { if (State != Connection.CallbackConnectionState.Connected) { Console.WriteLine("Still waiting for being connected, new state: " + State.ToString()); return; } while (!SourceStarted && !Quit) { Console.WriteLine("Waiting for source to be started"); Thread.Sleep(100); } Console.WriteLine("Connected. Starting controller test"); Client = new LWTSD.DataController(Connection, new JID("[email protected]/sourcetest")); }
public void OnConnectionStateChanged(Connection.CallbackConnectionState State) { if (State != Connection.CallbackConnectionState.Connected) { Console.WriteLine("Still waiting for being connected, new state: " + State.ToString()); return; } Console.WriteLine("Connected. Starting data source test."); DataHandler = new LWTSD.DataSource(Connection, false); // Some thermometers for (int i = 0; i < 3; i++) { LWTSD.ResourceTypes.ResourceInteger Point = new LWTSD.ResourceTypes.ResourceInteger(); Point.Path = "thermometers/temp" + i.ToString(); Point.Displayname = "Temperature " + i.ToString(); Point.Description = "A temperature"; Point.Unit = "Celcius"; Point.SupportsRead = true; Point.SupportsWrite = false; Point.Value = 20 + i; Point.MinExclusive = 3; DataHandler.AddResource(Point); } // Some writables for (int i = 0; i < 3; i++) { LWTSD.ResourceTypes.ResourceInteger Point = new LWTSD.ResourceTypes.ResourceInteger(); Point.Path = "writables/item" + i.ToString(); Point.Displayname = "Writable " + i.ToString(); Point.Description = "A writable thingy"; Point.Unit = "Unknown"; Point.SupportsRead = true; Point.SupportsWrite = true; Point.Value = i + 1; Point.MinExclusive = 0; Point.MaxExclusive = 10; DataHandler.AddResource(Point); } SourceStarted = true; }