noble/bleno

Secure Read with iOS 9.3.1

Open

#187 opened on Apr 13, 2016

View on GitHub
 (13 comments) (0 reactions) (0 assignees)JavaScript (2,083 stars) (465 forks)batch import
help wanted

Description

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));
  }
});

Contributor guide