menu "PLIP Voice Configuration"

    config PLIP_WIFI_SSID
        string "WiFi SSID"
        default "zacus-net"
        help
            WiFi network SSID. Credentials can also be stored in NVS
            (namespace "wifi", keys "ssid"/"pwd") — NVS takes precedence.

    config PLIP_WIFI_PASSWORD
        string "WiFi Password"
        default ""
        help
            WiFi password. Leave empty for open networks.

    config PLIP_WIFI_CHANNEL
        int "WiFi channel hint (0 = auto)"
        default 11
        range 0 13
        help
            Bias the STA scan to start on this channel. Must match the
            master ESP32's connected channel for ESP-NOW co-channel
            operation. Lab network uses channel 11.

    config PLIP_MASTER_URL
        string "Zacus Master Base URL"
        default "http://192.168.0.188"
        help
            Base URL of the Zacus master ESP32 (Freenove board). The PLIP
            reports hook transitions to <url>/voice/hook.

    config PLIP_SPEAKER_VOLUME
        int "Default Speaker Volume (0-100)"
        default 70
        range 0 100
        help
            Default speaker output volume at boot.

    config PLIP_HOOK_GPIO
        int "Off-hook GPIO number"
        default 23
        help
            GPIO that signals handset off-hook.
            SLIC SHK line is GPIO23 (A1S board KEY4, re-assigned to SLIC).
            Legacy dev kit stub used GPIO4 (BOOT button, active-LOW).

    config PLIP_HOOK_ACTIVE_HIGH
        bool "Hook GPIO active-HIGH means off-hook"
        default y
        help
            When enabled, a HIGH level on PLIP_HOOK_GPIO means the handset is
            off-hook (SLIC SHK polarity).  When disabled, LOW means off-hook
            (original dev-kit pull-up + BOOT button polarity).

    config PLIP_DIAL_PULSE
        bool "Enable rotary dial pulse decoding on SHK GPIO"
        default y
        help
            When enabled, brief open/close pulses on the hook GPIO (from a
            rotary dial) are decoded into digits and pushed to the dialer.
            Each pulse train: ~60-100 ms open + ~40 ms closed; 10 pulses = digit 0.
            A gap > PLIP_DIAL_PULSE_MAX_GAP_MS terminates the digit.

    config PLIP_DIAL_PULSE_MAX_GAP_MS
        int "Rotary pulse inter-digit gap (ms)"
        default 200
        depends on PLIP_DIAL_PULSE
        range 100 500
        help
            If the hook GPIO stays closed for more than this duration after
            a pulse train, the train is considered complete and the digit is
            emitted.  200 ms is standard for French rotary dials.


    config PLIP_GATEWAY_URL
        string "NPC Gateway Base URL"
        default "http://192.168.0.50:8401"
        help
            Base URL of the PLIP voice gateway (zacus-gateway FastAPI), as seen
            from the PLIP on the local LAN.  Override at build time or via
            sdkconfig.defaults.  The turn_client appends /v1/voice/turn.
            Example: http://192.168.0.10:8401 (IP of the Mac running the gateway).

    config PLIP_GATEWAY_TOKEN
        string "NPC Gateway Bearer Token"
        default ""
        help
            Bearer token sent as "Authorization: Bearer <token>" on every
            /v1/voice/turn request.  Leave empty to skip the header.

endmenu
