setWeight method

Future<void> setWeight(
  1. double weight
)

Set the weight of the user in kg with 1 decimal.

Implementation

Future<void> setWeight(double weight) async {
  if (_weight == null) {
    _log.warning("Weight characteristic not found on device");
    return;
  }
  ByteData data = ByteData(2);
  data.setUint16(0, (weight * 200).round(), Endian.little);
  Uint8List byteList = data.buffer.asUint8List();
  await _weight!.write(byteList);
}