当我尝试通过蓝牙rfcomm连接到Cashregister时,有时会出现jsr 82连接未建立(失败或中止)连接

时间:2014-04-23 12:36:29

标签: android bluetooth

我正试图通过手机上的rfcomm bluetooth连接我的cashregister联想A369i使用这样的反射:

 BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
     BluetoothDevice device = null;
     String macAddr = "00:01:90:ED:27:73";
     for (BluetoothDevice bd : ba.getBondedDevices()) 
     {
          if (bd.getAddress().equals(macAddr)) 
          {
              device = bd;
              break;
          }
      } 

Method htcMethod = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
htcMethod.invoke(device, Integer.valueOf(1));

有时我得到错误“jsr 82连接连接未创建(失败或中止)” 我已经将所有的bletooth权限添加到androidManifest.xml中 我不知道该怎么办,请帮帮我......

0 个答案:

没有答案