Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in the speed parameter between iOS and Android #188

Open
DhavalKL opened this issue Apr 18, 2024 · 0 comments
Open

Discrepancy in the speed parameter between iOS and Android #188

DhavalKL opened this issue Apr 18, 2024 · 0 comments

Comments

@DhavalKL
Copy link

DhavalKL commented Apr 18, 2024

When the DFU is in process, it is providing the parameters avgSpeed and speed in the DFUEmitter.addListener.

i.e.

DFUEmitter.addListener(Strings.DFU_Progress, ({
      percent, avgSpeed, speed,
    }) => {
      console.log(`DFU progress avgSpeed: ${avgSpeed}`);
      console.log(`DFU progress speed: ${speed}`);
    });
  })

But the value of the avgSpeed and speed are different in the iOS and Android.
In iOS in the below method in RNNordicDfu.m it is specified that this parameter is in format of BytesPerSecond but in Android I did not found any format related information.

- (void)dfuProgressDidChangeFor:(NSInteger)part
                          outOf:(NSInteger)totalParts
                             to:(NSInteger)progress
     currentSpeedBytesPerSecond:(double)currentSpeedBytesPerSecond
         avgSpeedBytesPerSecond:(double)avgSpeedBytesPerSecond
{
  NSDictionary * evtBody = @{@"deviceAddress": self.deviceAddress,
                             @"currentPart": [NSNumber numberWithInteger:part],
                             @"partsTotal": [NSNumber numberWithInteger:totalParts],
                             @"percent": [NSNumber numberWithInteger:progress],
                             @"speed": [NSNumber numberWithDouble:currentSpeedBytesPerSecond],
                             @"avgSpeed": [NSNumber numberWithDouble:avgSpeedBytesPerSecond],};

  [self sendEventWithName:DFUProgressEvent body:evtBody];
}

Is there any way to get the same output with iOS and Android for the speed information? or can I get exactly what is the unit(format) of speed and avgSpeed?

@DhavalKL DhavalKL changed the title Discrepancy between speed parameter between iOS and Android Discrepancy in the speed parameter between iOS and Android Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant