Page 1 of 1

How to encrypt the "gatt_server" Bluetooth program?

Posted: Sat Dec 15, 2018 1:39 am
by Daniel
How to encrypt the "gatt_server" https://github.com/espressif/esp-idf/tr ... att_serverBluetooth program? Just like the example "gatt_security_serverhttps://github.com/espressif/esp-idf/tr ... ity_server".

thanks,
Daniel

Re: How to encrypt the "gatt_server" Bluetooth program with two Bluetooth services?

Posted: Sat Dec 15, 2018 11:37 am
by chegewara
Here is your answer.
Daniel wrote: Just like the example "gatt_security_serverhttps://github.com/espressif/esp-idf/tr ... ity_server".
What else do you want to know or what you dont understand?

Re: How to encrypt the "gatt_server" Bluetooth program with two Bluetooth services?

Posted: Mon Dec 17, 2018 1:27 am
by Daniel
chegewara wrote:
Sat Dec 15, 2018 11:37 am
Here is your answer.
Daniel wrote: Just like the example "gatt_security_serverhttps://github.com/espressif/esp-idf/tr ... ity_server".
What else do you want to know or what you dont understand?
When I encrypt with two services Bluetooth, there are two cases:
On the IOS system: the first connection is successful, but the second time you must ignore the device in the settings, otherwise you will not be able to connect to it again the second time.
On Android: Everything is connected properly on Android.
The software used is "nrf connect".
This is my previous result.
But now,when I wrote the encrypted program, I found that I didn't know how to put the encrypted code in the right place. It is also very different from the encryption of "gatt_security_server"https://github.com/espressif/esp-idf/tr ... ity_server .
My question is that if I want to encrypt the "gatt_server" demo,how do I put the encryption code in the correct location, just like "gatt_security_server"? I think their encryption methods are very different, because the Bluetooth encryption of a service is very different from the two services.
Thanks
Daniel

Re: How to encrypt the "gatt_server" Bluetooth program?

Posted: Mon Dec 17, 2018 9:15 am
by chegewara
Hi,
there is no difference between setting up secure connection for one or many services, because you dont secure services. Service is just logical unit that aggregates characteristics.

Now, you may want or not to secure characteristics and descriptors with proper permission access (read/write with or without authentication). When you setup characteristic with authentication then authentication process will start on first read/write characteristic. Therefor you have also gap authentication process you may want or not to add. In this case authentication will be requested on connection.

Re: How to encrypt the "gatt_server" Bluetooth program with two Bluetooth services?

Posted: Tue Mar 05, 2019 7:07 am
by Daniel
Daniel wrote:
Mon Dec 17, 2018 1:27 am
chegewara wrote:
Sat Dec 15, 2018 11:37 am
Here is your answer.
Daniel wrote: Just like the example "gatt_security_serverhttps://github.com/espressif/esp-idf/tr ... ity_server".
What else do you want to know or what you dont understand?
When I encrypt with two services Bluetooth, there are two cases:
On the IOS system: the first connection is successful, but the second time you must ignore the device in the settings, otherwise you will not be able to connect to it again the second time.
On Android: Everything is connected properly on Android.
The software used is "nrf connect".
This is my previous result.
But now,when I wrote the encrypted program, I found that I didn't know how to put the encrypted code in the right place. It is also very different from the encryption of "gatt_security_server"https://github.com/espressif/esp-idf/tr ... ity_server .
My question is that if I want to encrypt the "gatt_server" demo,how do I put the encryption code in the correct location, just like "gatt_security_server"? I think their encryption methods are very different, because the Bluetooth encryption of a service is very different from the two services.
Thanks
Daniel

Here is the answer ,https://github.com/DanielXie00/gatt_server_3.1.1