//## Magnetometer async Task ReadMagnetometer() { byte[] rawData = await BLE_Utilities.ReadData(Sensor.Accelerometer); float[] vals = SensorConvert.convertAccelerometer(rawData); await this.Dispatcher.BeginInvoke((Action)(() => setMagnetometer(vals[0], vals[1], vals[2]))); }
async void NotifyMagnetometer(GattCharacteristic sender, GattValueChangedEventArgs args) { byte[] rawData = BLE_Utilities.getDataBytes(args); float[] vals = SensorConvert.convertAccelerometer(rawData); await this.Dispatcher.BeginInvoke((Action)(() => setMagnetometer(vals[0], vals[1], vals[2]))); }