GoproSetRequest.parse constructor

GoproSetRequest.parse(
  1. ByteData data_
)

Implementation

factory GoproSetRequest.parse(ByteData data_) {
  if (data_.lengthInBytes < GoproSetRequest.mavlinkEncodedLength) {
    var len = GoproSetRequest.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var targetSystem = data_.getUint8(0);
  var targetComponent = data_.getUint8(1);
  var cmdId = data_.getUint8(2);
  var value = MavlinkMessage.asUint8List(data_, 3, 4);

  return GoproSetRequest(
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      cmdId: cmdId,
      value: value);
}