Beispiel #1
0
        /// <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;
            }
        }
Beispiel #2
0
 public static void WriteByte(this StdIO stdio, byte data)
 {
     stdio.Write(new byte[] { data });
 }
Beispiel #3
0
 public static byte ReadByte(this StdIO stdio)
 {
     return(stdio.Read(1)[0]);
 }
Beispiel #4
0
 public static UInt16 ReadUInt16(this StdIO stdio)
 {
     return(BitConverter.ToUInt16(stdio.Read(2), 0));
 }
Beispiel #5
0
 public static void WriteFloat(this StdIO stdio, float data)
 {
     stdio.Write(BitConverter.GetBytes(data));
 }
Beispiel #6
0
 public static void WriteUInt32(this StdIO stdio, UInt32 data)
 {
     stdio.Write(BitConverter.GetBytes(data));
 }
Beispiel #7
0
 public OV8865()
 {
     //_io = new Ftdi();
     _io = new JtagUart();
 }