Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 208e46bb authored by Roshan Pius's avatar Roshan Pius
Browse files

wifi(implementation): Use strlen for size of ssid

Looks like the legacy hal uses a null termination for indicating the
size of ssid.

While there,
Use the helper function to convert wifi band from hidl to legacy.

Bug: 35765841
Test: Integration tests pass now.
Change-Id: Ie480f9d6735a21c5ccedfc68bfde5f0d920dcdc9
parent 77c3822d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ bool convertHidlGscanParamsToLegacy(
        legacy_scan_params->buckets[bucket_idx];
    legacy_bucket_spec.bucket = bucket_idx;
    legacy_bucket_spec.band =
        static_cast<legacy_hal::wifi_band>(hidl_bucket_spec.band);
        convertHidlWifiBandToLegacy(hidl_bucket_spec.band);
    legacy_bucket_spec.period = hidl_bucket_spec.periodInMs;
    legacy_bucket_spec.max_period = hidl_bucket_spec.exponentialMaxPeriodInMs;
    legacy_bucket_spec.base = hidl_bucket_spec.exponentialBase;
@@ -429,7 +429,7 @@ bool convertLegacyGscanResultToHidl(
  hidl_scan_result->timeStampInUs = legacy_scan_result.ts;
  hidl_scan_result->ssid = std::vector<uint8_t>(
      legacy_scan_result.ssid,
      legacy_scan_result.ssid + sizeof(legacy_scan_result.ssid));
      legacy_scan_result.ssid + strlen(legacy_scan_result.ssid));
  memcpy(hidl_scan_result->bssid.data(),
         legacy_scan_result.bssid,
         hidl_scan_result->bssid.size());