From cc370ad56b50481bf399b8e19774f22277156bb8 Mon Sep 17 00:00:00 2001 From: Eveldee Date: Tue, 24 Nov 2020 16:28:54 +0100 Subject: [PATCH] Update Utils --- WaveshareUARTFingerprintSensor/Utils.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WaveshareUARTFingerprintSensor/Utils.cs b/WaveshareUARTFingerprintSensor/Utils.cs index 4a15e8a..ccfaef1 100644 --- a/WaveshareUARTFingerprintSensor/Utils.cs +++ b/WaveshareUARTFingerprintSensor/Utils.cs @@ -9,7 +9,9 @@ namespace WaveshareUARTFingerprintSensor public static class Utils { public static ushort Merge(byte high, byte low) => (ushort)(high << 8 | low); + public static uint Merge(byte first, byte second, byte third) => (uint)(first << 16 | second << 8 | third); public static (byte high, byte low) Split(ushort value) => ((byte)(value >> 8), (byte)(value & 0xFF)); + public static (byte first, byte second, byte third) Split(uint value) => ((byte)(value >> 16 & 0xFF), (byte)(value >> 8 & 0xFF), (byte)(value & 0xFF)); } }