API v3.1.0 / Logging.LogDownloadErrorHandler Usage


I found out that the log comes out from Logging.LogDownloadErrorHandler.receivedError in some cases.

and comments says 'byte[] data' is Byte array representation of the sensor data.

However, I don't know hot to interpret 'byte[] data' ( 4th parameter ).

Would you let me know how to interpret data with an example??

many thanks.


  • If that error handler is being called, then it means the API doesn't know what to do with the log data. What is the value of the errorType parameter?
    edited August 2017
    the erroType was UNKNOWN_LOG_ENTRY.

    The case was when i didn't teardown MetaWearBoard, i got Logs from Logging.LogDownloadErrorHandler.

    After teardown, i get logs from Subscriber which is nomal.

    but i'm just wondering if i get logs from Logging.LogDownloadErrorHandler how i  can interpret the sensor data.
  • Unknown log entry means the API is not expecting data from that specific log id.  Typically this happens if you are connecting to a board that was not programmed by the host Android device or the API state is not saved before closing the app.  You'll have to post your code and explain how it is used within your app as the described behavior does not match what I expect to happen.

    Logs received fro the error handler are not meant to be interpreted; they are simply there to indicate to the developer that unexpected log data is being received.  You can reconstruct the data yourself however, this is a tedious process and impractical if you are recording more than one sensor at at time.  Your best option is to determine why logs are being sent to the error handler and address those issues.
  • Thanks for the reply. 

    As you said above, I am trying to get log data from another mobile phone that didn't started logging.

    but the log data comes as unknown log entry. 

    here's questions,

    1. how can i get the log data that started by another phone. ( I found out that 'teardown' stops logging )
    2. what's the meaning of 'Saving API state' and how can I do that.

    Sorry for not posting codes, the code is too long and messy.

  • Hi again..

    and one more questions.

    is there any way to teardown except timer???
    1. The API does not natively support multiple master devices.  
    2. See the documentation:
    3. You will have to manually remove the create data routes one by one to remove everything but timers.
This discussion has been closed.