public async Task SetCanMode(int bus, CanMode mode)
        {
            var res = await Serial.JsonCommand(CBTCommand.SetCanMode(bus, mode));

            if (!res.ContainsKey("mode") || res["mode"] != Enum.GetName(typeof(CanMode), mode))
            {
                throw new Exception("Error changing CAN mode.");
            }
        }