Skip to main content

NativeApi Class

Namespace: GHIElectronics.TinyCLR.Native · Assembly: GHIElectronics.TinyCLR.Native

Handle to a native API surfaced by the firmware. Use Find to obtain a specific API by name, or FindAll to enumerate everything the firmware exposes.

public sealed class NativeApi

Properties

Author

public string Author { get; }

The author / vendor string the firmware attached to this API.

Name

public string Name { get; }

The native API name.

Version

public ulong Version { get; }

Version number of the native API (packed major/minor/build).

Type

public NativeApiType Type { get; }

Category of native API.

Implementation

public IntPtr Implementation { get; }

Pointer to the native implementation struct.

State

public IntPtr State { get; }

Pointer to per-API state.

Methods

GetDefaultFromCreator(NativeApiType apiType)

public static object GetDefaultFromCreator(NativeApiType apiType)

Invokes a registered default-creator for the given API type, if any.

ParameterTypeDescription
apiTypeNativeApiType

Returns object

Find(string name, NativeApiType type)

public static extern NativeApi Find(string name, NativeApiType type)

Locates a native API by name and type.

ParameterTypeDescription
namestringNative API name (e.g. one of the platform-specific constants).
typeNativeApiTypeCategory of API to find.

Returns NativeApi

GetDefaultName(NativeApiType type)

public static extern string GetDefaultName(NativeApiType type)

Returns the name of the default API for a given type.

ParameterTypeDescription
typeNativeApiType

Returns string

FindAll()

public static extern NativeApi[] FindAll()

Returns every native API the firmware exposes.

Returns NativeApi[]