noble/bleno

Secure Read with iOS 9.3.1

Open

#187 创建于 2016年4月13日

在 GitHub 查看
 (13 评论) (0 反应) (0 负责人)JavaScript (2,083 star) (465 fork)batch import
help wanted

描述

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

贡献者指南

Secure Read with iOS 9.3.1 · noble/bleno#187 | Good First Issue