Exemplo n.º 1
0
        /// <inheritdoc />
        public void SetEmgStreaming(bool enabled)
        {
            var streamEmgType = enabled
                ? StreamEmgType.Enabled
                : StreamEmgType.Disabled;

            var command = MyoCommand.Create(
                _myoErrorHandlerDriver,
                () =>
            {
                IntPtr errorHandle;
                var result = PlatformInvocation.Running32Bit
                         ? _myoDeviceBridge.StreamEmg32(_handle, streamEmgType, out errorHandle)
                         : _myoDeviceBridge.StreamEmg64(_handle, streamEmgType, out errorHandle);

                return(MyoCommandResult.Create(
                           result,
                           errorHandle));
            });

            command.Execute();
        }