简体   繁体   English

Android蓝牙广告-内部错误

[英]Android Bluetooth Advertisement - Internal Error

I have a Android Device advertising as Bluetooth LE GATT Server. 我有一个Android设备广告,称为Bluetooth LE GATT Server。 Sometimes (roughly in 20% of the cases) when I start advertising it fails with the OnStartFailure Callback giving me the error Code internal error . 有时(大约在20%的情况下),当我开始做广告时,它会失败,并出现OnStartFailure回调,并显示错误代码internal error Does anyone has experienced this issue and has some tipps on how to overcome it? 有没有人遇到过这个问题,并且对如何克服它有一些建议? Is there any way to get more information about the nature of the error, internal error is pretty generic? 有什么方法可以获取有关错误性质的更多信息,内部错误是很普通的吗?

Some more information about what I am doing: 有关我在做什么的更多信息:

  • I run two different advertisements at the same time. 我同时投放两个不同的广告。 The first advertisement acts as iBeacon (implemented with altbeacon library). 第一个广告充当iBeacon(由altbeacon库实现)。
  • The second advertisement is a connectable one, which also advertises a service UUID and 2 bytes of advertisement data. 第二个广告是可连接的广告,它也广告服务UUID和2字节的广告数据。
  • The error sometimes occurs when I start the beacon advertisement and sometimes when I start the other advertisement 当我启动信标广告时有时会发生错误,有时在我启动其他广告时会发生错误
  • I am using Xamarin 我正在使用Xamarin

I solved this problem by programmatically deactivating and then reactivating Bluetooth on the device. 我通过以编程方式停用然后重新激活设备上的蓝牙来解决此问题。 The problem seems to be solved after bluetooth is restarted in that way. 以这种方式重启蓝牙后,该问题似乎已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM