hobd.OBD2Sensor.SetRawValue C# (CSharp) Method

SetRawValue() public method

public SetRawValue ( byte msg ) : bool
msg byte
return bool
        public virtual bool SetRawValue(byte[] msg)
        {
            var msgraw = new List<byte>();

            // parse reply
            for(int i = 0; i < msg.Length; i++)
            {
            var a = msg[i];
            if (a == ' ' || a == '\r' || a == '\n')
                continue;
            if (i+1 >= msg.Length)
                break;
            i++;
            var b = msg[i];
            a = to_h(a);
            b = to_h(b);
            if (a > 0x10 || b > 0x10)
                continue;

            msgraw.Add((byte)((a<<4) + b));

            }

            byte[] dataraw = msgraw.ToArray();

            return this.SetValue(dataraw);
        }