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

Time unit inconsistencies in GapScanningParams #165

Open
andresag01 opened this issue Jan 14, 2016 · 1 comment
Open

Time unit inconsistencies in GapScanningParams #165

andresag01 opened this issue Jan 14, 2016 · 1 comment

Comments

@andresag01
Copy link

GapScanningParams tries to expose the user to a comprehensible API to set different scan parameters such as scan window, scan interval, etc. The user can set the scan window and interval in terms of milliseconds, but internally these values get converted to units of 0.625 milliseconds. There are a few issues with the time units in the API:

  1. The constructor is supposed to accept scan interval and window arguments in units of milliseconds and internally it converts them. However, the default is to set the arguments to SCAN_INTERVAL_MAX and SCAN_WINDOW_MAX that already are in units of 0.625ms.
  2. The following const values are all in units of 0.625 milliseconds. This effectively makes them completely unusable since all the setter functions take arguments in milliseconds. Therefore, if you want to set the max possible interval then you need to compute setInterval(SCAN_INTERVAL_MAX * 0.625):
    • SCAN_INTERVAL_MIN
    • SCAN_INTERVAL_MAX
    • SCAN_WINDOW_MIN
    • SCAN_WINDOW_MAX
  3. Despite the majority of the API being in terms of milliseconds, the getter functions return scan window and timeout in units of 0.625ms rather than plain milliseconds.
@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-1810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants