defmodule Towerops.Snmp.Profiles.Vendors.Altalabs do
  @moduledoc """
  Alta Labs device-specific SNMP handling.

  Supports Alta Labs networking equipment (switches, routers, APs).

  Supported devices:
  - Alta Route series
  - Alta Switch series
  - Alta AP series
  """

  @behaviour Towerops.Snmp.Profiles.Vendors.Vendor

  alias Towerops.Snmp.Profiles.Vendors.Vendor

  @impl true
  def profile_names, do: ["altalabs", "altalabs-ap"]

  @impl true
  def detect_hardware(_client_opts) do
    # Hardware detection handled by YAML profile (sysDescr matching)
    nil
  end

  @impl true
  def discover_wireless_sensors(client_opts) do
    Vendor.fetch_sensors(wireless_oid_defs(), client_opts)
  end

  @impl true
  def wireless_oid_defs do
    # Alta Labs uses net-snmp base OID (8072) - limited SNMP support
    # Uses standard MIBs for most metrics
    [
      # CPU Load (1 minute average from UCD-SNMP-MIB)
      %{
        oid: "1.3.6.1.4.1.2021.10.1.3.1",
        sensor_type: "load",
        sensor_descr: "CPU Load (1m)",
        sensor_unit: "",
        sensor_divisor: 100
      },
      # Memory Used (from UCD-SNMP-MIB)
      %{
        oid: "1.3.6.1.4.1.2021.4.6.0",
        sensor_type: "load",
        sensor_descr: "Memory Used",
        sensor_unit: "KB",
        sensor_divisor: 1
      },
      # Total Memory (from UCD-SNMP-MIB)
      %{
        oid: "1.3.6.1.4.1.2021.4.5.0",
        sensor_type: "load",
        sensor_descr: "Total Memory",
        sensor_unit: "KB",
        sensor_divisor: 1
      }
    ]
  end
end
