public void TestParseGattIdentifierThatRunsOverPduLength() { var bytes = HexStringToByteArray("0201060303aafe0d16aafe10e702676f6f676c65000c09526164426561636f6e204700000000000000000000000000000000000000000000000000000000"); var parser = new BeaconParser(); parser.SetAllowPduOverflow(Java.Lang.Boolean.False); parser.SetBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-20"); var beacon = parser.FromScanData(bytes, -55, null); AssertEx.Null("beacon should not be parsed", beacon); }
public void TestParseManufacturerIdentifierThatRunsOverPduLength() { // Note that the length field below is 0x16 instead of 0x1b, indicating that the packet ends // one byte before the second identifier field starts var bytes = HexStringToByteArray("02011a16ff1801beac2f234454cf6d4a0fadf2f4911ba9ffa600010002c509000000"); var parser = new BeaconParser(); parser.SetAllowPduOverflow(Java.Lang.Boolean.False); parser.SetBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"); var beacon = parser.FromScanData(bytes, -55, null); AssertEx.Null("beacon should not be parsed", beacon); }