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

Bonding information issue when only one side the bonding is delete

Hi,

sometimes not always, the function peer_id_is_allocated return false and this causes an ASSERT of device, because a NRF_ERROR_INVALID_PARAM is returned by pdb_write_buf_get. And Peer_Manager return an assert.

Someone can help to me, why this happens?

Thanks, Anna

Parents
  • The problem is here:

    ret_code_t pdb_write_buf_get(pm_peer_id_t       peer_id,
                                 pm_peer_data_id_t  data_id,
                                 uint32_t           n_bufs,
                                 pm_peer_data_t   * p_peer_data)
    {
        VERIFY_MODULE_INITIALIZED();
        VERIFY_PARAM_NOT_NULL(p_peer_data);
        VERIFY_DATA_ID_WRITE_BUF(data_id);
        if (   (n_bufs == 0)
            || (n_bufs > N_WRITE_BUFFERS)
            || !pds_peer_id_is_allocated(peer_id))
        {
            return NRF_ERROR_INVALID_PARAM;
        }
    

    the function pds_peer_id_is_allocated(peer_id) return false. But this happens after i delete the bonding information.

    If i read the comment says:

    /**@brief Function for finding out whether a peer ID is in use.
     *
     * @param[in]  peer_id  The peer ID to inquire about.
     *
     * @retval  true   peer_id is in use.
     * @retval  false  peer_id is free, or the module is not initialized.
     */
    bool pds_peer_id_is_allocated(pm_peer_id_t peer_id);
    
Reply
  • The problem is here:

    ret_code_t pdb_write_buf_get(pm_peer_id_t       peer_id,
                                 pm_peer_data_id_t  data_id,
                                 uint32_t           n_bufs,
                                 pm_peer_data_t   * p_peer_data)
    {
        VERIFY_MODULE_INITIALIZED();
        VERIFY_PARAM_NOT_NULL(p_peer_data);
        VERIFY_DATA_ID_WRITE_BUF(data_id);
        if (   (n_bufs == 0)
            || (n_bufs > N_WRITE_BUFFERS)
            || !pds_peer_id_is_allocated(peer_id))
        {
            return NRF_ERROR_INVALID_PARAM;
        }
    

    the function pds_peer_id_is_allocated(peer_id) return false. But this happens after i delete the bonding information.

    If i read the comment says:

    /**@brief Function for finding out whether a peer ID is in use.
     *
     * @param[in]  peer_id  The peer ID to inquire about.
     *
     * @retval  true   peer_id is in use.
     * @retval  false  peer_id is free, or the module is not initialized.
     */
    bool pds_peer_id_is_allocated(pm_peer_id_t peer_id);
    
Children
No Data
Related