Skip to content

PPG Device Info

The application can receive info related to the PPG device by implementing PPGDeviceInfoListener, and then pass it to the session builder when creating a session.

Dart
try {
    LicenseDetails licenseDetails = LicenseDetails("<ENTER_YOUR_LICENSE_KEY>");
    String deviceId = "<ENTER_POLAR_DEVICE_ID>"
    Session? session = await PolarSessionBuilder(deviceId)
        .withVitalSignsListener(this)
        .withSessionInfoListener(this)
        .withPPGDeviceInfoListener(this) 
        .build(licenseDetails);
} on HealthMonitorException catch(e) {
    print("Received Error. Domain: ${e.domain} Code: ${e.code}");
}

Upon successful initialization and connection with a PPG Device, the SDK sends a PPGDeviceInfo object containing the device type, ID, and version.

  • The info of the connected PPG Device.
Dart
  @override
  void onPPGDeviceBatteryLevel(int level) {
    // Receive battery level changes
  }

  @override
  void onPPGDeviceInfo(PPGDeviceInfo ppgDeviceInfo) {
    // ppgDeviceInfo.deviceType -       The PPGDeviceType
    // ppgDeviceInfo.deviceId -         The device's ID
    // ppgDeviceInfo.version -          The firmware version of the device
  }

The SDK also provides the initial battery level of the device upon connection, as well as any subsequent changes in the device's battery level while the session is active.

Dart
  @override
  void onPPGDeviceBatteryLevel(int level) {
    // Receive battery level changes
  }

  @override
  void onPPGDeviceInfo(PPGDeviceInfo ppgDeviceInfo) {
    // ppgDeviceInfo.deviceType -       The PPGDeviceType
    // ppgDeviceInfo.deviceId -         The device's ID
    // ppgDeviceInfo.version -          The firmware version of the device
  }