This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BLE how to prevent connection

Other Parts Discussed in Thread: CC2540

Hi,

I am using a CC2540 on my product and I want to limit the connection. My best case would be to hardcode something in my device and then hardcode the same thing in my apps. So both side would be able to connect in a way the user doesn't have to interact.

I cannot use the passcode, because iOS won't let you initiate the passcode process in an apps, the passkey has to be entered by the user. Anyone has an idea how I could acheive my goal?

My goal is mostly to prevent a write to an attribute. That's why I was thinking to limit the connection. But I could also use any encryption scheme to my attribute. I tried to think of an algorithm to use but I can't find one.

Best regards,
Jerome

  • Hi Jerome,

    Well, do you have to use security in your solution? You could use GATT_PERMIT_AUTHOR_READ property on the attribute to make a decision in the (embedded) application if the connected device is allowed to read the attribute. The same goes for the write operation. You would however have to create the checkpoint for the Permit yourself as we do not have any example code for this use case.

    I hope I haven't misunderstood your intent here. 

    Best Regards

    Joakim

  • Hi Joakim,

    You're right, I don't "need" security, I just thought that I could achieve my goal by using it.

    One way to limit read/write could be to deny it until the application writes a special code in an attribute. So I would know that it is my program that's trying to read or write. I would probably need to use encryption so no one could sniff the connection and see what data to write.

    I'm not sure if it's what you were suggesting, but that could work.

    Best regards,
    Jerome