setAgeFloat method

Future<void> setAgeFloat(
  1. double ageFloat
)

Set the age of the user in years. Uses double format (e.g. 23.1 or 56.4 years old).

Implementation

Future<void> setAgeFloat(double ageFloat) async {
  if (_ageFloat == null) {
    _log.warning("Age Float characteristic not found on device");
    return;
  }
  ByteData data = ByteData(4);
  data.setFloat32(0, ageFloat, Endian.little);
  Uint8List byteList = data.buffer.asUint8List();
  await _ageFloat!.write(byteList);
}