public static List<Thing> GatherThings(Transport trans) { //setup Camera thing #region Setup Camera thing { ConfigParameter conf = new ConfigParameter() { Name = "AccessUri", Value = "RasPiCamera://10.30.254.223", }; var thing = CameraThing = new Yodiwo.API.Plegma.Thing() { Type = "yodiwo.output.camera", Name = "RasPiCamera ", Config = null, UIHints = new ThingUIHints() { IconURI = "/Content/VirtualGateway/img/icon-thing-genericwebcam.png", }, }; VideoMediaDescriptor video = new VideoMediaDescriptor() { uri = "node://$NodeKey$/" + conf.Value, protocol = "http://", videoDevice = VideoIn.Node, }; thing.Ports = new List<Yodiwo.API.Plegma.Port>() { new Yodiwo.API.Plegma.Port() { ioDirection = Yodiwo.API.Plegma.ioPortDirection.Output, Name = "Camera Feed", State = video.ToJSON(HtmlEncode: false), Type = Yodiwo.API.Plegma.ePortType.String, PortKey = PortKey.BuildFromArbitraryString("$ThingKey$", "0") }, new Yodiwo.API.Plegma.Port() { ioDirection = Yodiwo.API.Plegma.ioPortDirection.Input, Name = "Camera Filter", State = "0", Type = Yodiwo.API.Plegma.ePortType.String, PortKey = PortKey.BuildFromArbitraryString("$ThingKey$", "1") } }; } #endregion Things.Add(CameraThing); return Things; }
static void Main(string[] args) { System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(Console.Out)); System.Diagnostics.Trace.AutoFlush = true; Transport transport = new Transport(); transport.Init("/usr/bin/python", "/home/pi/YodiwoDev/imageclient.py"); RaspberryNode raspberrynode = new RaspberryNode(transport); raspberrynode.Start(); while (true) { Task.Delay(500).Wait(); } }
//------------------------------------------------------------------------------------------------------------------------ public Camera(Transport transport) { this.sharppytransport = transport; this.sharppytransport.tcpimageserver.OnRasPiImagecb = OnNewFrame; }
public RaspberryNode(Transport trans) { this.pysharp = trans; }