apache-mynewt-bot commented on PR #1402:
URL: https://github.com/apache/mynewt-nimble/pull/1402#issuecomment-1293258169

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### nimble/host/include/host/ble_gattc_cache.h
   <details>
   
   ```diff
   @@ -37,4 +37,4 @@
    }
    #endif
    
   -#endif          
   +#endif
   ```
   
   </details>
   
   #### nimble/host/include/host/ble_hash_function.h
   <details>
   
   ```diff
   @@ -7,15 +7,15 @@
     * "License"); you may not use this file except in compliance
     * with the License.  You may obtain a copy of the License at
     *
   -  *  http://www.apache.org/licenses/LICENSE-2.0
   -  *
   -  * Unless required by applicable law or agreed to in writing,
   -  * software distributed under the License is distributed on an
   -  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   -  * KIND, either express or implied.  See the License for the
   -  * specific language governing permissions and limitations
   -  * under the License.
   -  */
   + *  http://www.apache.org/licenses/LICENSE-2.0
   + *
   + * Unless required by applicable law or agreed to in writing,
   + * software distributed under the License is distributed on an
   + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   + * KIND, either express or implied.  See the License for the
   + * specific language governing permissions and limitations
   + * under the License.
   + */
    
    #ifndef H_BLE_HASH_FUNCTION_
    #define H_BLE_HASH_FUNCTION_
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc_cache.c
   <details>
   
   ```diff
   @@ -211,7 +211,7 @@
        return INVALID_ADDR_NUM;
    }
    
   -static uint8_t 
   +static uint8_t
    ble_gattc_cache_find_hash(ble_hash_key hash_key)
    {
        uint8_t index = 0;
   @@ -302,14 +302,14 @@
    
            if ((index = ble_gattc_cache_find_addr(addr)) != INVALID_ADDR_NUM) {
                ESP_LOGD(TAG, "tBD address already present in the cache list");
   -            
   +
                /* If the bd_addr already in the address list, update the hash 
key in it. */
                insert_ind = index;
            } else {
   -            /* 
   -                If the bd_addr isn't in the address list, added the bd_addr 
to the last of the 
   +            /*
   +                If the bd_addr isn't in the address list, added the bd_addr 
to the last of the
                    address list.
   -              */
   +             */
                ESP_LOGD(TAG, "BD addr not present");
                insert_ind = num - 1;
            }
   @@ -317,7 +317,7 @@
            ESP_LOGD(TAG, "Hash key not present, saving new data");
            insert_ind = num - 1;
        }
   - 
   +
        print_hash_key(hash_key);
        print_addr(addr);
    
   @@ -510,15 +510,15 @@
            case BLE_GATT_ATTR_TYPE_CHAR_DESCR:
                rc = ble_gattc_add_dsc_from_cache(peer_addr, nv_attr[i]);
                break;
   -    
   +
            default:
                break;
            }
        }
        free(nv_attr);
        cache_index = ble_gattc_cache_find_addr(peer_addr);
   -    ble_gattc_p_load_hash(cache_env->cache_addr[cache_index].addr, 
   -                          cache_env->cache_addr[cache_index].hash_key); 
   +    ble_gattc_p_load_hash(cache_env->cache_addr[cache_index].addr,
   +                          cache_env->cache_addr[cache_index].hash_key);
        return rc;
    }
    
   @@ -578,7 +578,7 @@
    
            /* Read previously saved blob if available */
            if ((rc = nvs_get_blob(fp, cache_key, p_buf, &length)) != ESP_OK) {
   -            if(rc != ESP_ERR_NVS_NOT_FOUND) {
   +            if (rc != ESP_ERR_NVS_NOT_FOUND) {
                    ESP_LOGE(TAG, "%s, Line = %d, nvs flash get blob data fail, 
err_code = 0x%x",
                             __func__, __LINE__, rc);
                }
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc_peer.c
   <details>
   
   ```diff
   @@ -71,12 +71,12 @@
    struct ble_gattc_p *
    ble_gattc_p_find_by_addr(ble_addr_t peer_addr)
    {
   -    struct ble_gattc_p *ble_gattc_p;    
   +    struct ble_gattc_p *ble_gattc_p;
        SLIST_FOREACH(ble_gattc_p, &ble_gattc_ps, next) {
            if (memcmp(&ble_gattc_p->ble_gattc_p_addr, &peer_addr, 
sizeof(peer_addr)) == 0) {
                return ble_gattc_p;
            }
   -    }   
   +    }
        return NULL;
    }
    
   @@ -146,7 +146,7 @@
            assert(0);
            return BLE_HS_EUNKNOWN;
        }
   -    
   +
        if (chr_val_handle == 0) {
            chr = ble_gattc_p_chr_find_handle(svc, gatt_dsc->handle);
        } else {
   @@ -300,7 +300,7 @@
        if (svc == NULL) {
            /* Can't find service for discovered characteristic; this shouldn't
             * happen.
   -         */ 
   +         */
            assert(0);
            return BLE_HS_EUNKNOWN;
        }
   @@ -325,7 +325,7 @@
        } else {
            SLIST_NEXT(prev, next) = chr;
        }
   - 
   +
    #if MYNEWT_VAL(BLE_GATT_CACHING)
        ble_gattc_db_hash_chr_present(chr->chr.uuid.u16);
    #endif
   ```
   
   </details>
   
   #### nimble/host/src/ble_hash_function.c
   <details>
   
   ```diff
   @@ -7,31 +7,32 @@
     * "License"); you may not use this file except in compliance
     * with the License.  You may obtain a copy of the License at
     *
   -  *  http://www.apache.org/licenses/LICENSE-2.0
   -  *
   -  * Unless required by applicable law or agreed to in writing,
   -  * software distributed under the License is distributed on an
   -  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   -  * KIND, either express or implied.  See the License for the
   -  * specific language governing permissions and limitations
   -  * under the License.
   -  */
   + *  http://www.apache.org/licenses/LICENSE-2.0
   + *
   + * Unless required by applicable law or agreed to in writing,
   + * software distributed under the License is distributed on an
   + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   + * KIND, either express or implied.  See the License for the
   + * specific language governing permissions and limitations
   + * under the License.
   + */
    
    #include <string.h>
    #include "host/ble_hash_function.h"
    
   -void ble_hash_function_blob(const unsigned char *s, unsigned int len, 
ble_hash_key h)
   +void
   +ble_hash_function_blob(const unsigned char *s, unsigned int len, 
ble_hash_key h)
    {
        size_t j;
    
        while (len--) {
   -        j = sizeof(ble_hash_key)-1; 
   -        
   +        j = sizeof(ble_hash_key)-1;
   +
            while (j) {
                h[j] = ((h[j] << 7) | (h[j-1] >> 1)) + h[j];
                --j;
   -        }  
   -        
   +        }
   +
            h[0] = (h[0] << 7) + h[0] + *s++;
        }
    }
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -43,28 +43,31 @@
            .type = BLE_GATT_SVC_TYPE_PRIMARY,
            .uuid = BLE_UUID16_DECLARE(BLE_GATT_SVC_UUID16),
            .characteristics = (struct ble_gatt_chr_def[]) { {
   -            .uuid = 
BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16),
   -            .access_cb = ble_svc_gatt_access,
   -            .val_handle = &ble_svc_gatt_changed_val_handle,
   -            .flags = BLE_GATT_CHR_F_INDICATE,
   -        },
   +                                                             .uuid = 
BLE_UUID16_DECLARE(
   +                    BLE_SVC_GATT_CHR_SERVICE_CHANGED_UUID16),
   +                                                             .access_cb = 
ble_svc_gatt_access,
   +                                                             .val_handle = 
&ble_svc_gatt_changed_val_handle,
   +                                                             .flags = 
BLE_GATT_CHR_F_INDICATE,
   +                                                         },
    #if MYNEWT_VAL(BLE_GATT_CACHING)
   -        {
   -            .uuid = 
BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEATURES_UUID16),
   -            .access_cb = ble_svc_gatt_access,
   -            .val_handle = &ble_svc_gatt_client_supp_feature_handle,
   -            .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   -        },
   -        {
   -            .uuid = 
BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_DATABASE_HASH_UUID16),
   -            .access_cb = ble_svc_gatt_access,
   -            .val_handle = &ble_svc_gatt_db_hash_handle,
   -            .flags = BLE_GATT_CHR_F_READ,
   -        },
   +                                                         {
   +                                                             .uuid = 
BLE_UUID16_DECLARE(
   +                    BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEATURES_UUID16),
   +                                                             .access_cb = 
ble_svc_gatt_access,
   +                                                             .val_handle = 
&ble_svc_gatt_client_supp_feature_handle,
   +                                                             .flags = 
BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   +                                                         },
   +                                                         {
   +                                                             .uuid = 
BLE_UUID16_DECLARE(
   +                    BLE_SVC_GATT_CHR_DATABASE_HASH_UUID16),
   +                                                             .access_cb = 
ble_svc_gatt_access,
   +                                                             .val_handle = 
&ble_svc_gatt_db_hash_handle,
   +                                                             .flags = 
BLE_GATT_CHR_F_READ,
   +                                                         },
    #endif
   -        {
   -            0, /* No more characteristics in this service. */
   -        } },
   +                                                         {
   +                                                             0, /* No more 
characteristics in this service. */
   +                                                         } },
        },
    
        {
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_svr.c
   <details>
   
   ```diff
   @@ -1710,7 +1710,7 @@
                                             &err_handle);
    
    #if MYNEWT_VAL(BLE_GATT_CACHING)
   -    done:
   +    done :
    #endif
        return ble_att_svr_tx_rsp(conn_handle, rc, txom, 
BLE_ATT_OP_READ_MULT_REQ,
                                  att_err, err_handle);
   ```
   
   </details>
   
   #### nimble/host/src/ble_gatts.c
   <details>
   
   ```diff
   @@ -499,7 +499,7 @@
        }
    
        index_nv_attr++;
   -} 
   +}
    
    int
    s_handle_compare(const void *s1, const void *s2)
   ```
   
   </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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to