-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing docs for startNotification result. #1005
Comments
@fudom the array there gets flattened out by the callback when returning to javascript. I.e., the success callback on the javascript side is effectively a function like Having said that, it looks like I broke the Just as an aside, the use of In general, I work very hard to ensure no breaking changes 🙂 . I'll clarify the types and documentation around this. Thanks for noticing! |
There is a lack of information in the startNotification docs.
It seems that the received result is an array
[dataBuffer, nextSequenceNumber]
(type:[ArrayBuffer, number]
). There is an example withdata[0]
. But you don't see, why using the first index here. After digging into the code, I found that the second index is a next sequence number - whatever that is.cordova-plugin-ble-central/src/android/SequentialCallbackContext.java
Lines 39 to 49 in 1727fd1
I'm not sure what the result is on iOS. And is sequence number required? What is the use case? But at least, this should be visible in the docs.
In the types.d.ts is only the
ArrayBuffer
. Is this correct? I'm confused. Update: It seems to be correct. Not sure why the[dataBuffer, nextSequenceNumber]
. Tested withwithPromises.startNotification
.cordova-plugin-ble-central/types.d.ts
Lines 154 to 160 in 1727fd1
Btw. avoid
any
type. In this case, why should callback return any? Just usevoid
. I would also be consistent on variable naming. The convention is JS is camelCase.The text was updated successfully, but these errors were encountered: