Error in Packer documentation

The source code example at https://mbientlab.com/androiddocs/latest/data_route.html#packer contains an error that took me quite a bit of time. I only solved it after inspection of the SDK source code:

public void packData(DataProducer producer) {
    producer.addRouteAsync(new RouteBuilder() {
        @Override
        public void configure(RouteComponent source) {
            // Combine 4 data samples into 1 BLE packet
            source.limit((byte) 4).stream(new Subscriber() {

limit() is wrong! It should be pack().

Also, I did not succeed in using an **account **processor to add a timestamp, but I _did _manage to add a counter. Note that the counter will count data packets rather than individual samples.

Comments

Sign In or Register to comment.