Skip to main content

BioZ and Accelerometer

Start getting BioZ data

Please follow the steps below to start getting BioZ data from the bracelet.

First set the right plan for the bracelet. Please follow the steps here: Setting the bracelet plan

To turn on the BioZ we have implemented the following command setVitalParam. The best place to call this function is after setting the plan. Please see example below:

private func setBondedState(_ bonded: Bool) {
if bonded == true {

SDKManager.instance.getSDK().peripheralApi.setPlanDirectly(.hospital_raw, frequency: .F128Hz, interval: 1)

// more arguments available in this call like
// frequency - frequency of the PPG2 file stream - only V2 bracelet
// interval - interval of getting all activity files
// Example: SDKManager.instance.getSDK().peripheralApi.setPlanDirectly(.hospital_raw, frequency: .F128Hz, interval: 1)


SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .BioZ, settingPlan: .continuous, rawBioZ: .continuous)

// see explanation below regarding the options for setVitalParam
}
}

Please find explanation of the parameters below:

public enum VitalParam: UInt8 {
case BioZ = 1
case Accelerometer = 2
}

public enum SettingPlan: UInt8 {
case disabled = 1
case bedtimeRisetime = 2
case continuous = 3
}

public enum BiozPlan: UInt8 {
case na = 0
case disabled = 1
case bedtimeRisetime = 2
case continuous = 3
}

Start getting BioZ data continuous

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .BioZ, settingPlan: .continuous, rawBioZ: .continuous)

Start getting BioZ data during bed and rise time

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .BioZ, settingPlan: .bedtimeRisetime, rawBioZ: .bedtimeRisetime)

Here you can find how to set the bed and rise time:

Settings for sleep

Stop getting BioZ data

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .BioZ, settingPlan: .disabled, rawBioZ: .disabled)

Location of the BioZ file

All the BioZ files are saved in the tmp folder on the phone. The exact location can be found in the BioZ objects in the database. The variable name is fileName. See example of the object below.

public class MetricBIOZ: Object, Uploadable {
@objc dynamic var id: String = ""
@objc dynamic var measurementUUID: String = ""
@objc dynamic var timestamp: Int = 0
@objc dynamic var recordStartTimestamp: Int = 0
@objc dynamic var date: Date = Date()
@objc dynamic var fileName: String = ""
@objc dynamic var patientId: String = ""
@objc dynamic var nrOfSyncs: Int = 0
@objc dynamic var syncedCloud: Bool = false
}

How to get the exact URL of the file

private func getURL(_ wiffPath: String) -> URL {
return URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("BIOZ/" + wiffPath)
}

// wiffPath is in this case MetricBIOZ.fileName

Start getting Accelerometer data

Please follow the steps below to start getting Accelerometer data from the bracelet.

First set the right plan for the bracelet. Please follow the steps here: Setting the bracelet plan *

To turn on the Accelerometer we have implemented the following command setVitalParam. The best place to call this function is after setting the plan. Please see example below:

private func setBondedState(_ bonded: Bool) {
if bonded == true {

SDKManager.instance.getSDK().peripheralApi.setPlanDirectly(.hospital_raw, frequency: .F128Hz, interval: 1)

// more arguments available in this call like
// frequency - frequency of the PPG2 file stream - only V2 bracelet
// interval - interval of getting all activity files
// Example: SDKManager.instance.getSDK().peripheralApi.setPlanDirectly(.hospital_raw, frequency: .F128Hz, interval: 1)


SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .Accelerometer, settingPlan: .continuous, rawBioZ: .na)

// see explanation below regarding the options for setVitalParam
}
}

Please find explanation of the parameters below:

public enum VitalParam: UInt8 {
case BioZ = 1
case Accelerometer = 2
}

public enum SettingPlan: UInt8 {
case disabled = 1
case bedtimeRisetime = 2
case continuous = 3
}

public enum BiozPlan: UInt8 {
case na = 0
case disabled = 1
case bedtimeRisetime = 2
case continuous = 3
}

Start getting Accelerometer data continuous

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .Accelerometer, settingPlan: .continuous, rawBioZ: .na)

Start getting Accelerometer data during bed and rise time

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .Accelerometer, settingPlan: .bedtimeRisetime, rawBioZ: .na)

Here you can find how to set the bed and rise time:

Settings for sleep *

Stop getting Accelerometer data

SDKManager.instance.getSDK().peripheralApi.setVitalParam(vitalParam: .Accelerometer, settingPlan: .disabled, rawBioZ: .na)

Location of the Accelerometer file

All the Accelerometer files are saved in the tmp folder on the phone. The exact location can be found in the MetricACC objects in the database. The variable name is fileName. See example of the object below.

public class MetricACC: Object, Uploadable {
@objc dynamic var id: String = ""
@objc dynamic var measurementUUID: String = ""
@objc dynamic var timestamp: Int = 0
@objc dynamic var recordStartTimestamp: Int = 0
@objc dynamic var date: Date = Date()
@objc dynamic var fileName: String = ""
@objc dynamic var patientId: String = ""
@objc dynamic var nrOfSyncs: Int = 0
@objc dynamic var syncedCloud: Bool = false
}

How to get the exact URL of the file

private func getURL(_ wiffPath: String) -> URL {
return URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("ACC/" + wiffPath)
}

// wiffPath is in this case MetricACC.fileName