コード例 #1
0
        public BluetoothPageViewModel(IBluetoothService bluetoothService, INavigationService navigationService, IUserInteraction userInteraction)
        {
            _bluetoothService  = bluetoothService;
            _navigationService = navigationService;
            _userInteraction   = userInteraction;

            SendCommand = ReactiveCommand.Create(async() => await _bluetoothService.WriteAsync("Test"));
        }
コード例 #2
0
        public Task TransmitAsync(DrinkRecipeViewModel drink)
        {
            var data = drink.ToByteArray();

            if (_bluetoothService.IsConnected())
            {
                return(_bluetoothService.WriteAsync(data, 0, 0));
            }

            return(Task.CompletedTask);
        }