offload_test_utils.cpp revision 2a270852b006b16d500ca11a6e30d3a1a16ba200
120a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao/* 220a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * Copyright (C) 2016, The Android Open Source Project 320a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * 420a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * Licensed under the Apache License, Version 2.0 (the "License"); 520a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * you may not use this file except in compliance with the License. 620a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * You may obtain a copy of the License at 720a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * 820a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * http://www.apache.org/licenses/LICENSE-2.0 920a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * 1020a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * Unless required by applicable law or agreed to in writing, software 1120a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * distributed under the License is distributed on an "AS IS" BASIS, 1220a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1320a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * See the License for the specific language governing permissions and 1420a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao * limitations under the License. 1520a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao */ 1620a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 1720a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao#include <vector> 1820a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 1920a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao#include "wificond/tests/offload_test_utils.h" 2020a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 2120a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Raousing android::hardware::wifi::offload::V1_0::ScanResult; 2220a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 2320a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Raonamespace android { 2420a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Raonamespace wificond { 2520a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 2620a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Raostd::vector<ScanResult> OffloadTestUtils::createOffloadScanResults() { 2720a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao std::vector<ScanResult> scanResults; 2820a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao ScanResult scanResult; 292a270852b006b16d500ca11a6e30d3a1a16ba200Sohani Rao std::vector<uint8_t> ssid(kSsid1, kSsid1 + sizeof(kSsid1)); 3020a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResult.tsf = kTsf; 3120a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResult.rssi = kRssi; 322a270852b006b16d500ca11a6e30d3a1a16ba200Sohani Rao scanResult.frequency = kFrequency1; 3320a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResult.capability = kCapability; 3420a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao memcpy(&scanResult.bssid[0], &kBssid[0], kBssidSize); 3520a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResult.networkInfo.ssid = ssid; 3620a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResult.networkInfo.flags = kNetworkFlags; 3720a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao scanResults.push_back(scanResult); 3820a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao return scanResults; 3920a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao} 4020a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao 4120a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao} // namespace wificond 4220a82c5f49ca8be325803806e62fcdb6ccc6a6fcSohani Rao} // namespace android 43