本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}