RK3399支持5G

您所在的位置:网站首页 mumu模拟器怎么玩苹果的游戏 RK3399支持5G

RK3399支持5G

2024-04-03 07:34| 来源: 网络整理| 查看: 265

背景 Platform: RK3399 OS: Android7.1.2 Kernel: v4.4.103

以前用AP6356s模块,设置WIFI热点的时候有5G频段选项后面发现没有了,在调试AP6256的时候也发现没有,但他们都是支持5G的。

解决

最原始的版本是通过判断mWifiManager.isDualBandSupported()和countryCode,来确定是否添加5G频段的选项

mWifiManager.isDualBandSupported(),通过以下配置读取frameworks/base/core/res/res/values/config.xml:true frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiServiceImpl.java:public boolean isDualBandSupported() { //TODO: Should move towards adding a driver API that checks at runtime return mContext.getResources().getBoolean( com.android.internal.R.bool.config_wifi_dual_band_support); } countryCode通过mWifiManager.getCountryCode();函数获取而国家代码是根据phoneNumber去set的,但我们没用SIM为什么要有国家代码判断呢?在我们中国国内5G信道只允许使用149以上的信道,因此没设置国家是无法使用5G热点的

packages/apps/Settings/src/com/android/settings/wifi/WifiApDialog.javaonCreate中是通过checkIfSupportDualBand函数去判断是否添加5G频段的选项checkIfSupportDualBand函数会去根据chip_type判断是否支持5G,所以需要在该判断中添加我们需要的wifi_chip_type

public boolean checkIfSupportDualBand() { /*zdd*/ File file = new File(/*"/sys/firmware/devicetree/base/wireless-wlan/wifi_chip_type"*/"/data/wifi_chip"); //根据chip_id获取的WiFi名,以前是根据wireless-wlan的DTS节点指定的wifi_chip_type BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); String tempString = null; while ((tempString = reader.readLine()) != null) { Log.d(TAG, "Get wifi chip name: " + tempString); if (tempString.contains("ap6234") || tempString.contains("ap6330") || tempString.contains("ap6335") || tempString.contains("ap6354") || tempString.contains("ap6441") || tempString.contains("ap6356s") || tempString.contains("rtl8822bs") || tempString.contains("rtl8822bu") || tempString.contains("AP6256")) { reader.close(); return true; } } reader.close(); } catch (IOException e) { e.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException e1) {} } } return false; }

/hardware/libhardware_legacy/wifi/wifi.csave_wifi_chip_type函数保存chip_type到/data/wifi_chip文件,例如我现在用的是AP6256

frameworks/opt/net/wifi/service/java/com/android/server/wifi/util/ApConfigUtil.java

参考

https://blog.csdn.net/Mrdeath/article/details/105228294



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3