Skip to content

IVapixClient

Interface in Oadm.Sdk.Vapix · Oadm.Sdk.dll

Authenticated VAPIX access to one device, with the stored login and the pinned certificate. OADM implements it; the password never reaches the plugin.

public interface IVapixClient

Guide: Devices and VAPIX

Uri BaseAddress { get; }

The device’s address with its scheme (“https://10.0.0.48/”). Requests use paths relative to it.

Task<WebSocket> ConnectWebSocketAsync(string pathAndQuery, TimeSpan keepAlive, CancellationToken ct)

Default implementation

Opens a WebSocket to the device (pathAndQuery relative to the device, e.g. /vapix/ws-data-stream?sources=events): ws for HTTP devices, wss with the pinned certificate for HTTPS devices. The login is a one-time session token (wssession.cgi) read with the stored credentials, which never reach the plugin. The socket pings the device every keepAlive and aborts when no pong comes back within the same time (devices send nothing on a quiet stream). The caller disposes the socket. Throws like IVapixClient.SendAsync (unreachable, certificate changed, timeout) and UnauthorizedAccessException when the device refuses the login. Hosts without it throw NotSupportedException.

Task<IReadOnlyList<DeviceApi>> GetApiListAsync(CancellationToken ct)

Fresh API discovery list (apidiscovery.cgi getApiList). Use with Require(...) before writing.

Task<BasicDeviceInfo> GetBasicDeviceInfoAsync(CancellationToken ct)

Reads basicdeviceinfo.cgi getAllProperties: serial number, product, AXIS OS version.

Task<IReadOnlyList<VideoSource>> GetVideoSourcesAsync(CancellationToken ct)

Default implementation

Enabled video sources (view areas, sensors, encoder channels) in camera order, never empty for a video device; the same list the live view offers (param.cgi Properties.Image and Image). Read-only. Hosts without it throw NotSupportedException.

Task<IReadOnlyDictionary<string, string>> ListParametersAsync(IEnumerable<string> groups, CancellationToken ct)

Reads parameters with param.cgi?action=list, e.g. ["Network.UPnP.FriendlyName", "HTTPS"] (a parameter or a whole group). Keys come back without the “root.” prefix; unknown groups are left out.

Task RestartAsync(CancellationToken ct)

Restarts the device (restart.cgi). Returns once the device accepted it, not when it is back.

Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken ct)

Raw escape hatch for plugins: sends a request relative to the device base address.