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

SDK9.0 err_code DM_DEVICE_CONTEXT_FULL

Hi there! I added ANCS to my project which contains services nus, dis, dfus and two other custom services. Everything seems OK except device manager. I paired the device with iPhone 6 plus(iOS 9.1), and then forget the device. Once attempts exceed DEVICE_MANAGER_MAX_BONDS, error code DM_DEVICE_CONTEXT_FULL was returned. But I tested the ANCS project in the same way, there isn't exception. I didn't change anything about ANCS, dfus in SDK. I compared the codes in the two projects' file main.c, I can't find what I'm missing. When I forget the device in iPhone, I can find connection_instance_free() was called. Does anyone have suggestions? THANKS!

  • There's a set amount of bonds you can store which is configured in device_manager_cnfg.h. Once this limit is reached the application has to erase one or more bonds to accept new devices to be added. DM_DEVICE_CONTEXT_FULL will be reported to the application when trying to pair with a new device while bond table is already full.

    Actually reaching the maximum bonds (typically 8 devices) may not happen very often depending on the use case for the product you are making. In that case the easiest solution is probably to have an option of erasing all bonds in case this happen. We also have an example showing how you can automatically clear the least recently stored bond on our github page.

  • Thank you, Vidar! I tried in this way, and things are fine. By the way, if Android phone connect to this kind of devices with ANCS, many asserts may stop the process. Do this kind of devices just support iOS?

Related