AccessViolationException error when retrying InitializeAsync() method
Hi,
I am currently making console application which I later want to use in Unity3d. I am using the .NetStandard libraries for this.
Sometimes I get the error System.AccessViolationException when retrying the InitializeAsync() method. I have already tried setting the TimeForResponse to 1000 but the error still came back albeit only once in 10 or so tries.
Any help would be appreciated!
This discussion has been closed.
Comments
What's your retry
InitializeAsync
code?Can't use await because this is within a class constructor.
You should restructure your code so the constructor isn't calling
InitializeAsync
.Do you see the same error if you use async/await, such as in the example code?
https://github.com/mbientlab/MetaWear-SDK-CSharp-Plugin-NetStandard#usage
This helps with the errors in the console app but when I try to use await the InitializeAsync() in Unity it never returns to the main thread. This causes Unity to just freeze and eventually crash.
What BLE library are you using?
The Warble.NetStandard one from the MbientLab repositories.
https://github.com/mbientlab/Warble.NET/tree/master/Warble.NetStandard
Sounds like the same issue discussed in this thread:
https://mbientlab.com/community/discussion/2601/unity-works-perfectly-with-metawear-sensor-on-first-run-hangs-on-2nd-run#latest
Hi Guys,
You could be insterested by these projects:
https://github.com/ebadier/MetaWearRPCServer
https://github.com/ebadier/MetaWearUnityRPC
Best,