protected async Task SendEyeTrackerMessage() { if (Callback == null) { return; } while (!_keepAliveFaulted) { if (NextGazeMessage != null) { await Callback.SendTrackerMessage(NextGazeMessage.CreateBinaryMessage()); NextGazeMessage = null; } if (NextUserPresenceMessage != null) { await Callback.SendTrackerMessage(NextUserPresenceMessage.CreateBinaryMessage()); NextUserPresenceMessage = null; } await Task.Delay(20); } Dispose(); }
private void presenceObserverChange(object sender, EngineStateValue <UserPresence> e) { if (e.IsValid) { NextUserPresenceMessage = new UserPresenceMessage(e.Value == UserPresence.Present); } //Console.WriteLine($"Presence observer value: {e.Value} (Valid: {e.IsValid})"); }