1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef CHRE_WIFI_OFFLOAD_UTILITY_H_ 18#define CHRE_WIFI_OFFLOAD_UTILITY_H_ 19 20#include "chre/apps/wifi_offload/wifi_offload.h" 21 22#include "chre/apps/wifi_offload/error_codes.h" 23#include "chre/apps/wifi_offload/scan_config.h" 24#include "chre/apps/wifi_offload/scan_filter.h" 25#include "chre/apps/wifi_offload/scan_params.h" 26#include "chre/apps/wifi_offload/scan_result.h" 27#include "chre/apps/wifi_offload/ssid.h" 28 29namespace wifi_offload { 30namespace utility { 31 32/** 33 * Maps channel frequency to channel number based in IEEE 802.11. 34 * 35 * @param freq Frequency in MHz we want to map to a channel number 36 * 37 * @return Channel number for a given frequency, 0 for unknown frequencies 38 */ 39int Ieee80211FrequencyToChannel(int freq); 40 41void LogSsid(const uint8_t *ssid, uint8_t ssid_len); 42 43void LogBssid(const uint8_t *bssid); 44 45void LogChreScanResult(const chreWifiScanResult &result); 46 47const char *GetErrorCodeName(ErrorCode error_code); 48 49} // namespace utility 50} // namespace wifi_offload 51 52#endif // CHRE_WIFI_OFFLOAD_UTILITY_H_ 53