EscTelemetry5To8.parse constructor
EscTelemetry5To8.parse(
- ByteData data_
Implementation
factory EscTelemetry5To8.parse(ByteData data_) {
if (data_.lengthInBytes < EscTelemetry5To8.mavlinkEncodedLength) {
var len = EscTelemetry5To8.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 EscTelemetry5To8(
voltage: voltage,
current: current,
totalcurrent: totalcurrent,
rpm: rpm,
count: count,
temperature: temperature);
}