/// <summary> /// This method should be called before jsimple.net is used. It's normally called at app startup. It initializes /// any factory classes to use the default implementation appropriate for the current platform. /// </summary> public static void init() { if (!initialized) { HttpRequest.setFactory(new WindowsDesktopHttpRequest.WindowsDesktopHttpRequestFactory()); SocketListener.setFactory(new DotNetTcpIpSocketListener.DotNetSocketListenerFactory()); Paths.setInstance(new WindowsDesktopPaths()); StdIO.init(new DotNetStreamOutputStream(Console.OpenStandardOutput()), new DotNetStreamOutputStream(Console.OpenStandardError()), new DotNetStreamInputStream(Console.OpenStandardInput())); initialized = true; } }
public static void WriteByte(this StdIO stdio, byte data) { stdio.Write(new byte[] { data }); }
public static byte ReadByte(this StdIO stdio) { return(stdio.Read(1)[0]); }
public static UInt16 ReadUInt16(this StdIO stdio) { return(BitConverter.ToUInt16(stdio.Read(2), 0)); }
public static void WriteFloat(this StdIO stdio, float data) { stdio.Write(BitConverter.GetBytes(data)); }
public static void WriteUInt32(this StdIO stdio, UInt32 data) { stdio.Write(BitConverter.GetBytes(data)); }
public OV8865() { //_io = new Ftdi(); _io = new JtagUart(); }