Prepare for measurement

Pairing

A user needs to pair their notches to the license code they got. Currently this must be done every time after a user logged out or switched to a new device.

NOTE If an other application paired the same Notches after being paired with your application you will need to repair it again. (Otherwise you will get a notch ID has been changed error during any communication.

  1. The user turns on one Notch at a time
  2. Call the NotchService.pair(...) function of the notch service.
  3. The success callback recives a NotchDevice object, which is the database representation of the paired device.

Example

service.pair(
    success: { device in
        // Do anything with the device you would like to 
    }, failure: { error in
        // Do something in case of error
    },
    progress: { _ in },
    cancelled: { }
)

Network initialization

Before each service call that requires interaction with notches, you need to have a NotchNetwork.
For obtaining one you need to search via Bluetooth to map the turned on and paired notches.

IMPORTANT: A network only contains notches set to the same channel. See more @ channels

Calibration

We highly suggest you to calibrate the magneto sensors within 8 hours of the latest calibration to map the magnetic properties of the current place.

If a Notch sensor is close to a metal object (a watch, table with metal structure etc.) the calibration could fail.

Steps

  1. Make sure the service has a valid network.
  2. Call NotchService.configureCalibration(...) and wait for it to succeed
  3. Call NotchService.calibration(...) and wait the calibration process. During the process the user should follow the predefined calibration movements.
  4. When the calibration succeeded call NotchService.getCalibrationData(...). The parameter of the success is a bool value.
    • If it is set true the calibration finished with warning. The calibration data is valid in this case but it is possible that it you are nearby some magnet.
    • In case of false everything is good