public MavlinkV2Connection(IDataStream dataStream, Action <IPacketDecoder <IPacketV2 <IPayload> > > register)
 {
     DataStream = dataStream;
     register(_decoder);
     DataStream.SelectMany(_ => _).Subscribe(_decoder, _disposeCancel.Token);
     _decoder.Subscribe(_ => Interlocked.Increment(ref _rxPackets), _disposeCancel.Token);
     _decoder.OutError.Subscribe(_ => Interlocked.Increment(ref _skipPackets), _disposeCancel.Token);
 }
Beispiel #2
0
 public IDisposable Subscribe(IObserver <IPacketV2 <IPayload> > observer)
 {
     return(_decoder.Subscribe(observer));
 }