当前位置: 首页>>代码示例>>C#>>正文


C# IConnection.SendCSAFECommand方法代码示例

本文整理汇总了C#中IConnection.SendCSAFECommand方法的典型用法代码示例。如果您正苦于以下问题:C# IConnection.SendCSAFECommand方法的具体用法?C# IConnection.SendCSAFECommand怎么用?C# IConnection.SendCSAFECommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IConnection的用法示例。


在下文中一共展示了IConnection.SendCSAFECommand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MakeStrokeStream

        static IConnectableObservable<StrokeState> MakeStrokeStream(IConnection connection)
        {
            return Observable.Interval(TimeSpan.FromMilliseconds(10))
            .Select(_ =>
                {
                    var rspDataCount = m_RspReader.Capacity;

                    if (connection.SendCSAFECommand(m_100HzCommands.Buffer, m_100HzCommands.Size, m_RspReader.Buffer, ref rspDataCount))
                    {
                        // Reset the reader to the correct length
                        m_RspReader.Reset(rspDataCount);
                        m_100HzCommands.Read(m_RspReader);
                    }

                    return m_StrokeStateCommand.StrokeState;
                })
            //.Scan(Tuple.Create(StrokeState.Catch, StrokeState.Catch), (p, c) => Tuple.Create(p.Item2, c))
            //.Where(e => e.Item1 != e.Item2)
            //.Select(e => e.Item1)
            .Publish();
        }
开发者ID:b0urb4k1,项目名称:Concept2-Rower,代码行数:21,代码来源:Program.cs

示例2: Make2HzStream

        static IConnectableObservable<Tuple<uint, uint, uint, Time, uint, WorkoutState>> Make2HzStream(IConnection connection)
        {
            return Observable.Interval(TimeSpan.FromMilliseconds(10)).Select(_ =>
            {
                var rspDataCount = m_RspReader.Capacity;

                if (connection.SendCSAFECommand(m_2HzCommands.Buffer, m_2HzCommands.Size, m_RspReader.Buffer, ref rspDataCount))
                {
                    // Reset the reader to the correct length
                    m_RspReader.Reset(rspDataCount);
                    m_2HzCommands.Read(m_RspReader);
                }

                return Tuple.Create
                    (m_CadenceCommand.StrokeRate
                    , m_CaloriesCommand.Calories
                    , m_DragFactorCommand.DragFactor
                    , m_PaceCommand.Pace
                    , m_PowerCommand.Power
                    , m_WorkoutStateCommand.WorkoutState
                    );
            })
            .Publish();
        }
开发者ID:b0urb4k1,项目名称:Concept2-Rower,代码行数:24,代码来源:Program.cs

示例3: MakeEverythingStream

        static IConnectableObservable<Tuple<StrokeState, uint, Time, uint, uint, uint[]>> MakeEverythingStream(IConnection connection)
        {
            return Observable.Interval(TimeSpan.FromMilliseconds(10)).Select(_ =>
                {
                    var rspDataCount = m_RspReader.Capacity;

                    if (connection.SendCSAFECommand(everything.Buffer, everything.Size, m_RspReader.Buffer, ref rspDataCount))
                    {
                        // Reset the reader to the correct length
                        m_RspReader.Reset(rspDataCount);
                        everything.Read(m_RspReader);
                    }

                    return Tuple.Create
                        (m_StrokeStateCommand.StrokeState
                        , m_CaloriesCommand.Calories
                        , m_PaceCommand.Pace
                        , m_PowerCommand.Power
                        , m_CadenceCommand.StrokeRate
                        , m_ForcePlotDataCommand.Data
                        );
                })
                .Publish();
        }
开发者ID:b0urb4k1,项目名称:Concept2-Rower,代码行数:24,代码来源:Program.cs

示例4: Make10HzStream

        static IConnectableObservable<Tuple<Distance, Time, Distance, Time>> Make10HzStream(IConnection connection)
        {
            return Observable.Interval(TimeSpan.FromMilliseconds(10)).Select(_ =>
            {
                var rspDataCount = m_RspReader.Capacity;

                if (connection.SendCSAFECommand(m_10HzCommands.Buffer, m_10HzCommands.Size, m_RspReader.Buffer, ref rspDataCount))
                {
                    // Reset the reader to the correct length
                    m_RspReader.Reset(rspDataCount);
                    m_10HzCommands.Read(m_RspReader);
                }

                return Tuple.Create
                    ( m_DistanceCommand.Distance
                    , m_TimeCommand.Time
                    , m_WorkDistanceCommand.WorkDistance
                    , m_WorkTimeCommand.WorkTime
                    );
            })
            .Publish();
        }
开发者ID:b0urb4k1,项目名称:Concept2-Rower,代码行数:22,代码来源:Program.cs


注:本文中的IConnection.SendCSAFECommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。