This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to increase the maximum number of characteristics per service supported by this module?

Hello,

I'm working on a project with SoftDevice s120. I played with the project ble_app_multilink_central. The maximum number of characteristics per service supported by a module is 3. But I have a module have a service with 8 characteristics.

How to increase the maximum number of characteristics per service supported by this module?

I try to change the BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV in "ble_db_discovery.h" to 8. The module will hang when it initialize.

#define BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV   3

Maximum number of characteristics per service supported by this module.

Edit: format.

Parents
  • You should be able to increase it, if you only have 1 service with 8 characteristics, you should be able to set

    #define BLE_DB_DISCOVERY_MAX_SRV          1  /**< Maximum number of services supported by this module. This also indicates the maximum number of users allowed to be registered to this module. (one user per service). */
    #define BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV 8  /**< Maximum number of characteristics per service supported by this module. */
    

    I find it a bit hard to believe that the module hangs on init, since the init only consists of:

    uint32_t ble_db_discovery_init(void)
    {
        m_num_of_handlers_reg      = 0;
        m_initialized              = true;
        m_num_of_discoveries_made  = 0;
        m_pending_usr_evt_index    = 0;
    
        return NRF_SUCCESS;
    }
    
Reply
  • You should be able to increase it, if you only have 1 service with 8 characteristics, you should be able to set

    #define BLE_DB_DISCOVERY_MAX_SRV          1  /**< Maximum number of services supported by this module. This also indicates the maximum number of users allowed to be registered to this module. (one user per service). */
    #define BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV 8  /**< Maximum number of characteristics per service supported by this module. */
    

    I find it a bit hard to believe that the module hangs on init, since the init only consists of:

    uint32_t ble_db_discovery_init(void)
    {
        m_num_of_handlers_reg      = 0;
        m_initialized              = true;
        m_num_of_discoveries_made  = 0;
        m_pending_usr_evt_index    = 0;
    
        return NRF_SUCCESS;
    }
    
Children
  • Peter, thanks for this responce and responce in this post.

    But if in "file ble_db_discovery.h" I change BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV and BLE_DB_DISCOVERY_MAX_SRV, source code of SoftDevice will be customized. This is no good.

    Second: Is the MCP use S120 to discover any devices? MCP do not have limit to max charecteristics per service. In my peripherial I use 1 service with 4 charecteristics and MCP discover all char-s.

    What to do?

  • I'm glad you liked my answer :)

    You will not change the SoftDevice, you can't change the SoftDevice. The Database Discovery Module source code will change, and since it's a library these changes will be for all projects that use the library. Ideally it should have a config file that is project specific. I have reported this, but it is what it is. You should be able to copy the library to your project folder, modify them and include them (exclude the old library).

    I don't really understand your other question.I would appriciate if you could create a new question and link to this one if it's relevant.

  • Thanks, Peter! In first question I said not exactly. Of course, not SoftDevice, but library source is changed. In general, I do so as you said: copy all needed libraryes into project folder and include them.

    my second question

  • I got the resolve method from nordic support email. Here's the original text:

    Actually, when I modify BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV to 4, the compiler flagged me of error due to not enough memory.

    Please ask the customer to modify the arm_startup_nrf51.s as shown below. This will allow them to free up 2k of memory reserved as heap which is not being used (no memory > allocation function being called in this project).

    Please look the picture.

Related