Duplicate logger issue
Hello,
I am trying to build Windows Forms application on Windows 10. I use MetaWear CPRO device with 1.2.5 firmware.
I have done pairing, connecting, renaming, streaming data successfully. I am trying to test logging but I am encountering a strange problem that I haven't able found a solution. The problem is that when I register for acc signal log, the API calls logger ready callback once but when I use mbl_mw_logger_lookup_id function I see id 0 and id 1 are filled with same logger.
When I download log, I get half of the log what receivedProgressUpdate function tells. I don't get receivedUnknownEntry callback either.
Relevant code is below:
loggerDelegate = new Fn_IntPtr(logger =>
{
if (logger != IntPtr.Zero)
{
// below variables are equal to logger value above
var logger0 = mbl_mw_logger_lookup_id(board, 0);
var logger1 = mbl_mw_logger_lookup_id(board, 1);
mbl_mw_logger_subscribe(logger, dataPtr =>
{
Data data = Marshal.PtrToStructure<Data>(dataPtr);
var cf = Marshal.PtrToStructure<CartesianFloat>(data.value);
// ...
});
}
else
{
Console.WriteLine("Failed to create the logger\n");
}
});
var acc_signal = mbl_mw_acc_get_acceleration_data_signal(board);
mbl_mw_datasignal_log(acc_signal, loggerDelegate);
mbl_mw_logging_start(board, 0);
mbl_mw_acc_enable_acceleration_sampling(board);
mbl_mw_acc_start(board);
This discussion has been closed.
Comments