noble/bleno

Secure Read with iOS 9.3.1

Open

#187 aperta il 13 apr 2016

Vedi su GitHub
 (13 commenti) (0 reazioni) (0 assegnatari)JavaScript (465 fork)batch import
help wanted

Metriche repository

Star
 (2083 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I'm having difficulty completing a secure read between an iPad Air running iOS 9.3.1 and a Raspberry Pi running Node 4.2.6 and Bleno 0.4.0.

The iPad first attempts a read request after connecting and receives this response.

Error Domain=CBATTErrorDomain Code=15 "Encryption is insufficient." UserInfo={NSLocalizedDescription=Encryption is insufficient.}

At this point the iPad displays a system prompt asking the user if it would like to pair with the Raspberry Pi, and I tap "Pair". My understanding is this is the expected protocol, and now the iPad and Pi should be paired.

But on the next read request to the same characteristic I receive another error:

Error Domain=CBATTErrorDomain Code=5 "Authentication is insufficient." UserInfo={NSLocalizedDescription=Authentication is insufficient.}

All further read requests will continue to respond with this second error.

Here is how I'm defining the characteristic with Bleno:

new bleno.Characteristic({
  uuid: "uuid here",
  properties: ["read"],
  secure: ["read"],
  onReadRequest: function (offset, callback) {
    callback(bleno.Characteristic.RESULT_SUCCESS, Buffer(message));
  }
});

Guida contributor