pluxbiosignals / unity-sample

Unity Sample APP intended to show a practical integration of PLUX devices with the Unity environment, encompassing functionalities such as: the search of compatible Bluetooth devices and also the start/stop of a real-time acquisition.
15 stars 3 forks source link

Package data length is always zero #6

Closed jdevoldere closed 2 years ago

jdevoldere commented 4 years ago

It works in the demo project so I don't understand why it isn't working with my interface: https://pastebin.com/tjie4mRJ

I've tried doing it using int[][] pluxData = PluxDevManager.GetPackageOfData(false); instead but the first dimension is meant to be equal to the number of channels, however the length of the first dimension goes up to 10000. And each of those is empty.

GRamosPlux commented 4 years ago

Dear jdevoldere,

Thank you very much for creating this issue channel and for sharing your code! It was really helpful to understand what is happening.

We did some changes in the code in order to be functional with the features added in our last release (#5).

You can access the edited version of your script at: TestScript.cs

Regarding the particular issue that you identified, it is related with the usage of StartAcquisitionByNbrUnity(int samplingRate, int numberOfChannels, int resolution) method. Unfortunately this method is not yet totally functional, reason why I need to apologize for the undesirable experience that you faced.

We will update it in a near future, meanwhile, I would like to recommend the usage of StartAcquisitionUnity(int samplingRate, List<int> listChannels, int resolution) instead, as demonstrated on the updated version of your script.

In addition, it is advisable to define the rebootMemory input field of GetPackageOfData(int channelNbr, List<int> activeChannelsMask, bool rebootMemory) as true, to ensure that the internal buffer containing the samples acquired until the moment you invoke GetPackageOfData(...) is cleared and ready to receive new packages of data.

I truly hope that this information could be helpful, however, if it doesn't fully meet your needs or if further questions arise, please, do not hesitate to alert our team!

My best and sincere regards, GRamosPlux