public BluetoothPageViewModel(IBluetoothService bluetoothService, INavigationService navigationService, IUserInteraction userInteraction) { _bluetoothService = bluetoothService; _navigationService = navigationService; _userInteraction = userInteraction; SendCommand = ReactiveCommand.Create(async() => await _bluetoothService.WriteAsync("Test")); }
public Task TransmitAsync(DrinkRecipeViewModel drink) { var data = drink.ToByteArray(); if (_bluetoothService.IsConnected()) { return(_bluetoothService.WriteAsync(data, 0, 0)); } return(Task.CompletedTask); }