private void UpdateSensor(double?temp) { //await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( // CoreDispatcherPriority.Normal, // () => // { // _output.Text = text; // // Feel free to add more UI stuff here! :-) // }); SensorUpdated?.Invoke(this, temp?.ToString()); }
private void TDSensorEvent(IntPtr protocol, IntPtr model, int id, int dataType, IntPtr value, int timestamp, int callbackId, IntPtr context) { string parsedProtocol = Marshal.PtrToStringAnsi(protocol); string parsedModel = Marshal.PtrToStringAnsi(model); string parsedValue = Marshal.PtrToStringAnsi(value); SensorUpdateEventArgs eventArgs = new SensorUpdateEventArgs { Value = new SensorValue { SensorID = id, Type = (SensorValueType)dataType, Value = parsedValue, Timestamp = timestamp.ToLocalDateTime() } }; SensorUpdated.Trigger(this, eventArgs); }
private void UpdateSensor(double?temp) { SensorUpdated?.Invoke(this, temp?.ToString()); }