Skip to main content

NetworkControllerApiWrapper Class

Namespace: GHIElectronics.TinyCLR.Devices.Network.Provider · Assembly: GHIElectronics.TinyCLR.Devices.Network

Concrete INetworkControllerProvider backed by the native TinyCLR network HAL (lwIP + mbedTLS).

public sealed class NetworkControllerApiWrapper : INetworkControllerProvider

Constructors

NetworkControllerApiWrapper(NativeApi api)

public NetworkControllerApiWrapper(NativeApi api)

No description available.

ParameterTypeDescription
apiNativeApi

Properties

Api

public NativeApi Api { get; }

The underlying native API descriptor. (inherited)

InterfaceType

public extern NetworkInterfaceType InterfaceType { get; }

Interface type — Ethernet, WiFi, or PPP. (inherited)

CommunicationInterface

public extern NetworkCommunicationInterface CommunicationInterface { get; }

Physical bus carrying the interface — built-in MAC, SPI, or UART. (inherited)

Methods

Dispose()

public void Dispose()

Releases buffered memory (the unmanaged firmware/application buffers). (inherited)

SetNetworkLinkConnectedChangedEventEnabled(bool enabled)

public extern void SetNetworkLinkConnectedChangedEventEnabled(bool enabled)

No description available.

ParameterTypeDescription
enabledbool

SetNetworkAddressChangedEventEnabled(bool enabled)

public extern void SetNetworkAddressChangedEventEnabled(bool enabled)

No description available.

ParameterTypeDescription
enabledbool

Enable()

public extern void Enable()

Re-enables interrupts after a matching Disable. (inherited)

EnableAsync()

public extern void EnableAsync()

Non-blocking variant of Enable. Returns immediately while the slow PHY autonegotiation / WiFi firmware boot runs in a native RTOS task. The interface is NOT ready when this returns — subscribe to NetworkLinkConnectedChanged (link becomes physical-up) and NetworkAddressChanged (DHCP / static IP assigned) to learn when it is. Call at most once per controller per boot. (inherited)

Disable()

public extern void Disable()

Disables interrupts on the current core. Always pair with Enable. (inherited)

Suspend()

public extern void Suspend()

Suspends the interface (low-power state with state preserved). (inherited)

Resume()

public extern void Resume()

Resumes a previously Suspended interface. (inherited)

SetAsDefault()

public extern void SetAsDefault()

No description available.

SetInterfaceSettings(NetworkInterfaceSettings settings)

public void SetInterfaceSettings(NetworkInterfaceSettings settings)

Applies NetworkInterfaceSettings (IP address, DHCP, DNS). (inherited)

ParameterTypeDescription
settingsNetworkInterfaceSettings

SetCommunicationInterfaceSettings(NetworkCommunicationInterfaceSettings settings)

public void SetCommunicationInterfaceSettings(NetworkCommunicationInterfaceSettings settings)

Applies the underlying physical-bus settings (built-in MAC, SPI, or UART). (inherited)

ParameterTypeDescription
settingsNetworkCommunicationInterfaceSettings

GetLinkConnected()

public extern bool GetLinkConnected()

True when the physical link is currently up. (inherited)

Returns bool

GetIPProperties()

public extern NetworkIPProperties GetIPProperties()

Returns the current IP address, subnet, gateway, and DNS servers. (inherited)

Returns NetworkIPProperties

GetInterfaceProperties()

public extern NetworkInterfaceProperties GetInterfaceProperties()

Returns interface-specific properties (MAC address and friends). (inherited)

Returns NetworkInterfaceProperties

Create(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)

public extern int Create(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)

No description available.

ParameterTypeDescription
addressFamilyAddressFamily
socketTypeSocketType
protocolTypeProtocolType

Returns int

Close(int socket)

public extern void Close(int socket)

No description available.

ParameterTypeDescription
socketint

Bind(int socket, SocketAddress address)

public extern void Bind(int socket, SocketAddress address)

No description available.

ParameterTypeDescription
socketint
addressSocketAddress

Listen(int socket, int backlog)

public extern void Listen(int socket, int backlog)

No description available.

ParameterTypeDescription
socketint
backlogint

Accept(int socket)

public extern int Accept(int socket)

No description available.

ParameterTypeDescription
socketint

Returns int

Connect(int socket, SocketAddress address)

public extern void Connect(int socket, SocketAddress address)

No description available.

ParameterTypeDescription
socketint
addressSocketAddress

Available(int socket)

public extern int Available(int socket)

No description available.

ParameterTypeDescription
socketint

Returns int

Poll(int socket, int microSeconds, SelectMode mode)

public extern bool Poll(int socket, int microSeconds, SelectMode mode)

