小编rai*_*ij1的帖子

更改蓝牙 SPP 连接的波特率

我需要使用蓝牙SPP以1.15k的速率从远程蓝牙设备收集蓝牙数据。我按如下方式连接到远程设备。

try {
  tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
  Log.e(TAG, "create() failed", e);
}
mmSocket = tmp;
}

public void run() {
  Log.i(TAG, "BEGIN mConnectThread");
  setName("ConnectThread");
  // Always cancel discovery because it will slow down a connection
  mAdapter.cancelDiscovery();
  // Make a connection to the BluetoothSocket
  try {
    // This is a blocking call and will only return on a
    // successful connection or an exception
    mmSocket.connect();
  } catch (IOException e) {
    connectionFailed();
    // Close the socket
    try { …
Run Code Online (Sandbox Code Playgroud)

android bluetooth baud-rate

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

baud-rate ×1

bluetooth ×1