Search code examples
c#sensorssensor-fusion

Non-Invocable member in UserApplicationBoard.dll for BNO055 usb-stick


I'm trying to connect a BNO055 USB_STICK to my pc using C# code. Searching and searching, finally, I found out a Bosch manual that talks about GENERIC API. Great. So, I added the UserApplicationBoard.dll to my Visual Studio project and I tried to read/write to my IMU sensor. Sadly, It doesn't work in C#. Reading the manual I can use these API in IronPython and also in MatLab (I tested it in IronPython and it works fine) but when I try to call a method from this .dll in C# I have this error:

Non-invocable member UserApplicationBoard cannot be used like a method 

While in IronPython everything works fine, I can read/write every registry. Below there is my simple code:

using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BST; //DLL FOR GENERIC API FROM BOSCH


namespace BNO055UsbStick
{
    class Program
    {

        static void Main(string[] args)
        {
            Console.WriteLine("Start BNO055 BST API");
            BST.UserApplicationBoard board = BST.UserApplicationBoard();

        }
    }
}

Does anyone know how to fix this?


Solution

  • You have to create the instance before you can use it. Like Selvin said you need a new, like below:

     BST.UserApplicationBoard board = new BST.UserApplicationBoard();