예제 #1
0
        private void SetVideoMode(ushort id, ReadOnlySpan <ushort> payload)
        {
            var mode  = (VideoMode)payload[0];
            var lines = payload[1];

            PruManager.SetVideoMode(mode, lines);

            _sendStandardResponse(id);
        }
예제 #2
0
        private unsafe void Vsync(ushort id, ReadOnlySpan <ushort> payload)
        {
            PruManager.WaitForVsync();
            var response = new VsyncResponse
            {
                id          = id,
                frameNumber = PruManager.GetFrameNumber(), buttons = PruManager.GetButtons()
            };

            Socket.Send(new ReadOnlySpan <byte>(response.rawData, sizeof(VsyncResponse)));
        }
예제 #3
0
        public static int Main(string[] args)
        {
            PruManager.Init();

            Thread.Sleep(100);

            Console.WriteLine("Initialized");

            var listener = new Listener();

            listener.Listen();
            Console.WriteLine("Listening...");

            while (listener.State != Listener.StateEnum.None)
            {
                listener.DoMessageLoop();
            }

            FrameStreamer.Stop();

            return(0);
        }
예제 #4
0
 private void GetFrameNumber(ushort id, ReadOnlySpan <ushort> payload)
 {
     _sendStandardResponse(id, (int)PruManager.GetFrameNumber());
 }