FenceStatus.parse constructor

FenceStatus.parse(
  1. ByteData data_
)

Implementation

factory FenceStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < FenceStatus.mavlinkEncodedLength) {
    var len = FenceStatus.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var breachTime = data_.getUint32(0, Endian.little);
  var breachCount = data_.getUint16(4, Endian.little);
  var breachStatus = data_.getUint8(6);
  var breachType = data_.getUint8(7);
  var breachMitigation = data_.getUint8(8);

  return FenceStatus(
      breachTime: breachTime,
      breachCount: breachCount,
      breachStatus: breachStatus,
      breachType: breachType,
      breachMitigation: breachMitigation);
}