Radio.parse constructor

Radio.parse(
  1. ByteData data_
)

Implementation

factory Radio.parse(ByteData data_) {
  if (data_.lengthInBytes < Radio.mavlinkEncodedLength) {
    var len = Radio.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var rxerrors = data_.getUint16(0, Endian.little);
  var fixed = data_.getUint16(2, Endian.little);
  var rssi = data_.getUint8(4);
  var remrssi = data_.getUint8(5);
  var txbuf = data_.getUint8(6);
  var noise = data_.getUint8(7);
  var remnoise = data_.getUint8(8);

  return Radio(
      rxerrors: rxerrors,
      fixed: fixed,
      rssi: rssi,
      remrssi: remrssi,
      txbuf: txbuf,
      noise: noise,
      remnoise: remnoise);
}