WifiNetworkInfo.parse constructor

WifiNetworkInfo.parse(
  1. ByteData data_
)

Implementation

factory WifiNetworkInfo.parse(ByteData data_) {
  if (data_.lengthInBytes < WifiNetworkInfo.mavlinkEncodedLength) {
    var len = WifiNetworkInfo.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var dataRate = data_.getUint16(0, Endian.little);
  var ssid = MavlinkMessage.asInt8List(data_, 2, 32);
  var channelId = data_.getUint8(34);
  var signalQuality = data_.getUint8(35);
  var security = data_.getUint8(36);

  return WifiNetworkInfo(
      dataRate: dataRate,
      ssid: ssid,
      channelId: channelId,
      signalQuality: signalQuality,
      security: security);
}