3

我有一个应用程序需要将蓝牙发现过程保持在一个循环中以始终发现新的蓝牙设备(当 BroadcastReceiver 获得 BluetoothAdapter.ACTION_DISCOVERY_FINISHED 时,我只需再次调用 startDiscovery())。我最近向应用程序添加了一些套接字通信,它基本上打开了一个到服务器的套接字,发送数据然后关闭套接字。

当我使用 3G 时,一切正常,嗅探器显示没有 TCP 重传,套接字被干净地打开和关闭。但是,使用 Wifi 会显示大量 TCP 重新传输,有时甚至会连接套接字失败(java.net.SocketException 超时)。

我正在使用带有 Android 2.2.1 的三星 Galaxy S。有什么我忽略的吗?

4

1 回答 1

3

Can you try to configure and move WiFi to a different channel ? If you are using WiFi also in the 2.4 GHz band interference is expected specially during initial discovery / connection, after connection it should become better as Bluetooth should frequency hop to avoid interference (unless WiFi is clogging the complete spectrum)

于 2011-03-15T22:48:23.513 回答