This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PIN access on app for BLE device

I would like to know how to create a prompt that asks for a PIN before a user gets access to pairing to a BLE peripheral. Currently I'm using a CurieBot and once it's found via the app, you can click it and gain access to it.

  • When the CurieBot gets a pairing request from the smart phone it must include that it has a display in the pairing response, see this.

    Then you would need to have some way of displaying the pin that should be put into the smart phone, or maybe you can set it static, see this.

  • I'm a beginner at coding and the two links there are not helping my confusion. Is it that this is code in a diagram form? Is it a library? Can I enter this directly into my code once I have this library? What I'm getting is that I have to code the pairing key on the Arduino 101 side, then code a display to enter this passkey on the app side, and I would like the key static so the second link is supposed to be helpful to me but I just don't get it. I apologize in advance for my incompetence but I am really struggling to understand BLE as it is not nearly straightforward. If you can answer my questions above and give a more detailed description on how I go about this, it would be much appreciated.

  • Sorry to confuse you. The links are to message sequence charts (MSCs), showing which SoftDevice functions and events that are important to do a specific task.

    You probably have a SoftDevice in the nRF51822 in the Intel Curie, but you probably have a different API than the functions in the MSC. What API are you using to access the nRF51822? What functionality does the API provide?

    If you don't use a static key, you must have a display or some other means of showing the random pin generated so that this can be put into the smart phone.

    No need to apologize, we are here to help :) Just be aware, that the CurieBot isn't our product, I have never used it, but I will try to help you as much as I can.

  • I do want to use a static key because the Arduino 101 + CurieBot does not have a display on it and I do not plan on adding one so just a simple static key can do. With respect to the APIs, I am not sure but it is definitely not the same functions as the MSCs. I am not sure how I am supposed to know what APIs I'm using but I can send you a link to the libraries: www.arduino.cc/.../CurieBLE

    I don't know if it's possible to use Nordic APIs on the Arduino Sketch (this is used to write the code for the Arduino 101/CurieBot in C language). I want to get something clear, are you saying that the static key is created and set from the Peripheral side of the code(The CurieBot, Arduino Sketch) or is it at the central side of the code(The app, Android Studio) or is it both? Well I assume it's both because I have to be able to display a prompt for the static pin to be entered.

  • Also, BLE is built into the Arduino 101 and it is not a module like the nRF51822. Or are you saying that the nRF51822 is integrated into the Arduino 101? I don't think I am accessing the nRF51822, I'm accessing the Arduino 101, correct me if I'm wrong because I am not 100% sure.

Related