EscTelemetry9To12.parse constructor
EscTelemetry9To12.parse(
- ByteData data_
Implementation
factory EscTelemetry9To12.parse(ByteData data_) {
if (data_.lengthInBytes < EscTelemetry9To12.mavlinkEncodedLength) {
var len = EscTelemetry9To12.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var voltage = MavlinkMessage.asUint16List(data_, 0, 4);
var current = MavlinkMessage.asUint16List(data_, 8, 4);
var totalcurrent = MavlinkMessage.asUint16List(data_, 16, 4);
var rpm = MavlinkMessage.asUint16List(data_, 24, 4);
var count = MavlinkMessage.asUint16List(data_, 32, 4);
var temperature = MavlinkMessage.asUint8List(data_, 40, 4);
return EscTelemetry9To12(
voltage: voltage,
current: current,
totalcurrent: totalcurrent,
rpm: rpm,
count: count,
temperature: temperature);
}