This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/bdxt-250418/README.md

5.5 KiB
Raw Permalink Blame History

bdxt_sdk v1.2

介绍

Android SDK 本SDK支持蓝牙连接H10、H11、H20、C20差分支持设备自带网络差分同时也支持手机的网络差分。

安装教程

  1. 程序目录新建libs文件夹将文件 rtklib_v1.0.1.aar libqxwz_release_v1.8.0.aar 拷贝至目录下
  2. 增加 import com.mijia.rtk.LocationListener; import com.mijia.rtk.handevice; import com.mijia.rtk.ConfigDeviceInfoListener; import com.mijia.rtk.ntripService;
  3. 调用接口参考demo code

使用说明

  1. 连接设备 handevice.connect(adrress); handevice.disconnect(); handevice.getConnectState();

  2. 设备cors设置 handevice.getAccount(); handevice.setAccount(String ip,String port,String user,String password,String source);

  3. 手机网络cors设置 handevice.setPhoneAccount(String ip,String port,String user,String password,String source);

  4. 回调

    //和定位有关的回调函数
    handevice.setLocationListener(new LocationListener() {
            @Override
            public void onLocationChanged() {
                //位置(经纬度)发生了变化
            }
    
            @Override[README.md](..%2Fbdxt_sdk%2Fbdxt%2FREADME.md)
            public void onRead(@NonNull String msg) {
                //读到新的数据
            }
            @Override
            public  void onReceiveSatellite(List<SatelliteInfo> list) {
                /*
                卫星的信息更新
                SatelliteInfo
                satType     卫星类型  1:GP   2:GL  3:GA  4:BD   6:GI
                signalid    卫星频点
                prn         卫星编号
                elev        高度角,度
                azi         方位角,度
                snr         信噪比00-99dB不跟踪时为空
                */
            }
            @Override
            public  void onBluetoothConnStatusChange(int state) {
                /*蓝牙的状态发生了变化
                state
                0:初始状态,没有连接
                1:正在连接
                2:成功连接
                */
            }
        });
    
    //和配置相关的回调函数
    handevice.setConfigListener(new ConfigDeviceInfoListener() {
            @Override//获取设备内部的cors配置参数的回调
            public void onGetCorsParaSuccess(@NonNull String ip, @NonNull String port, @NonNull String user, @NonNull String password, @NonNull String source) {
    
                Log.d(TAG, "ip:"+ip+",port:"+port+",user:"+user+",password:"+password+",source:"+source);
            }
    
            @Override //配置设备内部的cors账号的回调
            public void onSetCorsParaAck(int state){
                /*state: 
                1   CORS设置成功        0   CORS设置失败
                * */
            }
    
            @Override   //手机网络cors的设置回调函数
            public void onSetPhoneCorsParaAck(int state){
                /*
                state:
                0   手机网络连接CORS成功
                1   手机网络失败:用户名、密码、挂载点 错误,验证未通过
                2   手机网络失败IP、PORT 错误socket连接不到对方
                3   手机网络失败其他异常比如手机无sim卡等
                * */
                Log.d("onSetPhoneCorsParaAck", "onSetPhoneCorsParaAck:"+state);
            }
    
        });
    
    1. 定制化需求: 蓝牙信号强度和距离接口

      A.函数名称 int handevice.getRssi(); 手机连接H11后调用此接口返回一个int值表示蓝牙的信号强度单位为dB. 如: 距离1米-15dB
      距离2米-29dB A.函数名称 double handevice.getDistance(); 手机连接H11后调用此接口返回一个double值距离单位为米. 因为环境等原因可能不准只供参考也可以自行修改A_Value、n_Value常量取重新计算 参考代码如下: public static double getDistance(){ /* A和n的值需要根据实际环境进行检测得出 https://www.cnblogs.com/b-ben/p/11113000.html / double A_Value=15;/A - 发射端和接收端相隔1米时的信号强度/ double n_Value=2.5;/ n - 环境衰减因子*/ double power = (Math.abs(getRssi())-A_Value)/(10*n_Value); return Math.pow(10,power); }

    2. 接口说明

Demo程序截图

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/