Parth Parekh
Parth Parekh

Reputation: 123

ADVERTISE_FAILED_INTERNAL_ERROR while broadcasting beacons

I would like to understand when can we encounter ADVERTISE_FAILED_INTERNAL_ERROR on startAdvertising failure callback. I am using AndroidBeaconLibrary to transmit multiple beacons. I have a map which stores current transmissions. The Map structure is

It was working smoothly and emitting beacons. Somehow when I changed the structure to which would be more precise as names are not unique, it started throwing ADVERTISE_FAILED_INTERNAL_ERROR.

Also, this runs sometimes and works perfectly, most of the times it throws ADVERTISE_FAILED_INTERNAL_ERROR. I am clueless as to what is happening.

Would like to know when can the API throw ADVERTISE_FAILED_INTERNAL_ERROR?

Upvotes: 1

Views: 279

Answers (1)

davidgyoung
davidgyoung

Reputation: 64951

On some devices ADVERTISE_FAILED_INTERNAL_ERROR is returned when the bluetooth stack has gotten into a bad state an is not recoverable without a power cycle. This is actually such a good predictor of this state, that I have built an experimental class for use with the library that periodically starts advertising, and if this error code is returned, it turns bluetooth off, waits 1000 milliseconds, then turns it back on again. This typically clears the condition.

Upvotes: 2

Related Questions