Welcome! Sign in or Register to get your developer token.

Overview

Overview

iOS SDK

Installation Connecting Reading Stats Types

Android SDK

Installation Connecting Reading Stats Types

React Native

Demo App

Web API

Authenticating

Taking Readings

The test process constists of a five-phase series of callbacks that your application will handle. Call startCountdown to start the test process. For each phase, the following methods on your delegate will be called:

Countdown Screen Blow Now Screen Keep Blowing Screen Analyzing Results Screen Results Screen

Starting a BAC test walks the user through 5 steps.

The test process consists of a series of five phases. At the start of every phase your BacTrackAPIDelegate receives the following callbacks:

  1. Warming up void BACtrackCountdown(int currentCountdownCount) This callback will be called repeatedly and the currentCountdownCount parameter is an estimated number of seconds left until the next callback (BacTrackStart) is called.
  2. Begin Blowing void BACtrackStart()
  3. Keep Blowing void BACtrackBlow(float breathFractionRemaining) This callback will be called repeatedly during the time that the user is expected to blow into the BACtrack device.
  4. Analyzing void BACtrackAnalyzing() When this callback is called, the user can stop blowing.
  5. Results void BACtrackResults(float measuredBac)

API Reference

Start a BAC Test

public boolean startCountdown() Start the count-in until the user has to blow. This will result in a series of “BacTrackCountdown()” callbacks. Returns true on success.

Callback Reference

Warming Up

void BACtrackCountdown(int currentCountdownCount) The BacTrackCountdown callback informs the app of the number of seconds until the user will be requested to blow. We recommended conveying the countdown to the end user.

This method will be called multiple times.

Start Blowing

void BACtrackStart() When this is received, ask the user to start blowing.

Keep Blowing with Time Remaining

void BACtrackBlow(float blowFractionRemaining) Tell the user to continue blowing. The argument blowFractionRemaining ranges from 1.0 to 0 to inform the application of how much blow time or breath volume remains. We recommend conveying this as a percentage to the end user so that they know how much longer they have to blow.

Analyzing

void BACtrackAnalyzing() The breath sample has been captured and BACtrack is analyzing the result.

Results

void BACtrackResults(float measuredBac) Result of the blow as a BAC percentage. For example, .08 %BAC is reported simply as the value .08.

Handling Errors

void BACtrackError(int errorCode) Called when the BACtrack device encounters an error which results in the test failing. See “Types and Constants Reference” for the list of possible error codes.