Table of Contents

Class DeviceConnectionOptions

Namespace
KasaTapoClient
Assembly
KasaTapoClient.dll

Represents transport-specific connection options.

public sealed class DeviceConnectionOptions
Inheritance
DeviceConnectionOptions
Inherited Members

Constructors

DeviceConnectionOptions(DeviceTransportKind, DeviceConnectionParameters?, bool, bool, DefaultCredentialProfile, string, bool, TimeSpan?)

Initializes a new instance of the DeviceConnectionOptions class.

public DeviceConnectionOptions(DeviceTransportKind transportKind = DeviceTransportKind.Auto, DeviceConnectionParameters? connectionParameters = null, bool useSsl = false, bool useDefaultCredentials = false, DefaultCredentialProfile defaultCredentialProfile = DefaultCredentialProfile.None, string applicationPath = "/app", bool useSecurePassthrough = true, TimeSpan? tpapKeepAliveInterval = null)

Parameters

transportKind DeviceTransportKind

The transport to use when communicating with the device.

connectionParameters DeviceConnectionParameters

The parsed protocol family and encryption metadata, when known.

useSsl bool

A value indicating whether HTTPS should be used for HTTP token transport.

useDefaultCredentials bool

A value indicating whether a known default credential profile should be used when explicit credentials are not supplied.

defaultCredentialProfile DefaultCredentialProfile

The default credential profile to use when useDefaultCredentials is enabled.

applicationPath string

The application API path for HTTP token transport.

useSecurePassthrough bool

A value indicating whether the HTTP transport should wrap device requests in the secure passthrough envelope when supported.

tpapKeepAliveInterval TimeSpan?

The optional TPAP keepalive interval. null uses the transport default, and Zero disables TPAP keepalive.

Exceptions

ArgumentException

Thrown when applicationPath is empty or whitespace.

Properties

ApplicationPath

Gets the application API path.

public string ApplicationPath { get; }

Property Value

string

ConnectionParameters

Gets the parsed connection parameters, when known.

public DeviceConnectionParameters? ConnectionParameters { get; }

Property Value

DeviceConnectionParameters

DefaultCredentialProfile

Gets the default credential profile.

public DefaultCredentialProfile DefaultCredentialProfile { get; }

Property Value

DefaultCredentialProfile

TpapKeepAliveInterval

Gets the optional TPAP keepalive interval.

public TimeSpan? TpapKeepAliveInterval { get; }

Property Value

TimeSpan?

TransportKind

Gets the transport kind.

public DeviceTransportKind TransportKind { get; }

Property Value

DeviceTransportKind

UseDefaultCredentials

Gets a value indicating whether a known default credential profile should be used.

public bool UseDefaultCredentials { get; }

Property Value

bool

UseSecurePassthrough

Gets a value indicating whether the HTTP transport should use secure passthrough wrapping when available.

public bool UseSecurePassthrough { get; }

Property Value

bool

UseSsl

Gets a value indicating whether HTTPS should be used for HTTP token transport.

public bool UseSsl { get; }

Property Value

bool