Error code 257 when DeviceConnection

I’m trying to develope an app to configure my beacons with a filter for specify value.
But I got an DeviceConnectionException when I try to make a DeviceConnection to my beacon.
Here is the exception message :
com.estimote.mgmtsdk.common.exceptions.DeviceConnectionException: Disconnected from device while trying to connect. Error code 257: FAILURE

How can I solve this problem?

Error 257 is described in Bluetooth docs as ‘Unknown Error’. Does it happens all the time or was it a single event? Have you tried running in on different phone model and had the same error?
Try restarting Bluetooth or rebooting phone. It should help. Please provide your phone model and Android version, because some devices have known Bluetooth issues.

Thank you, @pober, it won’t happen all the time, but also not a single event. Almostly it happened more than one time for every device, but after a while it will connect success. I always restart bluetooth to fix this problem, but I can’t ask my app user to fix this problem by this way. My test device is Infocus m510, android version 4.4.2.