本文整理汇总了C#中PacketReader.ReceiveData方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReceiveData方法的具体用法?C# PacketReader.ReceiveData怎么用?C# PacketReader.ReceiveData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReceiveData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestPacketReaderMultipleReceiveEvents
public void TestPacketReaderMultipleReceiveEvents()
{
var reader = new PacketReader();
reader.FrameReceived += FrameReceivedEvent;
var data = new byte[]
{ 0x7E,
0x00, 0x16,
0x90,
0x00, 0x13, 0xA2, 0x00, 0x40, 0x52, 0x2B, 0xAA,
0x7D, 0x84,
0x01
};
var data2 = new byte[] { 0x7E, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x00, 0xCF };
reader.ReceiveData(data);
reader.ReceiveData(data2);
Assert.That(frame, Is.Not.Null);
Assert.That(frame, Is.TypeOf<ZigBeeReceivePacket>());
}