Account Data Processor

This discussion was created from comments split from: Sensor internal timestamp and General Queries.

Comments

  • edited December 2017
    from this thread i came to know about reconstruction of timestamp, i implemented code as is here:
    https://mbientlab.com/androiddocs/latest/data_route.html#account
    don't know what i am missing here, not getting any output.
    accelerometer.configure()
    .odr(25f)
    .range(4f)
    .commit();

    accelerometer.acceleration().addRouteAsync(new RouteBuilder() {
    @Override
    public void configure(RouteComponent source) {
    source.account().stream(new Subscriber() {
    @Override
    public void apply(Data data, Object... env) {
    Log.i("MainActivity","realtime" + data.formattedTimestamp().toString());
    }
    });
    }
    }).continueWith(new Continuation<Route, Void>() {
    @Override
    public Void then(Task<Route> task) throws Exception {
    accelerometer.acceleration().start();
    accelerometer.start();
    return null;
    }
    });
    using : 'com.mbientlab:metawear:3.2.0'
  • Did the addRouteAsync task succeed?
  • edited December 2017
    Yes addRouteAsync task succeed.no output from:
    source.account().stream(new Subscriber()
  • edited December 2017
    Given that you are not getting any output, it is highly unlikely the task did in fact succeed.  Please confirm by adding error handling to the Continuation object.
  • Code is working when we don't use  account() . 
     
  • Yes the standard stream code should always work, however I am asking (again) that you check if the task failed or not.  I cannot help you further until you have checked the task's status and posted the error message if any.  As stated in my previous post, the task does appear to be failing and your code is simply ignoring the failure..
  • You are right, my code is not able to catch any error or exception.
    addRouteAsync task was not succeed, i put the code under try and catch, did not get any error or data.
  • edited December 2017
    Follow the example code in the Bolts documentation:
  • Thanks Eric,
    My issue was resolved, by updating the firmware.
This discussion has been closed.