randdusing / cordova-plugin-bluetoothle

Bluetooth Low Energy Phonegap Plugin
803 stars 353 forks source link

Error Domain Code=10 on subscribe iOS 10 #373

Open skgen opened 8 years ago

skgen commented 8 years ago

Hi, I saw some other people also had the same issue but I didn't succeed fixing it. I've got no problem on Android but I get in the error function for iOS, I get the right service and characteristic in the callback but an error message :

error: "subscription"
message: "Error Domain=CBATTErrorDomain Code=10 \"The attribute could not be found.\" UserInfo={NSLocalizedDescription=The attribute could not be found. »

I've no ideas how to fix it, I've found this http://lists.apple.com/archives/bluetooth-dev/2013/Aug/msg00023.html, but it didn't do a thing.

Any idea ?

skgen commented 7 years ago

Still having the issue after a week ... I'm desperate^^, still no idea ?

randdusing commented 7 years ago

Can you list out the result of discover or services/characteristics/descriptors?

randdusing commented 7 years ago

496E264D-6F74-696F-6E01-410000000000 doesn't have indicate or notify properties, so it can't be subscribed.

randdusing commented 7 years ago

What happens if you don't write and just subscribe initially? Possibly something is changing on the device side when the write is triggered.

randdusing commented 7 years ago

Do you control the device code? Maybe something is wrong on its side.

skgen commented 7 years ago

Yeah I can change it, but I've got no reason to change it, I just tip it to get permission to read the datas on the card. Strange thing is that it's the same code for iOS et Android and everything is working well on Android...

randdusing commented 7 years ago

I would try to remove all other variables and see if iOS and Android can both subscribe to a characteristic without worrying about any other functionality.

skgen commented 7 years ago

After a bunch of tries, it's seems it came from the card where the characteristics were badly implemented, like they had something missing, that's why iOS didn't recognize them, Android had no problem with it, iOS blocked it.

I tried to subscribe to another type of card (SPI) and it worked on iOS and Android, so the plugin works, it was the card which had a problem.

Interesting thing is that Android didnt block it even if the characteristic was not well implemented.

randdusing commented 7 years ago

Android seems to be a little less stringent but pretty buggy. Where as iOS is pretty strict and tends to be pretty robust. Perhaps there is some sort of correlation there :)

weihuaronaldo commented 6 years ago

Hi @LucasChapuis, we have met the same problem. Our app failed to set notification while the characteristics descriptor missing. But in case, the problem comes when we use the newest 5th generation ipad with LightBlue, while other devices (such as iphone6s, ipad mini 2) is OK. Any ideas to solve it?

hardikdarji commented 5 years ago

Hi I have the same issue with iOS for Bosch XDK device for service with UUID: 5A211D40-7166-11E4-82F8-0800200C9A66 is XDK-Accelerometer And below is characteristics: Accelerometer X-Axis int16_t 5a211d41-7166-11e4-82f8-0800200c9a66 Accelerometer Y-Axis int16_t 5a211d42-7166-11e4-82f8-0800200c9a66 Accelerometer Z-Axis int16_t 5a211d43-7166-11e4-82f8-0800200c9a66

I am trying to notify to get x,y,z characteristics but get en error:

Error Domain=CBATTErrorDomain Code=10 "The attribute could not be found." UserInfo={NSLocalizedDescription=The attribute could not be found.} Notification can't begin on characteristic

Any help for how to solve this?