[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-16 Thread GitBox
apache-mynewt-bot commented 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-614727452
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-16 Thread GitBox
apache-mynewt-bot commented 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-614615008
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-08 Thread GitBox
apache-mynewt-bot commented 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-610780987
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-07 Thread GitBox
apache-mynewt-bot commented 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-610629250
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-07 Thread GitBox
apache-mynewt-bot commented 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-610579980
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-07 Thread GitBox
apache-mynewt-bot commented 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-610477940
 
 
   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    nimble/host/src/ble_gap.c
   
   
   ```diff
   @@ -5623,8 +5621,7 @@
}

for (i = 0; i < num_peers; i++) {
   -if (memcmp(curr_peer, _peer_id_addr[i], sizeof (ble_addr_t)) 
!= 0)
   -{
   +if (memcmp(curr_peer, _peer_id_addr[i], sizeof (ble_addr_t)) 
!= 0) {
break;
}
}
   ```
   
   
   
    nimble/host/src/ble_store_util.c
   
   
   ```diff
   @@ -341,7 +341,7 @@
key.cccd.peer_addr = peer_cccd_addrs[i];

for (j = 0; j < num_bonded_peers; j++) {
   -if(memcmp(_cccd_addrs[i], _bonded_addrs[j],
   +if (memcmp(_cccd_addrs[i], _bonded_addrs[j],
  sizeof(ble_addr_t)) == 0) {
break;
}
   @@ -385,7 +385,7 @@
case BLE_STORE_OBJ_TYPE_CCCD:
/* Try to remove unbonded CCCDs first */
if ((rc = ble_store_clean_old_cccds((void *) 
>overflow.value->cccd.peer_addr))
   - == BLE_HS_ENOENT) {
   +== BLE_HS_ENOENT) {
/* No unbonded CCCDs found to delete, try unpairing oldest 
peer
 * except current peer */
return ble_gap_unpair_oldest_except_curr((void *) 
>overflow.value->cccd.peer_addr);
   ```
   
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-06 Thread GitBox
apache-mynewt-bot commented 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-609581758
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-03 Thread GitBox
apache-mynewt-bot commented 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-608547695
 
 
   
   
   
   ## Style check summary
   
    No suggestions at this time!
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-03 Thread GitBox
apache-mynewt-bot commented 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-608526892
 
 
   
   
   
   ## 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
   
   
   ```diff
   @@ -326,7 +326,7 @@
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) {
   +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.*/
   ```
   
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-03 Thread GitBox
apache-mynewt-bot commented 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 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
   
   
   ```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(_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(_id_addr,
 _peers, 1,
   - (void *) 
>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, 
);
   -if (rc != 0) {
   -return rc;
   -}
   + (void *) 
>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, 
);
   +if (rc != 0) {
   +return rc;
   +}
   +}
   +
   +return rc;
   +
   +default:
   +return BLE_HS_EUNKNOWN;
}

case BLE_STORE_EVENT_FULL:
   ```
   
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-04-03 Thread GitBox
apache-mynewt-bot commented 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-608441257
 
 
   
   
   
   ## 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
   
   
   ```diff
   @@ -322,34 +322,34 @@
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(_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(_id_addr,
 _peers, 1,
   - (void *) 
>overflow.value->cccd.peer_addr);
   -if ((rc != 0) || (num_peers == 0)) {
   -return rc;
   -}
   -
   -union ble_store_key key = {0};
   -key.cccd.peer_addr = peer_id_addr;
   -
   -rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_CCCD, 
);
   -if (rc != 0) {
   -return rc;
   -}
   + (void *) 
>overflow.value->cccd.peer_addr);
   +if ((rc != 0) || (num_peers == 0)) {
   +return rc;
}

   -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, 
);
   +if (rc != 0) {
   +return rc;
   +}
   +}
   +
   +return rc;
   +
   +default:
   +return BLE_HS_EUNKNOWN;
}

case BLE_STORE_EVENT_FULL:
   ```
   
   


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


[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #790: nimble/store: Fix nimble store behavior when CCCDs exceed static defined limit

2020-03-31 Thread GitBox
apache-mynewt-bot commented 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-606821185
 
 
   
   
   
   ## 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
   
   
   ```diff
   @@ -306,31 +306,31 @@
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:
   -case BLE_STORE_OBJ_TYPE_CCCD:
   -if (( rc = ble_gap_unpair_oldest_peer()) == BLE_HS_ENOENT) {
   -/* No peer to unpair. Here bonds do not exist but CCCDs 
are
   - * stored. Need to delete CCCDs to make space. */
   -rc = ble_store_util_subscribed_cccds(_id_addr,
   +case BLE_STORE_OBJ_TYPE_OUR_SEC:
   +case BLE_STORE_OBJ_TYPE_PEER_SEC:
   +case BLE_STORE_OBJ_TYPE_CCCD:
   +if ((rc = ble_gap_unpair_oldest_peer()) == BLE_HS_ENOENT) {
   +/* No peer to unpair. Here bonds do not exist but CCCDs are
   + * stored. Need to delete CCCDs to make space. */
   +rc = ble_store_util_subscribed_cccds(_id_addr,
 _peers, 1);
   -if ((rc != 0) || (num_peers == 0)) {
   -return rc;
   -}
   -
   -union ble_store_key key = {0};
   -key.cccd.peer_addr = peer_id_addr;
   -
   -rc = ble_store_util_delete_all(BLE_STORE_OBJ_TYPE_CCCD, 
);
   -if (rc != 0) {
   -return rc;
   -}
   +if ((rc != 0) || (num_peers == 0)) {
   +return rc;
}

   -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, 
);
   +if (rc != 0) {
   +return rc;
   +}
   +}
   +
   +return rc;
   +
   +default:
   +return BLE_HS_EUNKNOWN;
}

case BLE_STORE_EVENT_FULL:
   ```
   
   


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