Skip to main content

Bracelet init and setup

To set up the bracelet and the Android SDK here are the main steps to implement:

  • Pair and connect to the bracelet
  • Set up the bracelet parameter
  • Set up the automatic data transfer between the Bracelet to the Android SDK database
  • Retrieve the data

Step 2: Set up the bracelet parameters

To get the right data or metrics, the bracelet needs specific settings. Prior to download the data, please follow these settings steps. Perform these commands after each reconnection of the bracelet to your app.

Set time

The bracelet needs to be initialised with the time.

If not set, the metrics will have a corrupted timestamp.

Please use the SetTimeRequest, here is an example:

bleDevice.enqueueCommand(  
request = SetTimeRequest(),
onError = { result("SetTimeRequest error: $it") },
onSuccess = { result("SetTimeRequest success: $it") }
)

Set Bracelet plan

The bracelet has different plans depending on the type of measurement intended. Data can be measure intensively with a high rate (1 seconds), or with a slower rate (10 seconds) to increase the battery life. Please set the plan to customise the use of the bracelet to your best needs.

The bracelet plan is communicated by our team, please contact them to know which plan to use.

Set Plan

Enqueue the following command

SetPlanRequest(DevicePlan.xxx)

Or use the default plan

SetPlanRequest(DevicePlan.getDefault(hardwareId)

The plan will be set accordingly:

Plan for B1: HOSPITAL for B2: HOSPITAL_MULTICOLOR

Available plans:

STAND_BY(0, 16f, "Stand by"),
MAX_BATTERY(1, 15f, "Max Battery"),
TYPICAL(2, 7.5f, "Typical"),
HOSPITAL(3, 6.5f, "High Resolution BPM"),
HZ(4, 5f, "25 Hz"), // 25 Hz
HOSPITAL_RAW(5, 3.5f, "Hospital Raw"),
RESERVED(6, 20f, "Disable"), // unused
TYPICAL_MULTICOLOR(7, 6f, "Typical multicolor"),
HOSPITAL_MULTICOLOR(8, 4f, "High Resolution Multicolor"),
CONTINUOUS_GREEN_INTERMITTENT_MULTICOLOR_RAW(9, 4f, "Continuous Green Intermittent Multicolor Raw"),
CONTINUOUS_GREEN_INTERMITTENT_MULTICOLOR(10, 5f, "Continuous Green Intermittent Multicolor")

Example

bleDevice.enqueueCommand(
request = SetPlanRequest(DevicePlan.TYPICAL),
onError = { result("SetPlanRequest error: $it") },

Set PPG2 frequency (B2 only)

For B2 bracelet, and when PPG2 is activated: plans HOSPITAL and HOSPITAL_MULTICOLOR

If desired, it is possible to specify in the SetPlanRequest the PPG2 frequency

Example, set to 128 Hz:

SetPlanRequest(DevicePlan.HOSPITAL_RAW, Ppg2Frequency.HUNDRED_TWENTY_HEIGHT_HZ, 10)

By default the PPG2 frequency is 32 Hz

List of frequencies

enum class Ppg2Frequency(val braceletValue: Int, val frequency: Int) { THIRTY_TWO_HZ(1, 32),

SIXTY_FOUR_HZ(2, 64),

HUNDRED_TWENTY_HEIGHT_HZ(3, 128),

TWO_HUNDRED_FIFTY_SIX_HZ(4, 256),

FIVE_HUNDRED_TWELVE_HZ(5, 512);

Default is 32 Hz

Full code sample in the sample app file: DataStartFragment.kt

Set Sampling rate

The sample rate is explained here

Set sample for lastest SDK version (from 0.9.13)

The sample rate of the following metrics have to be set:

  • Activity (steps, calories)
  • Temperature
  • SpO2
  • Respiration rate
  • Heart rate

The request is SetVitalParameterSamplingRateRequest Here is an example to set the Heart rate sample rate to 1 minute

SetVitalParameterSamplingRateRequest(VitalParameterWithSamplingRateType.PULSE_RATE, SampleRate.ONE_MIN)

To request the Get of the sample rate, here is the request:

GetVitalParameterSamplingRateRequest(VitalParameterWithSamplingRateType.PULSE_RATE)

Set sample for previous SDK version (before 0.9.13)

The sample rate can be customized in the SetPlanRequest

There is a third parameter called interval

The metrics will come every xxx seconds according to this interval

Example, set to 60 second:

SetPlanRequest(DevicePlan.HOSPITAL_RAW, Ppg2Frequency.HUNDRED_TWENTY_HEIGHT_HZ, 60)

Default is 10 seconds, steps come every 10 seconds for example

User Profile

Steps depends on the user height, weight, the user profile needs to be set to get the most accurate data: It is important to set the user profile: (height, weight), because this will be send to the bracelet and be used in calculations.

Weight / Height

  • Weight

Use the following commands:

SetHeightRequest(height)

SetWeightRequest(weight)

Weight in kg

Height in cm

Get commands are available as well, if necessary:

GetWeightRequest()

GetHeightRequest()

Bedtime / risetime

The sleep monitoring uses the bracelet battery, and to avoid a high consumption, the sleep is not monitored all day long. This is why it is important to set a theoretical bedtime and risetime to the bracelet. The sleep will be monitored starting 2 hours before the theoretical bedtime and 3h maximum after the rise time (sleep stop conditions below).

SET Bedtime / risetime

SetBedtimeRequest(bedtimeGmt)

SetRisetimeRequest(risetimeGmt)

These commands use the following structure

data class HourMinuteRecord(val hour: Int, val minute: Int)

⚠️ Pass the time in GMT time

Example: user in France GMT+1 7:00 risetime local time -> send to bracelet 6:00 22:30 bedtime local time -> send to bracelet 21:30

Example 2: user in Iran GMT +3:30E 7:00 risetime local time -> send to bracelet 03:30 22:30 bedtime local time -> send to bracelet 19:00

Transform to GMT time: You can use the function

val bedtimeGmt = HourMinuteRecord(22,30).transformToGmtTime()
val risetimeGmt = HourMinuteRecord(7,0).transformToGmtTime()

Full code sample in the sample app file: UserProfileFragment.kt

Get Bedtime / risetime

Get commands are available as well, if necessary:

GetBedtimeRequest()

GetRisetimeRequest()

Full code sample in the sample app file: UserProfileFragment.kt

Profile: birthdate / gender / wrist / skin tone

SET profile

The bracelet needs to be initialised with the user's profile:

  • Birthdate and gender: used mostly for the activity data (steps, workout)
  • Wrist: is mandatory for every metric
  • Skin tone: based on the Fitzpatrick scale (1 -> 6), important for every metric

Please use the UserProfileSetRecord, here is an example:

device.enqueueCommands(
SetUserProfileRequest(UserProfileSetRecord(1960, 1, 22, Gender.MALE, Wrist.LEFT, SkinType.FAIR))

GET profile

device.enqueueCommands(
GetUserProfileRequest())

Return object:

data class UserProfileGetRecord(
val age: Int,
val gender: Gender,
val wrist: Wrist,
val skinType: SkinType? = null
)

Data types

public final enum class Gender : kotlin.Enum<com.corsano.sdk.ble.data.Gender> {
MALE,
FEMALE,
UNSPECIFIED;
}
public final enum class Wrist : kotlin.Enum<com.corsano.sdk.ble.data.Wrist> {
LEFT,
RIGHT;
}
public final enum class SkinType : kotlin.Enum<com.corsano.sdk.ble.data.SkinType> {
VERY_FAIR,
FAIR,
OLIVE,
LIGHT_BROWN,
BROWN,
BLACK_BROWN;
}
  • VERY_FAIR = Fitzpatrick 1
  • FAIR = Fitzpatrick 2
  • OLIVE = Fitzpatrick 3
  • LIGHT_BROWN = Fitzpatrick 4
  • BROWN = Fitzpatrick 5
  • BLACK_BROWN = Fitzpatrick 6

Full code sample in the sample app file: UserProfileFragment.kt

Wearing optimization

Moved to its own page: Wearing Optimization.

Sleep settings

Moved to its own page: Sleep Settings.

Enable EmoGraphy & BioZ data & Accelerometer

Moved to its own page: Enable EmoGraphy, BioZ & Accelerometer.

PPG2 / BioZ / Accelerometer / ECG transfer & export

Moved to its own page: Raw File Transfer & Export.

ECG Measurement

Documented on the ECG measurement page.