`
wuhua
  • 浏览: 2124397 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

What Is - Network Diagnostic Tool

阅读更多

What Is - Network Diagnostic Tool

Last Updated: 19 March 2009
Article Number: DB-00684

Summary

This article applies to the following:

  • BlackBerry® smartphones based on Java® technology
  • BlackBerry® Device Software 4.5 and later

Details

BlackBerry smartphones support many different transports that facilitate reliable data communication between third-party applications and the Internet. The transports available are direct Transmission Control Protocol (TCP), BlackBerry® Mobile Data System (BlackBerry MDS), BlackBerry® Internet Service Browsing (BIS-B), BlackBerry® Unite!™ software, Wireless Access Protocol (WAP)1.0, WAP2.0 and Wi-Fi® technology. It is important to understand the differences between these transports and how and when to leverage each transport. It is also crucial to determine if a transport is available for use before trying to use it. The Network Diagnostic Tool is essentially a role model that answers all these questions and is a functional diagnostic tool for testing a URL over various transports supported by the BlackBerry solutions, as well as for displaying the values of many network attributes during the test period.

This article refers to the source code of the Network Diagnostic Tool, which can be downloadedhere.

To better understand how each transport works, see the video Network Transports found onblackberrydeveloper.com.

Determining transport availability

The first step to determining the availability of a transport is to check if the ServiceRecord for that transport is available. This can be done programmatically as follows:

  1. Get the ServiceBook instance by calling the static method ServiceBook.getSB().
  2. Get the ServiceRecords from the ServiceBook by calling the instance methodServiceBook.getRecords().
  3. Iterate through each ServiceRecord and determine if it is for the transport you are looking for.

This is demonstrated in the Network Diagnostic Tool'sIOThread.initializeTransportAvailability().

The next step is to determine if the BlackBerry smartphone has network coverage to communicate through the transport. This can be accomplished by calling the application programming interface (API) CoverageInfo.isCoverageSufficient(int coverageType).

Refer to the method IOThread.initializeTransportAvailability()for a sample implementation of this.

Creating connections

Developer knowledge base article DB-00396 illustrates how to create an Hypertext Transfer Protocol (HTTP) or socket connection.

The IOThread.get*URL() methods in the source code shows how to construct URLs for each transport.

Once you have the URL you need, you can create an HTTPConnection instance using theConnector.open(String url) static method and start communicating with that URL. See theIOThread.do*() methods in the Network Diagnostic Tool source code to see a detailed implementation of this.

Note: The BIS-B transport is available only to partners of the BlackBerry Alliance Program, and therefore is not implemented in the attached source code of the Network Diagnostic Tool. For more information on the BlackBerry Alliance Program, visithttp://na.blackberry.com/eng/partners/why_join.jsp.

Displaying network and radio information

Besides testing the different transports for a given URL, the Network Diagnostic Tool also displays network and radio information such as signal level, network name and type, and available network services. Refer to the method ReportScreen.displayNetworkInfo() in the Network Diagnostic Tool source code for more information on how to display this information.

RadioStatusListener

It is also possible for an application to listen for changes in the radio such as signal level and available network services. To accomplish this, you must implement the interfaceRadioStatusListener. The Network Diagnostic Tool implements this interface in the class namedIOThread.

Automatically detecting wireless service providers

It is very useful to be able to detect wireless service providers, especially for applications using the Direct TCP transport for BlackBerry smartphones that operate using Global System for Mobile communications® (GSM®). For these BlackBerry smartphones, correct access point name (APN) information must be specified by the BlackBerry smartphone user before any application can leverage the Direct TCP transport.

APN information can also be set programmatically, which is demonstrated in the referenced Network Diagnostic Tool source code. The details are also explained in DB-00532. If the current wireless service provider for the BlackBerry smartphone can be determined, then the APN information can be set up programmatically from the application. This improves the BlackBerry smartphone user's experience because the APN does not need to be specified manually. To detect the wireless service provider, use a table that contains the name, mobile country code (MCC), mobile network code (MNC) and the APN details of each wireless service provider. Compare the MCC and MNC values returned by the BlackBerry smartphone against the values in the table. Once a match is found, set the corresponding APN information programmatically. For more information on how to read the MCC and MNC values from the BlackBerry smartphone, see DB-00688.

The complete process to automatically detect wireless service providers is also demonstrated by the Network Diagnostic Tool. The Network Diagnostic Tool stores the wireless service provider table in an Extensible Markup Language (XML) file that can be downloaded from here. This file must be stored on the BlackBerry smartphone in the following location:file:///store/netdiag/carrier_info.xml unless this path is changed in the source code. You can add details for as many wireless service providers as you want to the XML file.

Changes required for earlier versions of the BlackBerry Java Development Environment

Although this article is targeted for BlackBerry® Java® Development Environment (BlackBerry JDE) 4.5 or later, the source code of the Network Diagnostic Tool can be easily modified and compiled using earlier versions of the BlackBerry JDE. Consider the following changes:

  1. Before BlackBerry JDE 4.3, RadioStatusListener had an additional method namedmobilityManagementEvent(int eventCode, int cause). This method must be implemented if you are using BlackBerry JDE 4.2 or earlier.
  2. CoverageInfo.COVERAGE_DIRECT is not supported until BlackBerry JDE 4.5. For BlackBerry JDE 4.3 or earlier, use CoverageInfo.COVERAGE_CARRIER.
  3. WLANInfo class is not available until BlackBerry JDE 4.5. For BlackBerry JDE 4.3 or earlier, use the following logic:
  4. if(CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_CARRIER,RadioInfo.WAF_WLAN, false)){
        coverageWiFi = true;
        wifiLog.addlog("Coverage Status: Online");

  5. RadioInfo.NETWORK_SERVICE_GAN is not supported in BlackBerry JDE 4.2.1 or earlier. Remove any references to this constant for those versions of the BlackBerry JDE.
  6. RadioInfo.NETWORK_SERVICE_EVDO_ONLY and RadioInfo.NETWORK_SERVICE_UMTS are not supported in BlackBerry JDE 4.2.1 or earlier. Remove any references to these constants for those versions of the BlackBerry JDE.
  7. The CoverageInfo class is introduced in BlackBerry JDE 4.2.0. Remove any references to this class if you are using an earlier version of the BlackBerry JDE to compile this application. However, it is possible to do the following in versions of the BlackBerry JDE earlier than 4.2.0:
    1. if(RadioInfo.getSignalLevel() != RadioInfo.LEVEL_NO_COVERAGE) the BlackBerry smartphone has radio signal.
    2. if(RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_DATA)>0 the BlackBerry smartphone has data connectivity.
 

Keywords

network diagnostic tool, http, connection, transport, direct tcp, mds, bis, unite, wap, wap2, wap2.0, radiostatuslistener

分享到:
评论

相关推荐

    ArubaOS 6.0 Command Line Interface Reference Guide 命令行用户手册

    It is a powerful diagnostic tool for troubleshooting issues related to spectrum monitoring. #### Conclusion The new commands introduced in ArubaOS 6.0 significantly enhance the capabilities of the ...

    Mastering.Wireshark.178398952

    Use Wireshark as a diagnostic tool and also for network security analysis to keep track of malware Troubleshoot all the network anomalies with help of Wireshark Resolve latencies and bottleneck issues...

    Essential Linux Device Drivers

    Diagnostic Tools Kernel Hacking Config Options Test Equipment Chapter 22. Maintenance and Delivery Coding Style Change Markers Version Control Consistent Checksums Build Scripts Portable Code...

    Java 11 Cookbook, Second Edition

    Solutions for modular, functional, reactive, GUI, network, and multithreaded programming For more than three decades, Java has been on the forefront of developing robust software that has helped ...

    永磁同步电机(PMSM)三闭环控制系统仿真与参数优化 - MATLAB/Simulink实现

    内容概要:本文详细介绍了永磁同步电机(PMSM)三闭环控制系统的仿真建模方法及其参数优化技巧。首先阐述了三闭环控制的整体架构,即位置环、速度环和电流环的层级关系,并解释了每个环节的作用。接着展示了各环的具体实现代码,如电流环的PI控制器、速度环的前馈控制以及位置环的限幅处理。文中强调了调参的重要性和注意事项,提供了具体的参数选择依据和调试建议。最后分享了一些实用的仿真技巧,如死区补偿、故障注入等,确保模型能够应对实际工况。 适合人群:从事电机控制研究的技术人员、研究生及以上水平的学生,特别是对永磁同步电机三闭环控制感兴趣的读者。 使用场景及目标:适用于需要深入了解PMSM三闭环控制原理并进行仿真实验的研究人员和技术开发者。目标是帮助读者掌握如何构建高效的三闭环控制系统,提高电机性能,降低能耗,增强系统的鲁棒性和可靠性。 其他说明:文中提供的代码片段和参数配置均基于MATLAB/Simulink平台,建议读者在实践中结合实际情况调整参数,以获得最佳效果。同时,附带的参考资料也为进一步学习提供了指导。

    环境流体力学仿真:风能与水能仿真.zip

    光电材料仿真,电子仿真等;从入门到精通教程;含代码案例解析。

    基于PFC3D5.0的滑坡致灾与建筑物易损性分析代码实现及应用

    内容概要:本文详细介绍了利用PFC3D5.0进行滑坡致灾与建筑物易损性分析的完整代码实现。首先,通过Python和Fish语言构建了滑坡体和建筑物的模型,设置了关键参数如密度、刚度、摩擦系数等,确保滑坡体能够真实模拟滑坡行为。其次,针对建筑物的不同部位(楼板、墙体、支柱),采用不同的材料特性进行建模,并加入了实时监测系统,用于记录滑坡过程中各部件的应力、应变以及冲击力的变化情况。此外,还实现了冲击力监测、损伤评估等功能,能够自动触发应急分析并在模拟结束后生成详细的损伤报告。最后,通过对多次模拟结果的数据处理,生成了建筑物的易损性曲线,验证了模型的有效性和准确性。 适合人群:从事地质灾害研究、土木工程、结构安全评估的研究人员和技术人员。 使用场景及目标:适用于滑坡灾害预测、建筑设计优化、抗震防灾等领域。通过模拟不同条件下滑坡对建筑物的影响,帮助研究人员更好地理解滑坡致灾机理,为制定有效的防护措施提供科学依据。 其他说明:文中提供了大量实用的小技巧,如调整参数以获得更好的模拟效果、优化计算效率等。同时强调了模型验证的重要性,确保研究成果具有较高的可信度。

    编译qt httpserver 的步骤

    编译httpserver 通过后记录的

    光电子集成器件仿真:集成激光器仿真.zip

    光电材料仿真,电子仿真等;从入门到精通教程;含代码案例解析。

    Android平台上基于多尺度多角度模板匹配的图像识别技术及其在不同ARM架构的应用

    内容概要:本文详细探讨了在Android平台上进行图像模板匹配的技术挑战和解决方案,特别是在处理不同尺寸和旋转角度的目标物时的方法。文中介绍了使用OpenCV构建图像金字塔、处理旋转模板以及利用NEON指令集优化性能的具体实现。此外,文章还讨论了在armeabi-v7a和arm64-v8a这两种主要ARM架构下的优化技巧,如内存对齐、SIMD指令优化、RenderScript并行处理等。作者分享了许多实践经验,包括如何避免常见的性能瓶颈和兼容性问题。 适合人群:有一定Android开发经验,尤其是熟悉OpenCV和NDK编程的中级及以上开发者。 使用场景及目标:适用于需要在移动设备上进行高效图像识别的应用开发,如实时视频流中的物体检测、游戏内的道具识别等。目标是提高模板匹配的速度和准确性,同时确保在不同硬件配置下的稳定性和兼容性。 其他说明:文章提供了丰富的代码片段和实际案例,帮助读者更好地理解和应用所介绍的技术。特别强调了在不同ARM架构下的优化策略,为开发者提供了宝贵的参考资料。

    光电系统仿真:光电传感系统仿真.zip

    光电材料仿真,电子仿真等;从入门到精通教程;含代码案例解析。

    COMSOL多物理场耦合模拟电晕放电离子风及其应用

    内容概要:本文详细介绍了利用COMSOL软件模拟电晕放电离子风的过程。首先解释了电晕放电的基本概念,即在高压电场下电极周围空气被电离形成离子风。接着阐述了如何在COMSOL中建立针-板电极结构的三维模型,涉及静电、层流和稀物质传递三个物理场的设置。文中提供了具体的MATLAB代码片段用于初始化模型、定义几何体、设置边界条件、配置物理参数、进行网格划分以及求解模型。此外,还讨论了求解过程中可能出现的问题及解决方法,如收敛技巧、网格划分策略等。最后强调了通过模拟获得的电场分布、气流速度和离子浓度等结果对于理解和优化电晕放电离子风设备的重要性。 适用人群:对电晕放电现象感兴趣的科研人员和技术开发者,尤其是那些希望深入了解多物理场耦合仿真技术的人群。 使用场景及目标:适用于需要研究电晕放电离子风特性的场合,如空气净化装置、散热设备等领域的产品设计与性能评估。目标是帮助用户掌握如何使用COMSOL软件构建并求解电晕放电离子风模型,从而更好地理解相关物理机制。 其他说明:文中提到的实际操作细节和遇到的技术挑战有助于新手避免常见错误,提高建模效率。同时,提供的具体参数设置和代码示例也为进一步深入研究奠定了基础。

    多模态属性级情感分析:技术详解、代码实现与实战应用

    内容概要:本文详细介绍了多模态属性级情感分析的技术原理及其应用场景。首先解释了多模态属性级情感分析的意义,即通过结合文本和图像信息来更全面地理解用户情感。接着阐述了数据预处理方法,如使用BERT进行文本编码和ResNet处理图像。然后深入探讨了模型架构,包括双流网络结构和特征融合策略,以及如何通过跨模态注意力机制实现更好的特征对齐。此外,文中还分享了多个实战案例,如电商广告投放系统中如何利用该技术提高转化率,以及在处理用户评价时遇到的问题和解决办法。最后讨论了一些常见的技术挑战,如模态间权重调整、背景干扰物处理等。 适合人群:从事自然语言处理、计算机视觉研究的专业人士,尤其是希望将这两种技术结合起来进行情感分析的研究者和技术开发者。 使用场景及目标:适用于电商平台、社交媒体平台等需要分析用户反馈的场景,旨在帮助企业更好地理解消费者的真实想法,从而优化产品和服务。通过这种方式,企业可以发现潜在的市场机会并改进营销策略。 其他说明:文章不仅提供了理论指导,还包括具体的代码实现示例,有助于读者快速上手实践。同时强调了实际应用中的注意事项,如数据清洗、模型调优等方面的经验教训。

    5MW海上永磁风电直驱系统Simulink仿真:矢量控制与混合储能关键技术解析

    内容概要:本文详细介绍了5MW海上永磁风电直驱系统的Simulink仿真过程,涵盖矢量控制、混合储能系统以及并网逆变器的设计与调试。首先,文章解释了系统架构,包括永磁电机、两电平并网变流器和混合储能模块。接着,深入探讨了矢量控制中的坐标变换、PI参数设置及其对电网波动的影响。对于混合储能系统,文章讨论了滑动平均滤波用于功率分配的方法,确保超级电容和锂电池的有效协同工作。此外,文章还涉及并网逆变器的控制策略,特别是变参数PI控制和死区时间补偿,以应对复杂的电网环境。最后,通过仿真结果展示了系统的高效性和稳定性。 适合人群:从事电力电子工程、风电系统设计与仿真的工程师和技术研究人员。 使用场景及目标:适用于希望深入了解海上风电系统仿真技术的专业人士,旨在提高对矢量控制、混合储能和并网逆变器的理解,从而优化实际应用中的系统性能。 其他说明:文中提供了多个MATLAB代码片段,帮助读者更好地理解和复现相关控制算法。同时,强调了仿真过程中遇到的实际问题及解决方案,如风速突变、电网电压跌落等情况下的系统响应。

    光电系统仿真:光电通信系统仿真.zip

    光电材料仿真,电子仿真等;从入门到精通教程;含代码案例解析。

    natsort-5.4.0-py2.py3-none-any.whl

    该资源为natsort-5.4.0-py2.py3-none-any.whl,欢迎下载使用哦!

    双馈风力发电机DFIG矢量控制仿真模型及其定子侧与转子侧控制策略详解

    内容概要:本文详细介绍了双馈风力发电机(DFIG)的矢量控制仿真模型,特别是定子侧和转子侧的控制策略。定子侧采用电压定向矢量控制,通过双闭环结构(外环控制直流侧电压,内环控制电流),确保功率因数为1。转子侧采用磁链定向矢量控制,同样基于双闭环结构(外环控制功率,内环控制电流),并引入前馈电压补偿提高响应速度。文中提供了具体的PI控制器代码实现,并讨论了仿真模型的搭建方法,如使用Python的scipy库进行动态响应模拟。此外,文章还提到了一些常见的仿真问题及解决方案,如crowbar保护电路、最大功率跟踪算法和低电压穿越模块等。 适合人群:从事风电系统设计、控制算法开发的研究人员和技术人员,以及对电力电子控制系统感兴趣的工程师。 使用场景及目标:适用于希望深入了解DFIG矢量控制原理和实现细节的专业人士,帮助他们掌握定子侧和转子侧的具体控制策略,优化仿真模型,解决实际工程中的问题。 其他说明:文章不仅提供了理论分析,还包括了大量的代码片段和实践经验,有助于读者更好地理解和应用相关技术。

    煤矿瓦斯气驱技术中二氧化碳与氮气应用的Python自动化解决方案

    内容概要:本文详细介绍了利用Python进行煤矿瓦斯气驱过程中二氧化碳和氮气的应用方法和技术细节。首先展示了如何通过Python脚本处理气驱压力监测数据并绘制对比图,接着讲解了注气速率控制的PID算法实现及其注意事项。文中还涉及裂隙气体扩散模拟、湿度对氮气驱替的影响以及基于状态机的注气控制系统设计。此外,提供了实时气体浓度监控、数据滤波、阈值报警等功能的具体实现方式,并强调了数据可视化的应用价值。最后讨论了注气孔布置优化和注气压力控制的实际操作要点。 适合人群:从事煤矿开采及相关领域的技术人员、工程师,尤其是具有一定编程基础并对自动化控制感兴趣的从业者。 使用场景及目标:适用于煤矿瓦斯气驱项目的规划、实施与维护阶段,旨在提高瓦斯抽采效率,确保安全生产,同时减少人为因素导致的操作失误。通过学习本文提供的代码示例和技术方案,读者能够掌握如何运用Python解决实际工程问题的方法。 其他说明:文中提到的所有代码均为简化版本,用于解释相关概念和技术原理,在实际项目中可能需要进一步完善和优化。对于希望深入了解该领域的读者而言,本文不仅提供了实用的技术指导,也为后续研究奠定了良好的基础。

    故障诊断技术:基于神经网络的故障诊断.zip

    光电材料仿真,电子仿真等;从入门到精通教程;含代码案例解析。

    呼和浩特市_托克托县_街道级边界_150122_Shapefile.zip

    街道级行政区划边界,wgs84坐标系,shp数据,直接分析使用。

Global site tag (gtag.js) - Google Analytics