Пример #1
0
        /// <summary>Begins decrypting packets from the source.</summary>
        /// <remarks>
        /// A callback is used due to <see cref="Span"/>'s inability to work with async.
        /// </remarks>
        public async Task BeginRead(PacketReadCallback callback)
        {
            this.packetCallback = callback;
            await this.ReadSource();

            if (this.exception != null)
            {
                ExceptionDispatchInfo.Capture(this.exception).Throw();
            }
        }
Пример #2
0
 public void ConfigureIRQPin(int irqPin, int payloadSize, PacketReadCallback callback)
 {
     packetReadCallback  = callback;
     expectedPayloadSize = payloadSize;
     irqPort             = device.ConfigureDigitalInputPin(irqPin, DigitalInputPinAttributes.TriggerFalling, IrqPinTriggered);
 }