예제 #1
0
        private bool OnTimerTick()
        {
            if (_idDictionary.Count > 0)
            {
                var idPosInfo = _idDictionary[0];

                if (_bluetoothDeviceHelper != null && _bluetoothDeviceHelper.Connected && _canvasHeight > 0 && _canvasWidth > 0)
                {
                    var percW = (100 * idPosInfo.Location.X) / _canvasWidth;
                    var percH = (100 * idPosInfo.Location.Y) / _canvasHeight;
                    var msg   = $"{(int)percW},{(int)percH},{UpDownLift.Value},{_liftVerticalPosition},{(_lightOn ? 1:0)}|";

                    _bluetoothDeviceHelper.SendMessageAsync(msg);
                }
            }
            else if (_bluetoothDeviceHelper != null && _bluetoothDeviceHelper.Connected)
            {
                _bluetoothDeviceHelper.SendMessageAsync($"50,50,{UpDownLift.Value},{_liftVerticalPosition},{(_lightOn ? 1 : 0)}|");
            }

            return(true);
        }
예제 #2
0
        private bool OnTimerTick()
        {
            var msg = $"{UpDownLeft.Value},{UpDownRight.Value}|";

            Debug.WriteLine(msg);

            if (_bluetoothDeviceHelper != null && _bluetoothDeviceHelper.Connected)
            {
                _bluetoothDeviceHelper.SendMessageAsync(msg);
            }

            return(true);
        }