I want to create a C# wrapper class with the functions in mcp23017.c within the WiringPi C library. I took this existing C# WiringPi WrapperClass for the other functions. I want to extend this wrapper class to use the functions for mcp23017. I tried creating a new class with one function within the wrapper:
public class mcp23017
{
[DllImport("libmcp23017.so", EntryPoint = "myPinMode")]
public static extern void myPinMode(struct wiringPiNodeStruct *node,Int32 pin, Int32 mode);
}
But I get these errors for the struct element.
) expected.
; expected.
{ expected.
} expected.
Invalid token "*" in class struct or interface member declaration
Do I have to define a struct in the wrapper class? How does it work? Not familiar with this as I am new to using C#.