No description available.

ParameterTypeDescription
socketint
microSecondsint
modeSelectMode

Returns bool

Send(int socket, byte[] buffer, int offset, int count, SocketFlags flags)

public extern int Send(int socket, byte[] buffer, int offset, int count, SocketFlags flags)

No description available.

ParameterTypeDescription
socketint
bufferbyte[]
offsetint
countint
flagsSocketFlags

Returns int

Receive(int socket, byte[] buffer, int offset, int count, SocketFlags flags)

public extern int Receive(int socket, byte[] buffer, int offset, int count, SocketFlags flags)

No description available.

ParameterTypeDescription
socketint
bufferbyte[]
offsetint
countint
flagsSocketFlags

Returns int

SendTo(int socket, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress address)

public extern int SendTo(int socket, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress address)

No description available.

ParameterTypeDescription
socketint
bufferbyte[]
offsetint
countint
flagsSocketFlags
addressSocketAddress

Returns int

ReceiveFrom(int socket, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress address)

public extern int ReceiveFrom(int socket, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress address)

No description available.

ParameterTypeDescription
socketint
bufferbyte[]
offsetint
countint
flagsSocketFlags
addressref SocketAddress

Returns int

GetRemoteAddress(int socket, out SocketAddress address)

public extern void GetRemoteAddress(int socket, out SocketAddress address)

No description available.

ParameterTypeDescription
socketint
addressout SocketAddress

GetLocalAddress(int socket, out SocketAddress address)

public extern void GetLocalAddress(int socket, out SocketAddress address)

No description available.

ParameterTypeDescription
socketint
addressout SocketAddress

GetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)

public extern void GetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)

No description available.

ParameterTypeDescription
socketint
optionLevelSocketOptionLevel
optionNameSocketOptionName
optionValuebyte[]

SetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)

public extern void SetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)

No description available.

ParameterTypeDescription
socketint
optionLevelSocketOptionLevel
optionNameSocketOptionName
optionValuebyte[]

AuthenticateAsClient(int socketHandle, string targetHost, X509Certificate caCertificate, X509Certificate clientCertificate, SslProtocols sslProtocols, SslVerification sslVerification)

public extern int AuthenticateAsClient(int socketHandle, string targetHost, X509Certificate caCertificate, X509Certificate clientCertificate, SslProtocols sslProtocols, SslVerification sslVerification)

No description available.

ParameterTypeDescription
socketHandleint
targetHoststring
caCertificateX509Certificate
clientCertificateX509Certificate
sslProtocolsSslProtocols
sslVerificationSslVerification

Returns int

AuthenticateAsServer(int socketHandle, X509Certificate certificate, SslProtocols sslProtocols)

public extern int AuthenticateAsServer(int socketHandle, X509Certificate certificate, SslProtocols sslProtocols)

No description available.

ParameterTypeDescription
socketHandleint
certificateX509Certificate
sslProtocolsSslProtocols

Returns int

SecureRead(int handle, byte[] buffer, int offset, int count)

public extern int SecureRead(int handle, byte[] buffer, int offset, int count)

No description available.

ParameterTypeDescription
handleint
bufferbyte[]
offsetint
countint

Returns int

SecureWrite(int handle, byte[] buffer, int offset, int count)

public extern int SecureWrite(int handle, byte[] buffer, int offset, int count)

No description available.

ParameterTypeDescription
handleint
bufferbyte[]
offsetint
countint

Returns int

GetHostByName(string name, out string canonicalName, out SocketAddress[] addresses)

public extern void GetHostByName(string name, out string canonicalName, out SocketAddress[] addresses)

No description available.

ParameterTypeDescription
namestring
canonicalNameout string
addressesout SocketAddress[]

GetAccessPointClientLinkConnect(WiFiNetworkInterfaceSettings settings)

public extern bool GetAccessPointClientLinkConnect(WiFiNetworkInterfaceSettings settings)

No description available.

ParameterTypeDescription
settingsWiFiNetworkInterfaceSettings

Returns bool

Shutdown(int socket, SocketShutdown how)

public extern void Shutdown(int socket, SocketShutdown how)

Powers off until either one of the selected wake-up pins asserts or the RTC alarm fires. (inherited)

ParameterTypeDescription
socketint
howSocketShutdown

Events

NetworkLinkConnectedChanged

public event NetworkLinkConnectedChangedEventHandler NetworkLinkConnectedChanged

Raised when the physical link goes up or down. (inherited)

NetworkAddressChanged

public event NetworkAddressChangedEventHandler NetworkAddressChanged

Raised when the IP address, gateway, or DNS servers change (e.g. on DHCP lease assignment). (inherited)