Skip to content
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

How can I get any incoming message(without using Feature class) and send it to external parser? #18

Open
AviyaSmila opened this issue May 2, 2019 · 7 comments

Comments

@AviyaSmila
Copy link

How can I get any incoming message(without using Feature class) and send it to external parser?

@GiovanniVisentiniST
Copy link
Contributor

why you can't parse it inside the Feature?

by the way all the SDK is based on Feature, if you don't use it you can't enable notification/read characteristics ecc..

you can do a feature that copies all the data inside the Sample class end then do the parsing inside the onUpgrade method.. but the feature.extractData method exist to do the message parsing..

you can look to this class if you want to see something where not all parsing is done inside the extractData method: FFTAmplitude

@AviyaSmila
Copy link
Author

OK, how is the SDK map the incoming data to the relevant feature?

@GiovanniVisentiniST
Copy link
Contributor

yes exactly.
After that you register a the Feature class (mapping the UUID with the class that will manage it) you can forget the UUID the sdk will take care to see if it present and do the correct operation on it, and will present you the parsed data.

@AviyaSmila
Copy link
Author

Ok.
But how is this happening?
Our BLE device isn`t ready yet and I want to get to know how the data processing is happening in the SDK

@GiovanniVisentiniST
Copy link
Contributor

✨ Magic ✨ 😜
and something related to this code:

for (BluetoothGattCharacteristic characteristic : service.getCharacteristics()) {

@AviyaSmila
Copy link
Author

OK, Im starting to get it... another question - when I get the features of the node via the getfeatures() method the list dosent include the custom features which ive added..
how can I get those?

@GiovanniVisentiniST
Copy link
Contributor

you can request directly your feature with this:
getFeature

your custom char should be attached to the Node with this if:

}else if(mExternalCharFeatures!=null &&

if your custom feature is not present:
1- you register it in a wrong way
2- the UUID is not present in the device
3- there is a bug in the sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants