private void SetVideoMode(ushort id, ReadOnlySpan <ushort> payload) { var mode = (VideoMode)payload[0]; var lines = payload[1]; PruManager.SetVideoMode(mode, lines); _sendStandardResponse(id); }
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))); }
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); }
private void GetFrameNumber(ushort id, ReadOnlySpan <ushort> payload) { _sendStandardResponse(id, (int)PruManager.GetFrameNumber()); }