在c#中设置wifi信号电平

时间:2017-05-04 13:45:43

标签: c# wifi

我正在尝试连续读取wifi信号,以了解嵌入式系统的wifi信号电平如何变化。我在SO中读了几篇关于如何在C#中读取wifi信号电平的文章:

How often to poll wifi signal strength?

但是当我想做同样的事情时,我总是得到同样的价值。我的代码如下(简化版):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.1
0:eclipse (default-cli) on project fileloader: Execution default-cli of goal org
.apache.maven.plugins:maven-eclipse-plugin:2.10:eclipse failed: A required class
 was missing while executing org.apache.maven.plugins:maven-eclipse-plugin:2.10:
eclipse: org/codehaus/plexus/resource/loader/ResourceNotFoundException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-eclipse-plugin:2.10
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/plugins/
maven-eclipse-plugin/2.10/maven-eclipse-plugin-2.10.jar
[ERROR] urls[1] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plexu
s-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[2] = file:/C:/Users/xxxxxx/.m2/repository/junit/junit/3.8.1/junit-3
.8.1.jar
[ERROR] urls[3] = file:/C:/Users/xxxxxx/.m2/repository/backport-util-concurrent/
backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[4] = file:/C:/Users/xxxxxx/.m2/repository/org/slf4j/slf4j-jdk14/1.5
.6/slf4j-jdk14-1.5.6.jar
[ERROR] urls[5] = file:/C:/Users/xxxxxx/.m2/repository/org/slf4j/jcl-over-slf4j/
1.5.6/jcl-over-slf4j-1.5.6.jar
[ERROR] urls[6] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/reportin
g/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
[ERROR] urls[7] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/doxia/do
xia-sink-api/1.1/doxia-sink-api-1.1.jar
[ERROR] urls[8] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/doxia/do
xia-logging-api/1.1/doxia-logging-api-1.1.jar
[ERROR] urls[9] = file:/C:/Users/xxxxxx/.m2/repository/commons-cli/commons-cli/1
.2/commons-cli-1.2.jar
[ERROR] urls[10] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[11] = file:/C:/Users/xxxxxx/.m2/repository/org/sonatype/plexus/plex
us-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[12] = file:/C:/Users/xxxxxx/.m2/repository/org/sonatype/plexus/plex
us-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[13] = file:/C:/Users/xxxxxx/.m2/repository/commons-io/commons-io/2.
2/commons-io-2.2.jar
[ERROR] urls[14] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-archiver/2.6.3/plexus-archiver-2.6.3.jar
[ERROR] urls[15] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-io/2.1.3/plexus-io-2.1.3.jar
[ERROR] urls[16] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/commons/commo
ns-compress/1.8.1/commons-compress-1.8.1.jar
[ERROR] urls[17] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-utils/3.0.20/plexus-utils-3.0.20.jar
[ERROR] urls[18] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-interactivity-jline/1.0-alpha-5/plexus-interactivity-jline-1.0-alpha-5.jar
[ERROR] urls[19] = file:/C:/Users/xxxxxx/.m2/repository/jline/jline/0.9.1/jline-
0.9.1.jar
[ERROR] urls[20] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/maven-a
rchiver/2.5/maven-archiver-2.5.jar
[ERROR] urls[21] = file:/C:/Users/xxxxxx/.m2/repository/org/codehaus/plexus/plex
us-resources/1.0-alpha-7/plexus-resources-1.0-alpha-7.jar
[ERROR] urls[22] = file:/C:/Users/xxxxxx/.m2/repository/biz/aQute/bndlib/0.0.145
/bndlib-0.0.145.jar
[ERROR] urls[23] = file:/C:/Users/xxxxxx/.m2/repository/org/apache/maven/shared/
maven-osgi/0.2.0/maven-osgi-0.2.0.jar
[ERROR] urls[24] = file:/C:/Users/xxxxxx/.m2/repository/org/eclipse/core/resourc
es/3.3.0-v20070604/resources-3.3.0-v20070604.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plex
us.resource.loader.ResourceNotFoundException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContaine
rException

当我运行此代码时,我会看到信号级别始终报告为一个值,并且它不会发生变化。

我将它用于具有wifi的嵌入式系统,即使我将设备放在PC旁边,当我移动到离计算机很远的另一个房间时,如果应用程序运行,它总是报告相同的值,如果我重新启动应用程序的值更改。

此代码有什么问题,它没有报告正确的值?

0 个答案:

没有答案