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.
| Parameter | Type | Description |
|---|---|---|
api | NativeApi |
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.
| Parameter | Type | Description |
|---|---|---|
enabled | bool |
SetNetworkAddressChangedEventEnabled(bool enabled)
public extern void SetNetworkAddressChangedEventEnabled(bool enabled)
No description available.
| Parameter | Type | Description |
|---|---|---|
enabled | bool |
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)
| Parameter | Type | Description |
|---|---|---|
settings | NetworkInterfaceSettings |
SetCommunicationInterfaceSettings(NetworkCommunicationInterfaceSettings settings)
public void SetCommunicationInterfaceSettings(NetworkCommunicationInterfaceSettings settings)
Applies the underlying physical-bus settings (built-in MAC, SPI, or UART). (inherited)
| Parameter | Type | Description |
|---|---|---|
settings | NetworkCommunicationInterfaceSettings |
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.
| Parameter | Type | Description |
|---|---|---|
addressFamily | AddressFamily | |
socketType | SocketType | |
protocolType | ProtocolType |
Returns int
Close(int socket)
public extern void Close(int socket)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int |
Bind(int socket, SocketAddress address)
public extern void Bind(int socket, SocketAddress address)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
address | SocketAddress |
Listen(int socket, int backlog)
public extern void Listen(int socket, int backlog)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
backlog | int |
Accept(int socket)
public extern int Accept(int socket)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int |
Returns int
Connect(int socket, SocketAddress address)
public extern void Connect(int socket, SocketAddress address)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
address | SocketAddress |
Available(int socket)
public extern int Available(int socket)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int |
Returns int
Poll(int socket, int microSeconds, SelectMode mode)
public extern bool Poll(int socket, int microSeconds, SelectMode mode)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
microSeconds | int | |
mode | SelectMode |
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.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
buffer | byte[] | |
offset | int | |
count | int | |
flags | SocketFlags |
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.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
buffer | byte[] | |
offset | int | |
count | int | |
flags | SocketFlags |
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.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
buffer | byte[] | |
offset | int | |
count | int | |
flags | SocketFlags | |
address | SocketAddress |
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.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
buffer | byte[] | |
offset | int | |
count | int | |
flags | SocketFlags | |
address | ref SocketAddress |
Returns int
GetRemoteAddress(int socket, out SocketAddress address)
public extern void GetRemoteAddress(int socket, out SocketAddress address)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
address | out SocketAddress |
GetLocalAddress(int socket, out SocketAddress address)
public extern void GetLocalAddress(int socket, out SocketAddress address)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
address | out 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.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
optionLevel | SocketOptionLevel | |
optionName | SocketOptionName | |
optionValue | byte[] |
SetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)
public extern void SetOption(int socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte[] optionValue)
No description available.
| Parameter | Type | Description |
|---|---|---|
socket | int | |
optionLevel | SocketOptionLevel | |
optionName | SocketOptionName | |
optionValue | byte[] |
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.
| Parameter | Type | Description |
|---|---|---|
socketHandle | int | |
targetHost | string | |
caCertificate | X509Certificate | |
clientCertificate | X509Certificate | |
sslProtocols | SslProtocols | |
sslVerification | SslVerification |
Returns int
AuthenticateAsServer(int socketHandle, X509Certificate certificate, SslProtocols sslProtocols)
public extern int AuthenticateAsServer(int socketHandle, X509Certificate certificate, SslProtocols sslProtocols)
No description available.
| Parameter | Type | Description |
|---|---|---|
socketHandle | int | |
certificate | X509Certificate | |
sslProtocols | SslProtocols |
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.
| Parameter | Type | Description |
|---|---|---|
handle | int | |
buffer | byte[] | |
offset | int | |
count | int |
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.
| Parameter | Type | Description |
|---|---|---|
handle | int | |
buffer | byte[] | |
offset | int | |
count | int |
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.
| Parameter | Type | Description |
|---|---|---|
name | string | |
canonicalName | out string | |
addresses | out SocketAddress[] |
GetAccessPointClientLinkConnect(WiFiNetworkInterfaceSettings settings)
public extern bool GetAccessPointClientLinkConnect(WiFiNetworkInterfaceSettings settings)
No description available.
| Parameter | Type | Description |
|---|---|---|
settings | WiFiNetworkInterfaceSettings |
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)
| Parameter | Type | Description |
|---|---|---|
socket | int | |
how | SocketShutdown |
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)