mgth/LittleBigMouse · error · ArgumentOutOfRangeException
Enter a VIDAA picture-setting menu ID between 1 and 999.
Error message
Enter a VIDAA picture-setting menu ID between 1 and 999.
What it means
PictureSettingPayload serializes a set_value request for a VIDAA picture menu item. The menuId must be 1..999; otherwise ArgumentOutOfRangeException is thrown for menuId. The bound matches the protocol's menu-id space, so out-of-range values indicate a bad constant or unvalidated user input.
Solutions
- Pass a menu id between 1 and 999 (1-based) from a validated source
- Validate/normalize the id before calling PictureSettingPayload
- Check the value source (config or constant) for off-by-one or stale numbering
- Clamp/reject input in the UI layer to 1..999
Example fix
// before var payload = HisenseVidaaProtocol.PictureSettingPayload(0, 50); // throws // after if (menuId is < 1 or > 999) return; var payload = HisenseVidaaProtocol.PictureSettingPayload(menuId, 50);
Defensive patterns
Strategy: validation
Validate before calling
if (menuId is < 1 or > 999) return Result.Fail("Menu ID must be 1-999."); Try / catch
try { payload = PictureSettingPayload(menuId, value); }
catch (ArgumentOutOfRangeException ex) { ui.Show(ex.ParamName + " invalid"); } Prevention
- Validate menu ids at the config/UI boundary
- Use a typed MenuId wrapper instead of raw int
- Keep menu id tables 1-based and documented
- Reject 0/negative ids early
When it happens
Trigger: Calling PictureSettingPayload with menuId <= 0 or menuId > 999, e.g. an uninitialized 0, or a parsed value from a config that used a different numbering scheme.
Common situations: Hard-coded menu id typo; loading menu ids from an outdated table; passing an index-based (0-based) value where a 1-based menu id is required.
Related errors
- Enter a VIDAA picture-setting value between -1000 and 1000.
- Enter a valid projector IPv4 address.
- Invalid VIDAA remote key.
- Enter a volume between 0 and 100.
- A Wi-Fi MAC address is required for VIDAA authentication.
AI-assisted analysis of mgth/LittleBigMouse@7a42f01d47 (2026-09-16).
Data as JSON: /api/errors/1016d9421fbd5464.
Report an issue: GitHub.
Appendix: source
Thrown at LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/HisenseVidaa/HisenseVidaaProtocol.cs:140
};
public static string Topic(string service, string clientId, string action)
=> $"/remoteapp/tv/{service}/{clientId}/actions/{action}";
/// <summary>
/// The token exchange is asked for on a <c>data</c> topic rather than through
/// <see cref="Topic"/>'s <c>actions</c> namespace.
/// </summary>
public static string TokenRequestTopic(string clientId)
=> $"/remoteapp/tv/platform_service/{clientId}/data/gettoken";
/// <summary>An empty refresh token asks for a first pair of tokens.</summary>
public static string TokenRequestPayload() => "{\"refreshtoken\":\"\"}";
public static string PictureSettingPayload(int menuId, int value)
{
if (menuId is < 1 or > 999)
throw new ArgumentOutOfRangeException(nameof(menuId), "Enter a VIDAA picture-setting menu ID between 1 and 999.");
if (value is < -1000 or > 1000)
throw new ArgumentOutOfRangeException(nameof(value), "Enter a VIDAA picture-setting value between -1000 and 1000.");
return JsonSerializer.Serialize(new
{
action = "set_value",
menu_id = menuId,
menu_value = value,
menu_value_type = "int",
});
}
public static string PictureSettingsRequestPayload()
=> "{\"action\":\"get_menu_info\"}";
public static bool TryParsePictureSettings(
string topic,
string payload,
out IReadOnlyList<VidaaPictureSetting> settings)View on GitHub (pinned to 7a42f01d47)