apache-mynewt-bot removed a comment on issue #790: nimble/store: Fix nimble 
store behavior when CCCDs exceed static defined limit
URL: https://github.com/apache/mynewt-nimble/pull/790#issuecomment-608445002
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### nimble/host/src/ble_store_util.c
   <details>
   
   ```diff
   @@ -322,36 +322,36 @@
        switch (event->event_code) {
        case BLE_STORE_EVENT_OVERFLOW:
            switch (event->overflow.obj_type) {
   -            case BLE_STORE_OBJ_TYPE_OUR_SEC:
   -            case BLE_STORE_OBJ_TYPE_PEER_SEC:
   -                return ble_gap_unpair_oldest_peer();
   -            case BLE_STORE_OBJ_TYPE_CCCD:
   -                if (( rc = ble_gap_unpair_oldest_peer()) == BLE_HS_ENOENT) {
   -                    /* No peer to unpair in overflow event. Here bonds do 
not
   -                     * exist but CCCDs are stored. Need to delete CCCDs of
   -                     * other peer address to make space.*/
   -                    rc = ble_store_util_subscribed_cccds(&peer_id_addr,
   +        case BLE_STORE_OBJ_TYPE_OUR_SEC:
   +        case BLE_STORE_OBJ_TYPE_PEER_SEC:
   +            return ble_gap_unpair_oldest_peer();
   +        case BLE_STORE_OBJ_TYPE_CCCD:
   +            if ((rc = ble_gap_unpair_oldest_peer()) == BLE_HS_ENOENT) {
   +                /* No peer to unpair in overflow event. Here bonds do not
   +                 * exist but CCCDs are stored. Need to delete CCCDs of
   +                 * other peer address to make space.*/
   +                rc = ble_store_util_subscribed_cccds(&peer_id_addr,
                                                             &num_peers, 1,
   -                                                         (void *) 
&event->overflow.value->cccd.peer_addr);
   -                    if (rc != 0) {
   -                        return rc;
   -                    } else if (num_peers == 0) {
   -                        return BLE_HS_ENOMEM;
   -                    }
   -
   -                    union ble_store_key key = {0};
   -                    key.cccd.peer_addr = peer_id_addr;
   -
   -                    rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_CCCD, 
&key);
   -                    if (rc != 0) {
   -                        return rc;
   -                    }
   +                                                     (void *) 
&event->overflow.value->cccd.peer_addr);
   +                if (rc != 0) {
   +                    return rc;
   +                } else if (num_peers == 0) {
   +                    return BLE_HS_ENOMEM;
                    }
    
   -                return rc;
   -
   -            default:
   -                return BLE_HS_EUNKNOWN;
   +                union ble_store_key key = {0};
   +                key.cccd.peer_addr = peer_id_addr;
   +
   +                rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_CCCD, 
&key);
   +                if (rc != 0) {
   +                    return rc;
   +                }
   +            }
   +
   +            return rc;
   +
   +        default:
   +            return BLE_HS_EUNKNOWN;
            }
    
        case BLE_STORE_EVENT_FULL:
   ```
   
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to