Open liuyifang1121 opened 2 years ago
大佬们问个问题:我有一个android设备是没有界面的,然后设置为服务端,然后另外一个设备是手机设置为客户端,每次客户端去连接无界面的android智能设备都提示确认配对密码,这种怎么处理呢。我也写了监听,自动配对和设置pin值,打断点也进入了这个方法体,但是没有效果。谢谢大佬 //自动配对设置Pin值 @Throws(java.lang.Exception::class) fun autoBond( btClass: Class<*>, device: BluetoothDevice?, strPin: String ): Boolean { val autoBondMethod: Method = btClass.getMethod("setPin", ByteArray::class.java) return autoBondMethod(device, strPin.toByteArray()) as Boolean }
//自动配对设置Pin值 @Throws(java.lang.Exception::class) fun autoBond( btClass: Class<*>, device: BluetoothDevice?, strPin: String ): Boolean { val autoBondMethod: Method = btClass.getMethod("setPin", ByteArray::class.java) return autoBondMethod(device, strPin.toByteArray()) as Boolean }
大佬们问个问题:我有一个android设备是没有界面的,然后设置为服务端,然后另外一个设备是手机设置为客户端,每次客户端去连接无界面的android智能设备都提示确认配对密码,这种怎么处理呢。我也写了监听,自动配对和设置pin值,打断点也进入了这个方法体,但是没有效果。谢谢大佬
//自动配对设置Pin值 @Throws(java.lang.Exception::class) fun autoBond( btClass: Class<*>, device: BluetoothDevice?, strPin: String ): Boolean { val autoBondMethod: Method = btClass.getMethod("setPin", ByteArray::class.java) return autoBondMethod(device, strPin.toByteArray()) as Boolean }