public override void ParsePayload() { var payloadPos = 0; if (PayloadData?.Length >= Protocol.BLUETOOTH_ADDRESS_LEN) { BluetoothAddress = new byte[Protocol.BLUETOOTH_ADDRESS_LEN]; Buffer.BlockCopy(PayloadData, payloadPos, BluetoothAddress, 0, Protocol.BLUETOOTH_ADDRESS_LEN); payloadPos += Protocol.BLUETOOTH_ADDRESS_LEN; } if (PayloadData?.Length >= (payloadPos + 1)) { RSSI = (sbyte)PayloadData[payloadPos]; payloadPos += 1; } if (PayloadData?.Length > (payloadPos + 4)) { RSSIVariance = (float)Convert.ToDouble(PayloadData.Skip(payloadPos).Take(4).ToArray()); payloadPos += 4; } if (PayloadData?.Length >= (payloadPos + 1)) { AdCount = (byte)PayloadData[payloadPos]; payloadPos += 1; } }
public override void ParsePayload() { Status = PayloadData.Skip(1).ToArray(); }