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

Integration of Bond Management Service in GATT Server Profile

Hi ,
I would want to establish a GATT Server application as well as integrate Bond Management Service from glucose example (ble_app_gls) in examples folder of SDK15.3.0_59ac345 into my GATT Server Application. How to integrate this service into GATT Server application. What are the dependencies which I need to take care of while integrating this service.

Parents Reply
  • The first error is because of nrf_power_clock.c no longer exist in SDK 15.3, and the example was made for an earlier SDK version. It has been split in two files, nrfx_clock.c and nrfx_power.c. But you can still refer to the example since you should anyway modify the BMS example and not the other way around (that has most of what you need), so there is no reason to use the segger project form the custom service example.

    Thank you ! When I try to get connected to BMS service, the device gets connected for only few seconds. Then it asks for Bonding request as a pairing pop up, if I click on PAIR & CONNECT , it says pairing rejected by NORDIC_BMS . Then the connection gets disconnected . I actually dont need BONDING setup . NOT BONDED is the one which I am looking out for . Please advise .

Children
  • Hi,

    You can set SEC_PARAM_BOND to 0 in the main.c of the BMS example (in that case there will still be pairing, but no bonding). However, it is a bit strange... How can it make sense to include the BMS if you don't want to use bonding?

    Update: it just came to me that you did not intend to use BMS, I just forget every time I read the title of this case Slight smile  Obviously in that case you should start with the GLS example (if you are sure GLS is what you need?) instead of the BMS example. This also includes DIS, so the earlier posts are still valid. And you can disable bonding here by setting SEC_PARAM_BOND to 0, as mentionned before.

    Note that the GLS characteristics require security, so it will not work without being paired. Do you intend to remove pairing as well? If so, you can do that (stript out all peer manager related code), but you also have to update the security modes for the characteristics. In practice, replace all instances of SEC_JUST_WORKS with SEC_OPEN in the main.c of the example.

  • You can set SEC_PARAM_BOND to 0 in the main.c of the BMS example (in that case there will still be pairing, but no bonding)

    I am getting an error after doing this ! The code gets redirected to NRF_BREAKPOINT_COND .

    Is there any other parameter that I need to change ?

    I want bond management service just to have read/write characteristic access. 

  • Hi,

    Jaydev Borkar said:
    Is there any other parameter that I need to change ?

    I can see that an error has been detected, but not what error. Please build the debug target (Select "Debug" in the dropdown menue in the upper left part of the screen when not in debug mode). If you also enable logging, you will get a log printed when there is an error. If not, inspect p_info etc. to see what error you got where. It will tell you which file, at which line you got which error code.

    Jaydev Borkar said:
    I want bond management service just to have read/write characteristic access. 

    I don't understand. Why do you want BMS when you are not using bonding? The whole purpose of BMS is to manage bonds, but there will not be any if you don't support bonding. 

  • I can see that an error has been detected, but not what error. Please build the debug target (Select "Debug" in the dropdown menue in the upper left part of the screen when not in debug mode). If you also enable logging, you will get a log printed when there is an error. If not, inspect p_info etc. to see what error you got where. It will tell you which file, at which line you got which error code.

    I enabled logging using PUTTY . I get error 7. NRF_ERROR_INVALID_PARAM. I have put in many log details in each of the functions .. Please check the below screenshot .

    I don't understand. Why do you want BMS when you are not using bonding? The whole purpose of BMS is to manage bonds, but there will not be any if you don't support bonding.

    BMS was used in our previous implementation just to have read and write characteristic access. We could have used any other service . But we ended up taking BMS .  So I wanted to replicate the same in new project . 

  • Hi,

    Jaydev Borkar said:

    I enabled logging using PUTTY . I get error 7. NRF_ERROR_INVALID_PARAM. I have put in many log details in each of the functions .. Please check the below screenshot .

    I see. The error code is typically returned from a function call and then detected by an APP_ERROR_CHECK(), which is on line 735 in your modified BMS example. Which function returns this error code? When you know the function and the error code you can start to check what would cause that function to return the specific error code. Often it will be quite obvious, but sometimes it requires a bit more digging.

Related