0

I have an application (activity and service) which can establish a connection with a separate device and pull data off it over spp Bluetooth.

It need to do this once a day.

However, there appears to be a limit to the number of times that phone (server) can reestablish a connection with the device (client).

In the LogCat, I see this error: BluetoothEventLoop.ccp

onCreateDeviceResult: D.Bus error: org.freedesktop.DBus.Error.LimitsExceeded (The maximum number of pending replies per connection has been reached)

BluetoothEventLoop Result of onCreateDeviceResult:-1

I'm thinking about programmatically rebooting the phone but would rather not have to do this?

Have you any ideas how to overcome this problem.

Ideally, the phone will be running as a hub, permanently connected to a power supply, for many weeks. I'm running Android 2.3.7.

tshepang
  • 12,111
  • 21
  • 91
  • 136
monkstownman
  • 49
  • 1
  • 5

1 Answers1

0

Are you using this method to create the socket in your connect thread?

tmp = device.createRfcommSocketToServiceRecord(MY_UUID);

I had the same error on 2.3.6 and fixed it using the reflection method. I replaced the above code with:

Method m = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
tmp = (BluetoothSocket) m.invoke(device, 1);

I used the same solution as this other problem: Service discovery failed exception using Bluetooth on Android

Community
  • 1
  • 1
pikey
  • 11
  • 1