GoproHeartbeat.parse constructor

GoproHeartbeat.parse(
  1. ByteData data_
)

Implementation

factory GoproHeartbeat.parse(ByteData data_) {
  if (data_.lengthInBytes < GoproHeartbeat.mavlinkEncodedLength) {
    var len = GoproHeartbeat.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var status = data_.getUint8(0);
  var captureMode = data_.getUint8(1);
  var flags = data_.getUint8(2);

  return GoproHeartbeat(
      status: status, captureMode: captureMode, flags: flags);
}