コード例 #1
0
 private SensorPacket Parse(byte[] packet)
 {
     return(SensorPacket.Create(
                this.GetPacketTypeFrom(packet),
                this.GetTimeStampFrom(packet),
                this.GetPayloadFrom(packet)
                ));
 }
コード例 #2
0
        private void ReceiveData()
        {
            while (Running)
            {
                SensorPacket packet = Reader.ReadPacket();

                if (packet == null)
                {
                    return;
                }

                foreach (var packetHandler in PacketHandlers)
                {
                    packet.Accept(packetHandler);
                }
            }
        }