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

Can't get characteristics list of a service #54

Open
surajit-bitcanny opened this issue Aug 1, 2017 · 3 comments
Open

Can't get characteristics list of a service #54

surajit-bitcanny opened this issue Aug 1, 2017 · 3 comments

Comments

@surajit-bitcanny
Copy link

surajit-bitcanny commented Aug 1, 2017

I want to get all characteristics list of a service. Every time I get empty characteristics array. I have used following ways to get characteristics list:

  • `service.discoverCharacteristics(null, function(error, characteristics) {

          });`
    
  • service.once('characteristicsDiscover', (characteristics)=>{ }); service.discoverCharacteristics();

Both of these approaches do not work.

@surajit-bitcanny
Copy link
Author

It is solved by setting minSdkVersion to 21 for Android.

@nielsswinkels
Copy link

Cool that you found a solution! Here the solution was to search for specific characteristics by supplying the uuid.

@bitabs
Copy link

bitabs commented Feb 2, 2018

@nielsswinkels I'm having the same issue even though the minSdkVersion is set to 21.

I have it like this:

....
this._rfduinoService.once("characteristicsDiscover", (characteristics) => {
        console.log("here: ", characteristics);
        if (this.options.verbose) console.log('Discovered ' + characteristics.length + ' service characteristics');
        for (let i = 0; i < characteristics.length; i++) {
          // console.log(characteristics[i].uuid);
          if (characteristics[i].uuid === k.RFduinoUuidReceive || characteristics[i].uuid === rfduinoUuidReceiveLong) {
            if (this.options.verbose) console.log("Found receiveCharacteristicUUID");
            this._receiveCharacteristic = characteristics[i];
          }
          if (characteristics[i].uuid === k.RFduinoUuidSend || characteristics[i].uuid === rfduinoUuidSendLong) {
            if (this.options.verbose) console.log("Found sendCharacteristicUUID");
            this._sendCharacteristic = characteristics[i];
          }
        }
....

Where this._rfduinoService is:
capture

@jacobrosenthal any ideas?

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

3 participants