Android 使用cmd wifi命令操作wifi

cmd wifi 命令完整的说明说下。

console:/ # cmd wifi                                                       
Wi-Fi (wifi) commands:help or -hPrint this help text.get-country-codeGets country code as a two-letter stringset-wifi-enabled enabled|disabledEnables/disables Wifi on this device.set-scan-always-available enabled|disabledSets whether scanning should be available even when wifi is off.list-scan-resultsLists the latest scan resultsstart-scanStart a new scanlist-networksLists the saved networksforget-network <networkId>Remove the network mentioned by <networkId>- Use list-networks to retrieve <networkId> for the networkstatusCurrent wifi statusset-verbose-logging enabled|disabled Set the verbose logging enabled or disabledis-verbose-loggingCheck whether verbose logging enabled or disabledstart-restricting-auto-join-to-subscription-id subIdtemporarily disable all wifi networks except merged carrier networks with the given subIdstop-restricting-auto-join-to-subscription-idUndo the effects of start-restricting-auto-join-to-subscription-idadd-suggestion <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-u] [-o] [-p] [-m]  [-s] [-d] [-b <bssid>] [-e] [-i] [-a <carrierId>] [-c <subscriptionId>]Add a network suggestion with provided paramsUse 'network-suggestions-set-user-approved com.android.shell yes' to approve suggestions added via shell (Needs root access)<ssid> - SSID of the networkopen|owe|wpa2|wpa3 - Security type of the network.- Use 'open' or 'owe' for networks with no passphrase- 'open' - Open networks (Most prevalent)- 'owe' - Enhanced open networks- Use 'wpa2' or 'wpa3' for networks with passphrase- 'wpa2' - WPA-2 PSK networks (Most prevalent)- 'wpa3' - WPA-3 PSK networks-u - Mark the suggestion untrusted.-o - Mark the suggestion oem paid.-p - Mark the suggestion oem private.-m - Mark the suggestion metered.-h - Mark the network hidden.-s - Share the suggestion with user.-d - Mark the suggestion autojoin disabled.-b <bssid> - Set specific BSSID.-r - Enable non_persistent randomization (disabled by default)-a - Mark the suggestion carrier merged-c <carrierId> - set carrier Id-i <subscriptionId> - set subscription Id, if -a is used, this must be setremove-suggestion <ssid> [-l]Remove a network suggestion with provided SSID of the network-l - Remove suggestion with lingering, if not set will disconnect immediately remove-all-suggestionsRemoves all suggestions added via shelllist-suggestionsLists the suggested networks added via shellset-coex-cell-channels [lte|nr <bandNumber 1-261> <downlinkFreqKhz or UNKNOWN: -1> <downlinkBandwidthKhz or UNKNOWN: 0> <uplinkFreqKhz or UNKNOWN: -1> <uplinkBandwidthKhz or UNKNOWN: 0>] ...Sets a list of zero or more cell channels to use for coex calculations. Actual device reported cell channels will be ignored until reset-coex-cell-channels is called.reset-coex-cell-channelsRemoves all cell channels set in set-coex-cell-channels and returns to listening on actual device reported cell channelsget-coex-cell-channelsPrints the cell channels being used for coex.set-connected-score <score>Set connected wifi network score (to choose between LTE & Wifi for default route).This turns off the active connected scorer (default or external).Only works while connected to a wifi network. This score will stay in effect until you call reset-connected-score or the device disconnects from the current network.<score> - Integer score should be in the range of 0 - 60reset-connected-scoreTurns on the default connected scorer.Note: Will clear any external scorer set.start-softap <ssid> (open|wpa2|wpa3|wpa3_transition|owe|owe_transition) <passphrase> [-b 2|5|6|any|bridged]Start softap with provided paramsNote that the shell command doesn't activate internet tethering. In some devices, internet sharing is possible when Wi-Fi STA is also enabled and isassociated to another AP with internet access.<ssid> - SSID of the networkopen|wpa2|wpa3|wpa3_transition|owe|owe_transition - Security type of the network.- Use 'open', 'owe', 'owe_transition' for networks with no passphrase- Use 'wpa2', 'wpa3', 'wpa3_transition' for networks with passphrase-b 2|5|6|any|bridged - select the preferred band.- Use '2' to select 2.4GHz band as the preferred band- Use '5' to select 5GHz band as the preferred band- Use '6' to select 6GHz band as the preferred band- Use 'any' to indicate no band preference- Use 'bridged' to indicate bridged AP which enables APs on both 2.4G + 5GNote: If the band option is not provided, 2.4GHz is the preferred band.The exact channel is auto-selected by FW unless overridden by force-softap-channel command-x - Specifies the SSID as hex digits instead of plain text (T and above)stop-softapStop softap (hotspot)pmksa-flush <networkId>- Flush the local PMKSA cache associated with the network id. Use list-networks to retrieve <networkId> for the networkreload-resourcesReset the WiFi resources cache which will cause them to be reloaded next time they are accessed. Necessary if overlays are manually modified.launch-dialog-simple [-t <title>] [-m <message>] [-l <url> <url_start> <url_end>] [-y <positive_button_text>] [-n <negative_button_text>] [-x <neutral_button_text>] [-c <timeout_millis>]Launches a simple dialog and waits up to 15 seconds to print the response.-t - Title-m - Message-l - URL of the message, with the start and end index inside the message-y - Positive Button Text-n - Negative Button Text-x - Neutral Button Text-c - Optional timeout in millisecondslaunch-dialog-p2p-invitation-sent <device_name> <pin> [-i <display_id>]Launches a P2P Invitation Sent dialog.<device_name> - Name of the device the invitation was sent to<pin> - PIN for the invited device to inputlaunch-dialog-p2p-invitation-received <device_name> [-p] [-d <pin>] [-i <display_id>] [-c <timeout_millis>]Launches a P2P Invitation Received dialog and waits up to 15 seconds to print the response.<device_name> - Name of the device sending the invitation-p - Show PIN input-d - Display PIN <pin>-i - Display ID-c - Optional timeout in millisecondsquery-interface <uid> <package_name> STA|AP|AWARE|DIRECT [-new]Query whether the specified could be created for the specified UID and package name, and if so - what other interfaces would be destroyed-new - query for a new interfaces (otherwise an existing interface is okinterface-priority-interactive-mode enable|disable|defaultEnable or disable asking the user when there's an interface priority conflict, |default| implies using the device default behavior.set-one-shot-screen-on-delay-ms <delayMs>set the delay for the next screen-on connectivity scan in milliseconds.set-ipreach-disconnect enabled|disabledSets whether CMD_IP_REACHABILITY_LOST events should trigger disconnects.get-ipreach-disconnectGets setting of CMD_IP_REACHABILITY_LOST events triggering disconnects.connect-network <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-x] [-m] [-d] [-b <bssid>] [-r auto|none|persistent|non_persistent]Connect to a network with provided params and add to saved networks list<ssid> - SSID of the networkopen|owe|wpa2|wpa3 - Security type of the network.- Use 'open' or 'owe' for networks with no passphrase- 'open' - Open networks (Most prevalent)- 'owe' - Enhanced open networks- Use 'wpa2' or 'wpa3' for networks with passphrase- 'wpa2' - WPA-2 PSK networks (Most prevalent)- 'wpa3' - WPA-3 PSK networks-x - Specifies the SSID as hex digits instead of plain text-m - Mark the network metered.-d - Mark the network autojoin disabled.-h - Mark the network hidden.-p - Mark the network private (not shared).-b <bssid> - Set specific BSSID.-r auto|none|persistent|non_persistent - MAC randomization scheme for the networkadd-network <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-x] [-m] [-d] [-b <bssid>] [-r auto|none|persistent|non_persistent]Add/update saved network with provided params<ssid> - SSID of the networkopen|owe|wpa2|wpa3 - Security type of the network.- Use 'open' or 'owe' for networks with no passphrase- 'open' - Open networks (Most prevalent)- 'owe' - Enhanced open networks- Use 'wpa2' or 'wpa3' for networks with passphrase- 'wpa2' - WPA-2 PSK networks (Most prevalent)- 'wpa3' - WPA-3 PSK networks-x - Specifies the SSID as hex digits instead of plain text-m - Mark the network metered.-d - Mark the network autojoin disabled.-h - Mark the network hidden.-p - Mark the network private (not shared).-b <bssid> - Set specific BSSID.-r auto|none|persistent|non_persistent - MAC randomization scheme for the networkset-poll-rssi-interval-msecs <int>Sets the interval between RSSI polls to <int> milliseconds.get-poll-rssi-interval-msecsGets current interval between RSSI polls, in milliseconds.force-hi-perf-mode enabled|disabledSets whether hi-perf mode is forced or left for normal operation.force-low-latency-mode enabled|disabledSets whether low latency mode is forced or left for normal operation.network-suggestions-set-user-approved <package name> yes|noSets whether network suggestions from the app is approved or not.network-suggestions-has-user-approved <package name>Queries whether network suggestions from the app is approved or not.imsi-protection-exemption-set-user-approved-for-carrier <carrier id> yes|noSets whether Imsi protection exemption for carrier is approved or notimsi-protection-exemption-has-user-approved-for-carrier <carrier id>Queries whether Imsi protection exemption for carrier is approved or notimsi-protection-exemption-clear-user-approved-for-carrier <carrier id>Clear the user choice on Imsi protection exemption for carriernetwork-requests-remove-user-approved-access-points <package name>Removes all user approved network requests for the app.clear-user-disabled-networksClears the user disabled networks list.send-link-probeManually triggers a link probe.force-softap-band enabled <int> | disabledForces soft AP band to 2|5|6force-softap-channel enabled <int> | disabledSets whether soft AP channel is forced to <int> MHzor left for normal   operation.force-country-code enabled <two-letter code> | disabled Sets country code to <two-letter code> or left for normal valueor '00' for forcing to world mode country codeset-wifi-watchdog enabled|disabledSets whether wifi watchdog should trigger recoveryget-wifi-watchdogGets setting of wifi watchdog trigger recovery.get-softap-supported-featuresGets softap supported features. Will print 'wifi_softap_acs_supported'and/or 'wifi_softap_wpa3_sae_supported',and/or 'wifi_softap_bridged_ap_supported',and/or 'wifi_softap_bridged_ap_with_sta_supported',each on a separate line.settings-resetInitiates wifi settings resetadd-request [-g] [-i] [-n] [-s] <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-b <bssid>] [-d <band=2|5|6|60>]Add a network request with provided paramsUse 'network-requests-set-user-approved android yes' to pre-approve requests added via rooted shell (Not persisted)-g - Marks the following SSID as a glob pattern<ssid> - SSID of the network, or glob pattern if -g is presentopen|owe|wpa2|wpa3 - Security type of the network.- Use 'open' or 'owe' for networks with no passphrase- 'open' - Open networks (Most prevalent)- 'owe' - Enhanced open networks- Use 'wpa2' or 'wpa3' for networks with passphrase- 'wpa2' - WPA-2 PSK networks (Most prevalent)- 'wpa3' - WPA-3 PSK networks-b <bssid> - Set specific BSSID.-i Set internet capability.-d Specify the band of access point: 2, 5, 6, or 60-s No SSID provided, to be chosen by network selection.-n - Prevent auto-selection of BSSID and force it to be null so that the request matches all BSSIDs.remove-request <ssid>Remove a network request with provided SSID of the networkremove-all-requestsRemoves all active requests added via shelllist-requestsLists the requested networks added via shellnetwork-requests-set-user-approved <package name> yes|noSets whether network requests from the app is approved or not.Note: Only 1 such app can be approved from the shell at a timenetwork-requests-has-user-approved <package name>Queries whether network requests from the app is approved or not.Note: This only returns whether the app was set via the 'network-requests-set-user-approved' shell commandlist-all-suggestionsLists all suggested networks on this devicelist-suggestions-from-app <package name>Lists the suggested networks from the appset-emergency-callback-mode enabled|disabledSets whether Emergency Callback Mode (ECBM) is enabled.Equivalent to receiving the TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED broadcast.set-emergency-call-state enabled|disabledSets whether we are in the middle of an emergency call.
Equivalent to receiving the TelephonyManager.ACTION_EMERGENCY_CALL_STATE_CHANGED broadcast.network-suggestions-set-as-carrier-provider <packageName> yes|noSet the <packageName> work as carrier provider or not.is-network-suggestions-set-as-carrier-provider <packageName>Queries whether the <packageName> is working as carrier provider or not.remove-app-from-suggestion_database <packageName>Remove <packageName> from the suggestion database, all suggestions and user approval will be deleted, it is the same as uninstalling this app.trigger-recoveryTrigger Wi-Fi subsystem restart.start-faking-scansStart faking scan results into the framework (configured with 'add-fake-scan'), stop with 'stop-faking-scans'.stop-faking-scansStop faking scan results - started with 'start-faking-scans'.add-fake-scan [-x] <ssid> <bssid> <capabilities> <frequency> <dbm>Add a fake scan result to be used when enabled via `start-faking-scans'.Example WPA2: add-fake-scan fakeWpa2 80:01:02:03:04:05 "[WPA2-PSK-CCMP][RSN-PSK-CCMP][ESS]" 2412 -55Example WPA3: add-fake-scan fakeWpa3 80:01:02:03:04:06 "[RSN-SAE+FT/SAE-CCMP][ESS]" 2412 -55Example Open: add-fake-scan fakeOpen 80:01:02:03:04:07 "[ESS]" 2412 -55Example OWE: add-fake-scan fakeOwe 80:01:02:03:04:08 "[RSN-OWE-CCMP]" 2412 -55Example WPA2/WPA3 transition mode: add-fake-scan fakeWpa2t3 80:01:02:03:04:09 "[WPA2-PSK-CCMP][RSN-PSK+SAE-CCMP][ESS][MFPC]" 2412 -55Example Open/OWE transition mode: add-fake-scan fakeOpenOwe 80:01:02:03:04:0A "[RSN-OWE_TRANSITION-CCMP][ESS]" 2412 -55Example Passpoint: add-fake-scan fakePasspoint 80:01:02:03:04:0B "[WPA2-EAP/SHA1-CCMP][RSN-EAP/SHA1-CCMP][ESS][MFPR][MFPC][PASSPOINT]" 2412 -55-x - Specifies the SSID as hex digits instead of plain textreset-fake-scansResets all fake scan results added by 'add-fake-scan'.enable-scanning enabled|disabled [-h]Sets whether all scanning should be enabled or disabled-h - Enable scanning for hidden networks.set-passpoint-enabled enabled|disabledSets whether Passpoint should be enabled or disabledstart-lohs <ssid> (open|wpa2|wpa3|wpa3_transition|owe|owe_transition) <passphrase> [-b 2|5|6|any]Start local only softap (hotspot) with provided params<ssid> - SSID of the networkopen|wpa2|wpa3|wpa3_transition|owe|owe_transition - Security type of the network.- Use 'open', 'owe', 'owe_transition' for networks with no passphrase- Use 'wpa2', 'wpa3', 'wpa3_transition' for networks with passphrase-b 2|5|6|any|bridged - select the preferred band.- Use '2' to select 2.4GHz band as the preferred band- Use '5' to select 5GHz band as the preferred band- Use '6' to select 6GHz band as the preferred band- Use 'any' to indicate no band preference- Use 'bridged' to indicate bridged AP which enables APs on both 2.4G + 5GNote: If the band option is not provided, 2.4GHz is the preferred band.stop-lohsStop local only softap (hotspot)set-multi-internet-mode 0|1|2Sets Multi Internet use case mode. 0-disabled 1-dbs 2-multi apset-pno-request <ssid> [-f <frequency>]Requests to include a non-quoted UTF-8 SSID in PNO scansclear-pno-requestClear the PNO scan request.start-dpp-enrollee-responder [-i <info>] [-c <curve>]Start DPP Enrollee responder mode.-i - Device Info to be used in DPP Bootstrapping URI-c - Cryptography Curve integer 1:p256v1, 2:s384r1, etcstart-dpp-configurator-initiator <networkId> <netRole> <enrolleeURI>Start DPP Configurator Initiator mode.netRole - 0: STA, 1: APenrolleeURI - Bootstrapping URI received from Enrolleestop-dppStop DPP session.255|console:/ # 

打开wifi

cmd wifi set-wifi-enabled enabled

关闭wifi

cmd wifi set-wifi-enabled disabled

查看wifi状态

cmd wifi status

可以看到wifi的状态

  • 已关闭:
Wifi is disabled
Wifi scanning is always available
  • 已打开,未连接
Wifi is enabled
Wifi scanning is always available
==== ClientModeManager instance: ConcreteClientModeManager{id=8163428 iface=wlan0 role=ROLE_CLIENT_PRIMARY} ====
Wifi is not connected
  • 已打开并连接到网络
Wifi is enabled
Wifi scanning is always available
==== ClientModeManager instance: ConcreteClientModeManager{id=8163428 iface=wlan0 role=ROLE_CLIENT_PRIMARY} ====
Wifi is connected to "Project2"

扫描wifi网络

cmd wifi start-scan

获取扫描结果

cmd wifi list-scan-results

结果示例:

console:/ # cmd wifi list-scan-resultsBSSID              Frequency      RSSI           Age(sec)     SSID                                 Flags98:97:cc:50:f6:bf       5240        -90              4.404    NW-DQA-FYH_5G1                    [WPA2-PSK-CCMP][RSN-PSK-CCMP][WPA-PSK-CCMP][ESS]54:75:95:ff:f2:ec       5805        -89              4.404    WCS-DQA6-ZR-5G                    [ESS]54:75:95:ff:f2:ea       2412        -69              4.403    WCS-DQA6-ZR                       [WPA-PSK-CCMP][WPA2-PSK-CCMP][RSN-PSK-CCMP][ESS]a8:15:4d:3f:01:22       2472        -72              4.403    znrj3z                            [WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP+CCMP][RSN-PSK-TKIP+CCMP][ESS][WPS]50:eb:f6:ad:f5:80       2412        -77              4.403    Cswsl_2.4G                        [RSN-SAE-CCMP][ESS]80:ea:07:d8:c8:2f       2462        -49              4.404    AI                                [WPA-PSK-CCMP][WPA2-PSK-CCMP][RSN-PSK-CCMP][ESS]98:97:cc:50:f6:bd       2462        -70              4.403    NW-DQA-FYH                        [WPA2-PSK-CCMP][RSN-PSK-CCMP][WPA-PSK-CCMP][ESS]50:eb:f6:ad:f5:84       5220        -91              4.404    Cswsl_5G                          [RSN-SAE-CCMP][ESS]50:64:2b:79:6d:64       2437        -70              4.404    HYZY28                            [WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP+CCMP][RSN-PSK-TKIP+CCMP][ESS][WPS]b8:3a:08:95:a9:05       5765        -55              4.403    Project2                          [WPA-PSK-CCMP][WPA2-PSK-CCMP][RSN-PSK-CCMP][ESS][WPS]

SSID 就是wifi名称。

连接wifi

使用密码 12345678 连接 名称为 Project2 、wpa2 类型的 wifi , 密码正确才能连接上噢 😄

cmd wifi connect-network Project2 wpa2 12345678

怎么知道 wifi 是 wpa2 还是 wpa3 类型的? 从wifi扫描结果里看~

查看已保存的网络

cmd wifi list-networks

操作示例:

console:/ # cmd wifi list-networks
Network Id      SSID                         Security type
1            Project2                         wpa2-psk
1            Project2                         wpa3-sae^
console:/

忘记网络

cmd wifi forget-network <networkId>

<networkId> 通过 查看已保存的网络 得到。

操作示例:

console:/ # cmd wifi forget-network 1                                          
Forget successful

开启/关闭wifi热点

开启 wpa2 类型、名称为 hotpot11 、密码是 12345678 的 wifi热点

cmd wifi start-softap hotpot11 wpa2 12345678

操作示例:

console:/ # cmd wifi start-softap hotpot11 wpa2 12345678
onStateChanged with state: 11 failure reason: 0SAP is disabled
onConnectedClientsOrInfoChanged, infos: {}, clients: {}, isBridged: false
onCapabilityChanged SupportedFeatures=106 MaximumSupportedClientNumber=16 SupportedChannelListIn24g[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] SupportedChannelListIn5g[] SupportedChannelListIn6g[] SupportedChannelListIn60g[] mCountryCodeFromDriverCN
onStateChanged with state: 12 failure reason: 0
onStateChanged with state: 13 failure reason: 0SAP is enabled successfully
onConnectedClientsOrInfoChanged, infos: {}, clients: {}, isBridged: false
onConnectedClientsOrInfoChanged, infos: {wlan0=SoftApInfo{bandwidth= 2, frequency= 2447,bssid=98:03:cf:74:9c:1c, wifiStandard= 4, mApInstanceIdentifier= wlan0, mIdleShutdownTimeoutMillis= 600000}}, clients: {wlan0=[]}, isBridged: false

关闭wifi热点

cmd wifi stop-softap

操作示例:

console:/ # cmd wifi stop-softap
Soft AP stopped successfully

打开/关闭 自动开启wifi

cmd wifi set-scan-always-available enabled|disabled

操作示例:

console:/ # cmd wifi status
Wifi is enabled
Wifi scanning is always available
==== ClientModeManager instance: ConcreteClientModeManager{id=8163428 iface=wlan0 role=ROLE_CLIENT_PRIMARY} ====
Wifi is not connected
console:/ # 
console:/ # cmd wifi set-scan-always-available disabled
console:/ #  cmd wifi status
Wifi is enabled
Wifi scanning is only available when wifi is enabled
==== ClientModeManager instance: ConcreteClientModeManager{id=8163428 iface=wlan0 role=ROLE_CLIENT_PRIMARY} ====
Wifi is not connected
console:/ #

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/35139.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

论文导读 | Manufacturing Service Operations Management近期文章精选

编者按 在本系列文章中&#xff0c;我们梳理了顶刊Manufacturing & Service Operations Management5月份发布有关OR/OM以及相关应用的文章之基本信息&#xff0c;旨在帮助读者快速洞察行业/学界最新动态。 推荐文章1 ● 题目&#xff1a;Robust Drone Delivery with Weath…

【C++题解】1712. 输出满足条件的整数2

问题&#xff1a;1712. 输出满足条件的整数2 类型&#xff1a;简单循环 题目描述&#xff1a; 有这样的三位数&#xff0c;其百位、十位、个位的数字之和为偶数&#xff0c;且百位大于十位&#xff0c;十位大于个位&#xff0c;请输出满所有满足条件的整数。 输入&#xff1…

#05搜索法

要点&#xff1a; ①搜索法&#xff1a;穷举搜索、深度优先搜索、广度优先搜索、广深结合搜索、回溯法、分支限界法&#xff1b; ②解空间树&#xff1a;子集树、排列树、满m叉树。 ③回溯法及分支限界法求解问题的方法与步骤。 难点&#xff1a; 子集树、排列树和满m叉树…

小程序下拉刷新,加载更多数据,移动端分页

文章目录 页面结构图WXML页面代码js代码wxss代码总结备注 参考&#xff1a;https://juejin.cn/post/7222855604406796346 页面结构图 一般页面就4个结构&#xff1a;最外滚动层、数据展示层、暂无数据层、没有更多数据层。 如图&#xff1a; WXML页面代码 <scroll-view …

前端:Vue中使用JS-Cookie

在我们构建Vue站点时候&#xff0c;可能需要使用 cookie 来记录用户信息或者偏好设置&#xff0c;我们可以引入第三方库 GitHub - js-cookie/js-cookie: A simple, lightweight JavaScript API for handling browser cookies 来方便地操作 cookie。接下来我们就来一步一步地实…

Golang | Leetcode Golang题解之第191题位1的个数

题目&#xff1a; 题解&#xff1a; func hammingWeight(num uint32) (ones int) {for ; num > 0; num & num - 1 {ones}return }

# Kafka_深入探秘者(5):kafka 分区

Kafka_深入探秘者&#xff08;5&#xff09;&#xff1a;kafka 分区 一、kafka 副本机制 1、Kafka 可以将主题划分为多个分区(Partition)&#xff0c;会根据分区规则选择把消息存储到哪个分区中&#xff0c;只要如果分区规则设置的合理&#xff0c;那么所有的消息将会被均匀的…

CesiumJS【Basic】- #014 Entity和Primitive的flyTo

文章目录 Entity和Primitive的flyTo1 目标2 实现2.1 实体对象定位2.2 图元对象定位Entity和Primitive的flyTo 1 目标 实体对象和图元对象定位 2 实现 2.1 实体对象定位 实体对象定位可以使用Cesium.Viewer的flyTo方法。由于target参数可以是一个Entity,所以直接调用即可。…

Golang | Leetcode Golang题解之第198题打家劫舍

题目&#xff1a; 题解&#xff1a; func rob(nums []int) int {if len(nums) 0 {return 0}if len(nums) 1 {return nums[0]}first : nums[0]second : max(nums[0], nums[1])for i : 2; i < len(nums); i {first, second second, max(first nums[i], second)}return se…

【Android面试八股文】WebView如何做资源缓存的?

文章目录 引言1. Android WebView的性能问题1.1 H5页面加载速度慢1.1.1 渲染速度慢1.1.2 页面资源加载缓慢1.1.3 总结1.2 耗费流量1.3 总结2. 上述问题的解决方案2.1 前端H5的缓存机制2.1.1 定义2.1.2 作用2.1.3 具体应用2.2 缓存机制2.2.1 浏览器缓存机制 (HTTP Cache)原理特点…

whisper 实现语音转文字

准备需要转码的音频 https://support.huaweicloud.com/sdkreference-sis/sis_05_0039.html 编码转吗的代码 import whisperif __name__ "__main__":file_path "16k16bit.wav"model whisper.load_model("small")result model.transcribe(f…

掌握Vim的艺术:精通diff模式的比较与合并

标题&#xff1a;掌握Vim的艺术&#xff1a;精通diff模式的比较与合并 引言 在软件开发和文本编辑中&#xff0c;比较文件差异是一项常见任务。Vim&#xff0c;作为一款功能强大的文本编辑器&#xff0c;提供了一个内置的diff模式&#xff0c;使得文件比较变得直观和高效。本…

openEuler离线安装nginx

目录 1.创建储存目录 2.切换到储存目录 3.首先在外网的环境下下载nginx的rpm包 4.目录打包tar包拷贝到离线路径 5.安装nginx 6.启动 nginx 7.停止 nginx 8.重新加载 nginx 配置 9.重新启动 nginx&#xff08;先停止再启动 nginx&#xff09; 10.检查 nginx 服务…

【分布式系统】Zookeeper学习笔记

基本概念 Zookeeper工作机制 从设计模式角度理解: 是一个基于观察者模式设计的分布式服务管理框架; 负责存储和管理大家都关心的数据, 一旦这些数据的状态发生变化, Zookeeper就将负责通知已经在Zookeeper上注册的那些观察值做出相应的反应. Zookeeper特点 Zookeeper有: 一…

强化Linux系统安全:利用Tripwire防御文件完整性攻击

摘要 在日益复杂的网络安全环境中&#xff0c;保护Linux系统的文件完整性是维护系统安全的关键。Tripwire作为一种高效的文件完整性监控工具&#xff0c;能够帮助系统管理员检测和响应未授权的文件更改。本文将从网络安全专家的角度&#xff0c;指导如何部署和使用Tripwire&am…

QT中线程同步的互斥量QMutex与QRecursiveMutex

在 Qt 中&#xff0c;有两种常用的互斥量类&#xff1a;QMutex 和 QRecursiveMutex。这两种互斥量类都用于在多线程环境中控制对共享资源的访问&#xff0c;确保线程安全性。下面是关于这两种互斥量类的详细说明&#xff1a; 1. QMutex&#xff1a; 功能&#xff1a;QMutex 是…

EdgeOne 边缘函数 + Hono.js + Fauna 搭建个人博客

一、背景 虽然 “博客” 已经是很多很多年前流行的东西了&#xff0c;但是时至今日&#xff0c;仍然有一部分人在维护自己的博客站点&#xff0c;输出不少高质量的文章。 我使用过几种博客托管平台或静态博客生成框架&#xff0c;前段时间使用Hono.jsFauna &#xff0c;基于 …

STM32教程 使用硬件SPI和模拟SPI驱动W25Q64芯片

STM32教程&#xff1a;使用硬件SPI和模拟SPI驱动W25Q64芯片 摘要 本教程详细介绍了如何在STM32微控制器上使用硬件SPI和模拟SPI来驱动W25Q64 Flash存储器。W25Q64是一款8Mbit的串行Flash存储器&#xff0c;适用于存储程序数据和用户数据。本教程将从SPI基本原理讲起&#xff…

第 10 课:PPML入门/基于SPU机器学习建模实践

本讲主要内容是PPML入门&#xff0c;即基于SPU进行隐私保护的机器学习的建模实践。通过本次学习&#xff0c;可以了解隐私保护机器学习以及隐语SPU的架构&#xff0c;通过实战可以了解如何基于隐语进行隐私保护的NN模型建模。 一、隐私保护机器学习背景 机器学习中的数据隐私问…

RK3568平台开发系列讲解(I2C篇)利用逻辑分析仪进行I2C总线的全面分析

🚀返回专栏总目录 文章目录 1. 基础协议1.1. 协议简介1.2. 物理信号1.3. 总线连接沉淀、分享、成长,让自己和他人都能有所收获!😄 1. 基础协议 1.1. 协议简介 IIC-BUS(Inter-IntegratedCircuit Bus)最早是由PHilip半导体(现在被NXP收购)于1982年开发。 主要是用来方…