You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/03/12 13:42:17 UTC

[GitHub] [mynewt-nimble] rymanluk opened a new pull request #773: nimble: [WIP] Eatt initial implementation

rymanluk opened a new pull request #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773
 
 
   This is initial implementation and not yet completed. Idea is to hide EATT from the application, but instead allow to Host to choose bearer to use. Code pass some PTS test cases related to EATT and new opcodes.
   
   Posted for early comments: TODO list
   * number of TODOs in the code (error paths)
   * handling read/write Client/Server Supported Features  - now it is done in EATT code but should be generic
   * cach above values for bonded devices
   * add/fix unit tests
   * how we want to expose to app sending multiple notifications.
   * expose test API to choose different channels to send data (required by PTS)
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-599796917
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -46,8 +46,8 @@
    
    #define BLE_EATT_DATABUF_SIZE  ( \
            MYNEWT_VAL(BLE_EATT_MTU) + \
   -	    sizeof (struct os_mbuf_pkthdr) +   \
   -		sizeof (struct os_mbuf))
   +        sizeof (struct os_mbuf_pkthdr) +   \
   +        sizeof (struct os_mbuf))
    
    #define BLE_EATT_MEMBLOCK_SIZE   \
        (OS_ALIGN(BLE_EATT_DATABUF_SIZE, 4))
   @@ -69,7 +69,7 @@
    static struct ble_npl_event g_read_sup_srv_feat_ev;
    
    static struct ble_eatt *
   -ble_eatt_alloc (void)
   +ble_eatt_alloc(void)
    {
        struct ble_eatt *eatt;
    
   @@ -123,8 +123,8 @@
    
        SLIST_FOREACH(eatt, &g_ble_eatt_list, next) {
            if ((eatt->conn_handle == conn_handle) &&
   -                (eatt->chan) &&
   -                (eatt->chan->scid == cid)) {
   +            (eatt->chan) &&
   +            (eatt->chan->scid == cid)) {
                return eatt;
            }
        }
   @@ -154,7 +154,7 @@
        struct ble_eatt *eatt = arg;
        int rc;
    
   -    switch(event->type) {
   +    switch (event->type) {
        case BLE_L2CAP_EVENT_COC_CONNECTED:
            BLE_EATT_LOG_DEBUG("eatt: Connected \n");
            if (event->connect.status) {
   @@ -236,12 +236,12 @@
    
    static int
    ble_gatt_eatt_write_cl_cb(uint16_t conn_handle,
   -                           const struct ble_gatt_error *error,
   -                           struct ble_gatt_attr *attr, void *arg)
   -{
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   -       BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
   -       return 0;
   +                          const struct ble_gatt_error *error,
   +                          struct ble_gatt_attr *attr, void *arg)
   +{
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +        BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
   +        return 0;
        }
    
        ble_eatt_start(conn_handle);
   @@ -250,15 +250,15 @@
    
    static int
    ble_gatt_eatt_read_cl_uuid_cb(uint16_t conn_handle,
   -                           const struct ble_gatt_error *error,
   -                           struct ble_gatt_attr *attr, void *arg)
   +                              const struct ble_gatt_error *error,
   +                              struct ble_gatt_attr *attr, void *arg)
    {
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   -       BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
   -       return 0;
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +        BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
   +        return 0;
        }
    
        if (attr == NULL) {
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   @@ -389,7 +389,8 @@
    }
    
    int
   -ble_eatt_start(uint16_t conn_handle) {
   +ble_eatt_start(uint16_t conn_handle)
   +{
        struct ble_gap_conn_desc desc;
        struct ble_eatt *eatt;
        int rc;
   @@ -405,8 +406,8 @@
    
        eatt = ble_eatt_alloc();
        if (!eatt) {
   -       BLE_EATT_LOG_ERROR("eatt: no available eatt resources\n");
   -       return 0;
   +        BLE_EATT_LOG_ERROR("eatt: no available eatt resources\n");
   +        return 0;
        }
    
        eatt->conn_handle = conn_handle;
   ```
   
   </details>
   
   #### nimble/host/src/ble_eatt_priv.h
   <details>
   
   ```diff
   @@ -33,15 +33,18 @@
    int ble_eatt_start(uint16_t conn_handle);
    #else
    static inline void
   -ble_eatt_init(ble_eatt_att_rx_fn att_rx_fn) {
   +ble_eatt_init(ble_eatt_att_rx_fn att_rx_fn)
   +{
    };
    
    static inline uint16_t
   -ble_eatt_get_available_chan_cid(uint16_t conn_handle) {
   +ble_eatt_get_available_chan_cid(uint16_t conn_handle)
   +{
        return BLE_L2CAP_CID_ATT;
    }
    static inline int
   -ble_eatt_start(uint16_t conn_handle) {
   +ble_eatt_start(uint16_t conn_handle)
   +{
        return 0;
    }
    #endif
   ```
   
   </details>
   
   #### apps/btshell/src/btshell.h
   <details>
   
   ```diff
   @@ -96,22 +96,22 @@
    int btshell_disc_svcs(uint16_t conn_handle);
    int btshell_disc_svc_by_uuid(uint16_t conn_handle, const ble_uuid_t *uuid);
    int btshell_disc_all_chrs(uint16_t conn_handle, uint16_t start_handle,
   -                           uint16_t end_handle);
   +                          uint16_t end_handle);
    int btshell_disc_all_chrs_in_svc(uint16_t conn_handle, struct btshell_svc *svc);
    int btshell_disc_chrs_by_uuid(uint16_t conn_handle, uint16_t start_handle,
   -                               uint16_t end_handle, const ble_uuid_t *uuid);
   +                              uint16_t end_handle, const ble_uuid_t *uuid);
    int btshell_disc_all_dscs(uint16_t conn_handle, uint16_t start_handle,
                              uint16_t end_handle);
    int btshell_disc_full(uint16_t conn_handle);
    int btshell_find_inc_svcs(uint16_t conn_handle, uint16_t start_handle,
   -                           uint16_t end_handle);
   +                          uint16_t end_handle);
    int btshell_read(uint16_t conn_handle, uint16_t attr_handle);
    int btshell_read_long(uint16_t conn_handle, uint16_t attr_handle,
                          uint16_t offset);
    int btshell_read_by_uuid(uint16_t conn_handle, uint16_t start_handle,
   -                          uint16_t end_handle, const ble_uuid_t *uuid);
   +                         uint16_t end_handle, const ble_uuid_t *uuid);
    int btshell_read_mult(uint16_t conn_handle, uint16_t *attr_handles,
   -                       int num_attr_handles, bool variable);
   +                      int num_attr_handles, bool variable);
    int btshell_write(uint16_t conn_handle, uint16_t attr_handle,
                      struct os_mbuf *om);
    int btshell_write_no_rsp(uint16_t conn_handle, uint16_t attr_handle,
   ```
   
   </details>
   
   #### apps/btshell/src/main.c
   <details>
   
   ```diff
   @@ -1676,7 +1675,7 @@
    
    int
    btshell_read_mult(uint16_t conn_handle, uint16_t *attr_handles,
   -                   int num_attr_handles, bool variable)
   +                  int num_attr_handles, bool variable)
    {
        if (variable) {
            return ble_gattc_read_mult_var(conn_handle, attr_handles, num_attr_handles,
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -44,7 +44,7 @@
    
    static int
    ble_svc_gatt_srv_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   -                                struct ble_gatt_access_ctxt *ctxt, void *arg);
   +                                 struct ble_gatt_access_ctxt *ctxt, void *arg);
    
    static int
    ble_svc_gatt_cl_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   @@ -57,23 +57,24 @@
            .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,
                }, {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_SERVER_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_srv_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ,
   +                .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_SERVER_SUPPORTED_FEAT_UUID16),
   +                .access_cb = ble_svc_gatt_srv_sup_feat_access,
   +                .flags = BLE_GATT_CHR_F_READ,
                },
                {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_cl_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   +                .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   +                .access_cb = ble_svc_gatt_cl_sup_feat_access,
   +                .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
                },
   -         {
   -            0, /* No more characteristics in this service. */
   -        } },
   +            {
   +                0, /* No more characteristics in this service. */
   +            }
   +        },
        },
    
        {
   @@ -83,7 +84,7 @@
    
    static int
    ble_svc_gatt_srv_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   -                                struct ble_gatt_access_ctxt *ctxt, void *arg)
   +                                 struct ble_gatt_access_ctxt *ctxt, void *arg)
    {
        if (ctxt->op != BLE_GATT_ACCESS_OP_READ_CHR) {
            return BLE_ATT_ERR_WRITE_NOT_PERMITTED;
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_priv.h
   <details>
   
   ```diff
   @@ -198,7 +198,7 @@
    int ble_att_svr_rx_read_mult(uint16_t conn_handle, uint16_t cid,
                                 struct os_mbuf **rxom);
    int ble_att_svr_rx_read_mult_var(uint16_t conn_handle, uint16_t cid,
   -                             struct os_mbuf **rxom);
   +                                 struct os_mbuf **rxom);
    int ble_att_svr_rx_write(uint16_t conn_handle, uint16_t cid,
                             struct os_mbuf **rxom);
    int ble_att_svr_rx_write_no_rsp(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom);
   @@ -209,7 +209,7 @@
    int ble_att_svr_rx_notify(uint16_t conn_handle, uint16_t cid,
                              struct os_mbuf **rxom);
    int ble_att_svr_rx_notify_multi(uint16_t conn_handle, uint16_t cid,
   -                          struct os_mbuf **rxom);
   +                                struct os_mbuf **rxom);
    int ble_att_svr_rx_indicate(uint16_t conn_handle, uint16_t cid,
                                struct os_mbuf **rxom);
    void ble_att_svr_prep_clear(struct ble_att_prep_entry_list *prep_list);
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_svr.c
   <details>
   
   ```diff
   @@ -1613,10 +1613,10 @@
    
    static int
    ble_att_svr_build_read_mult_rsp_var(uint16_t conn_handle, uint16_t cid,
   -                                struct os_mbuf **rxom,
   -                                struct os_mbuf **out_txom,
   -                                uint8_t *att_err,
   -                                uint16_t *err_handle)
   +                                    struct os_mbuf **rxom,
   +                                    struct os_mbuf **out_txom,
   +                                    uint8_t *att_err,
   +                                    uint16_t *err_handle)
    {
        struct os_mbuf *txom;
        uint16_t handle;
   @@ -2609,7 +2609,7 @@
            handle = le16toh(req->handle);
            attr_len = le16toh(req->value_len);
    
   -        offset =+ 4;
   +        offset = +4;
    
            if (attr_len > BLE_ATT_ATTR_MAX_LEN) {
                /*TODO Figure out what to do here */
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc.c
   <details>
   
   ```diff
   @@ -1021,7 +1021,7 @@
    
    static void
    ble_gattc_extract_by_conn_psm_op(uint16_t conn_handle, uint16_t psm, uint8_t op, int max_procs,
   -                             struct ble_gattc_proc_list *dst_list)
   +                                 struct ble_gattc_proc_list *dst_list)
    {
        struct ble_gattc_criteria_conn_op criteria;
    
   @@ -3314,12 +3314,12 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    
    static int
    ble_gattc_read_mult_cb_var(struct ble_gattc_proc *proc, int status,
   -                       uint16_t att_handle, struct os_mbuf **om)
   +                           uint16_t att_handle, struct os_mbuf **om)
    {
        struct ble_gatt_attr attr[proc->read_mult.num_handles];
        int rc;
   @@ -3334,7 +3334,7 @@
        memset(attr, 0, sizeof(*attr));
    
        offset = 0;
   -    for(i = 0; i < proc->read_mult.num_handles; i++ ) {
   +    for (i = 0; i < proc->read_mult.num_handles; i++) {
            attr[i].handle = proc->read_mult.handles[i];
            attr[i].offset = 0;
            if (om == NULL || OS_MBUF_PKTLEN(*om) == 0) {
   @@ -3347,7 +3347,7 @@
                break;
            }
    
   -        offset =+ 2;
   +        offset = +2;
    
            if (attr_len > BLE_ATT_ATTR_MAX_LEN) {
                /*TODO Figure out what to do here */
   @@ -3370,7 +3370,7 @@
        }
    
        /*FIXME Testing assert */
   -    assert(i ==  proc->read_mult.num_handles);
   +    assert(i == proc->read_mult.num_handles);
    
        proc->read_mult.cb_mult(proc->conn_handle,
                        ble_gattc_error(status, att_handle), &attr[0],
   @@ -3474,9 +3474,9 @@
    
    static int
    ble_gattc_read_mult_internal(uint16_t conn_handle, const uint16_t *handles,
   -                    uint8_t num_handles, bool variable, ble_gatt_attr_fn *cb,
   -                    ble_gatt_attr_mult_fn *cb_mult,
   -                    void *cb_arg)
   +                             uint8_t num_handles, bool variable, ble_gatt_attr_fn *cb,
   +                             ble_gatt_attr_mult_fn *cb_mult,
   +                             void *cb_arg)
    {
    #if !MYNEWT_VAL(BLE_GATT_READ_MULT)
        return BLE_HS_ENOTSUP;
   @@ -3539,8 +3539,8 @@
    
    int
    ble_gattc_read_mult_var(uint16_t conn_handle, const uint16_t *handles,
   -                    uint8_t num_handles, ble_gatt_attr_mult_fn *cb,
   -                    void *cb_arg)
   +                        uint8_t num_handles, ble_gatt_attr_mult_fn *cb,
   +                        void *cb_arg)
    {
    #if MYNEWT_VAL(BLE_GATT_READ_MULT_VAR)
        return ble_gattc_read_mult_internal(conn_handle, handles, num_handles,
   @@ -3551,8 +3551,8 @@
    }
    
    /*****************************************************************************
   - * $write no response                                                        *
   - *****************************************************************************/
   +* $write no response                                                        *
   +*****************************************************************************/
    
    int
    ble_gattc_write_no_rsp(uint16_t conn_handle, uint16_t attr_handle,
   @@ -3860,7 +3860,7 @@
         */
        if (proc->write_long.attr.offset > 0 &&
            proc->write_long.attr.offset <
   -            OS_MBUF_PKTLEN(proc->write_long.attr.om)) {
   +        OS_MBUF_PKTLEN(proc->write_long.attr.om)) {
    
            ble_att_clt_tx_exec_write(proc->conn_handle, proc->cid,
                                      BLE_ATT_EXEC_WRITE_F_CANCEL);
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_clt_test.c
   <details>
   
   ```diff
   @@ -380,7 +372,7 @@
        conn_handle = ble_att_clt_test_misc_init();
    
        /*** Success. */
   -    rc = ble_att_clt_tx_read_mult(conn_handle, BLE_L2CAP_CID_ATT, ((uint16_t[]){ 1, 2 }), 2, false);
   +    rc = ble_att_clt_tx_read_mult(conn_handle, BLE_L2CAP_CID_ATT, ((uint16_t[]) { 1, 2 }), 2, false);
        TEST_ASSERT(rc == 0);
    
        om = ble_hs_test_util_prev_tx_dequeue_pullup();
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_write_test.c
   <details>
   
   ```diff
   @@ -129,7 +129,7 @@
    
        ble_gatt_write_test_init();
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
    
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
   @@ -185,7 +185,7 @@
    
        ble_gatt_write_test_init();
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
    
   @@ -313,7 +312,7 @@
                                            flat_attrs + num_attrs);
        }
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
    
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600147077
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -239,7 +239,7 @@
                              const struct ble_gatt_error *error,
                              struct ble_gatt_attr *attr, void *arg)
    {
   -    if (error == NULL || (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
            return 0;
        }
   @@ -256,7 +256,7 @@
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
            return 0;
        }
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -74,7 +74,8 @@
                },
                {
                    0, /* No more characteristics in this service. */
   -            } },
   +            }
   +        },
        },
    
        {
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600228339
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600468484
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-599796917
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -46,8 +46,8 @@
    
    #define BLE_EATT_DATABUF_SIZE  ( \
            MYNEWT_VAL(BLE_EATT_MTU) + \
   -	    sizeof (struct os_mbuf_pkthdr) +   \
   -		sizeof (struct os_mbuf))
   +        sizeof (struct os_mbuf_pkthdr) +   \
   +        sizeof (struct os_mbuf))
    
    #define BLE_EATT_MEMBLOCK_SIZE   \
        (OS_ALIGN(BLE_EATT_DATABUF_SIZE, 4))
   @@ -69,7 +69,7 @@
    static struct ble_npl_event g_read_sup_srv_feat_ev;
    
    static struct ble_eatt *
   -ble_eatt_alloc (void)
   +ble_eatt_alloc(void)
    {
        struct ble_eatt *eatt;
    
   @@ -123,8 +123,8 @@
    
        SLIST_FOREACH(eatt, &g_ble_eatt_list, next) {
            if ((eatt->conn_handle == conn_handle) &&
   -                (eatt->chan) &&
   -                (eatt->chan->scid == cid)) {
   +            (eatt->chan) &&
   +            (eatt->chan->scid == cid)) {
                return eatt;
            }
        }
   @@ -154,7 +154,7 @@
        struct ble_eatt *eatt = arg;
        int rc;
    
   -    switch(event->type) {
   +    switch (event->type) {
        case BLE_L2CAP_EVENT_COC_CONNECTED:
            BLE_EATT_LOG_DEBUG("eatt: Connected \n");
            if (event->connect.status) {
   @@ -236,12 +236,12 @@
    
    static int
    ble_gatt_eatt_write_cl_cb(uint16_t conn_handle,
   -                           const struct ble_gatt_error *error,
   -                           struct ble_gatt_attr *attr, void *arg)
   -{
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   -       BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
   -       return 0;
   +                          const struct ble_gatt_error *error,
   +                          struct ble_gatt_attr *attr, void *arg)
   +{
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +        BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
   +        return 0;
        }
    
        ble_eatt_start(conn_handle);
   @@ -250,15 +250,15 @@
    
    static int
    ble_gatt_eatt_read_cl_uuid_cb(uint16_t conn_handle,
   -                           const struct ble_gatt_error *error,
   -                           struct ble_gatt_attr *attr, void *arg)
   +                              const struct ble_gatt_error *error,
   +                              struct ble_gatt_attr *attr, void *arg)
    {
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   -       BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
   -       return 0;
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +        BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
   +        return 0;
        }
    
        if (attr == NULL) {
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   @@ -389,7 +389,8 @@
    }
    
    int
   -ble_eatt_start(uint16_t conn_handle) {
   +ble_eatt_start(uint16_t conn_handle)
   +{
        struct ble_gap_conn_desc desc;
        struct ble_eatt *eatt;
        int rc;
   @@ -405,8 +406,8 @@
    
        eatt = ble_eatt_alloc();
        if (!eatt) {
   -       BLE_EATT_LOG_ERROR("eatt: no available eatt resources\n");
   -       return 0;
   +        BLE_EATT_LOG_ERROR("eatt: no available eatt resources\n");
   +        return 0;
        }
    
        eatt->conn_handle = conn_handle;
   ```
   
   </details>
   
   #### nimble/host/src/ble_eatt_priv.h
   <details>
   
   ```diff
   @@ -33,15 +33,18 @@
    int ble_eatt_start(uint16_t conn_handle);
    #else
    static inline void
   -ble_eatt_init(ble_eatt_att_rx_fn att_rx_fn) {
   +ble_eatt_init(ble_eatt_att_rx_fn att_rx_fn)
   +{
    };
    
    static inline uint16_t
   -ble_eatt_get_available_chan_cid(uint16_t conn_handle) {
   +ble_eatt_get_available_chan_cid(uint16_t conn_handle)
   +{
        return BLE_L2CAP_CID_ATT;
    }
    static inline int
   -ble_eatt_start(uint16_t conn_handle) {
   +ble_eatt_start(uint16_t conn_handle)
   +{
        return 0;
    }
    #endif
   ```
   
   </details>
   
   #### apps/btshell/src/btshell.h
   <details>
   
   ```diff
   @@ -96,22 +96,22 @@
    int btshell_disc_svcs(uint16_t conn_handle);
    int btshell_disc_svc_by_uuid(uint16_t conn_handle, const ble_uuid_t *uuid);
    int btshell_disc_all_chrs(uint16_t conn_handle, uint16_t start_handle,
   -                           uint16_t end_handle);
   +                          uint16_t end_handle);
    int btshell_disc_all_chrs_in_svc(uint16_t conn_handle, struct btshell_svc *svc);
    int btshell_disc_chrs_by_uuid(uint16_t conn_handle, uint16_t start_handle,
   -                               uint16_t end_handle, const ble_uuid_t *uuid);
   +                              uint16_t end_handle, const ble_uuid_t *uuid);
    int btshell_disc_all_dscs(uint16_t conn_handle, uint16_t start_handle,
                              uint16_t end_handle);
    int btshell_disc_full(uint16_t conn_handle);
    int btshell_find_inc_svcs(uint16_t conn_handle, uint16_t start_handle,
   -                           uint16_t end_handle);
   +                          uint16_t end_handle);
    int btshell_read(uint16_t conn_handle, uint16_t attr_handle);
    int btshell_read_long(uint16_t conn_handle, uint16_t attr_handle,
                          uint16_t offset);
    int btshell_read_by_uuid(uint16_t conn_handle, uint16_t start_handle,
   -                          uint16_t end_handle, const ble_uuid_t *uuid);
   +                         uint16_t end_handle, const ble_uuid_t *uuid);
    int btshell_read_mult(uint16_t conn_handle, uint16_t *attr_handles,
   -                       int num_attr_handles, bool variable);
   +                      int num_attr_handles, bool variable);
    int btshell_write(uint16_t conn_handle, uint16_t attr_handle,
                      struct os_mbuf *om);
    int btshell_write_no_rsp(uint16_t conn_handle, uint16_t attr_handle,
   ```
   
   </details>
   
   #### apps/btshell/src/main.c
   <details>
   
   ```diff
   @@ -1676,7 +1675,7 @@
    
    int
    btshell_read_mult(uint16_t conn_handle, uint16_t *attr_handles,
   -                   int num_attr_handles, bool variable)
   +                  int num_attr_handles, bool variable)
    {
        if (variable) {
            return ble_gattc_read_mult_var(conn_handle, attr_handles, num_attr_handles,
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -44,7 +44,7 @@
    
    static int
    ble_svc_gatt_srv_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   -                                struct ble_gatt_access_ctxt *ctxt, void *arg);
   +                                 struct ble_gatt_access_ctxt *ctxt, void *arg);
    
    static int
    ble_svc_gatt_cl_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   @@ -57,23 +57,24 @@
            .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,
                }, {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_SERVER_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_srv_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ,
   +                .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_SERVER_SUPPORTED_FEAT_UUID16),
   +                .access_cb = ble_svc_gatt_srv_sup_feat_access,
   +                .flags = BLE_GATT_CHR_F_READ,
                },
                {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_cl_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   +                .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   +                .access_cb = ble_svc_gatt_cl_sup_feat_access,
   +                .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
                },
   -         {
   -            0, /* No more characteristics in this service. */
   -        } },
   +            {
   +                0, /* No more characteristics in this service. */
   +            }
   +        },
        },
    
        {
   @@ -83,7 +84,7 @@
    
    static int
    ble_svc_gatt_srv_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle,
   -                                struct ble_gatt_access_ctxt *ctxt, void *arg)
   +                                 struct ble_gatt_access_ctxt *ctxt, void *arg)
    {
        if (ctxt->op != BLE_GATT_ACCESS_OP_READ_CHR) {
            return BLE_ATT_ERR_WRITE_NOT_PERMITTED;
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_priv.h
   <details>
   
   ```diff
   @@ -198,7 +198,7 @@
    int ble_att_svr_rx_read_mult(uint16_t conn_handle, uint16_t cid,
                                 struct os_mbuf **rxom);
    int ble_att_svr_rx_read_mult_var(uint16_t conn_handle, uint16_t cid,
   -                             struct os_mbuf **rxom);
   +                                 struct os_mbuf **rxom);
    int ble_att_svr_rx_write(uint16_t conn_handle, uint16_t cid,
                             struct os_mbuf **rxom);
    int ble_att_svr_rx_write_no_rsp(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom);
   @@ -209,7 +209,7 @@
    int ble_att_svr_rx_notify(uint16_t conn_handle, uint16_t cid,
                              struct os_mbuf **rxom);
    int ble_att_svr_rx_notify_multi(uint16_t conn_handle, uint16_t cid,
   -                          struct os_mbuf **rxom);
   +                                struct os_mbuf **rxom);
    int ble_att_svr_rx_indicate(uint16_t conn_handle, uint16_t cid,
                                struct os_mbuf **rxom);
    void ble_att_svr_prep_clear(struct ble_att_prep_entry_list *prep_list);
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_svr.c
   <details>
   
   ```diff
   @@ -1613,10 +1613,10 @@
    
    static int
    ble_att_svr_build_read_mult_rsp_var(uint16_t conn_handle, uint16_t cid,
   -                                struct os_mbuf **rxom,
   -                                struct os_mbuf **out_txom,
   -                                uint8_t *att_err,
   -                                uint16_t *err_handle)
   +                                    struct os_mbuf **rxom,
   +                                    struct os_mbuf **out_txom,
   +                                    uint8_t *att_err,
   +                                    uint16_t *err_handle)
    {
        struct os_mbuf *txom;
        uint16_t handle;
   @@ -2609,7 +2609,7 @@
            handle = le16toh(req->handle);
            attr_len = le16toh(req->value_len);
    
   -        offset =+ 4;
   +        offset = +4;
    
            if (attr_len > BLE_ATT_ATTR_MAX_LEN) {
                /*TODO Figure out what to do here */
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc.c
   <details>
   
   ```diff
   @@ -1021,7 +1021,7 @@
    
    static void
    ble_gattc_extract_by_conn_psm_op(uint16_t conn_handle, uint16_t psm, uint8_t op, int max_procs,
   -                             struct ble_gattc_proc_list *dst_list)
   +                                 struct ble_gattc_proc_list *dst_list)
    {
        struct ble_gattc_criteria_conn_op criteria;
    
   @@ -3314,12 +3314,12 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    
    static int
    ble_gattc_read_mult_cb_var(struct ble_gattc_proc *proc, int status,
   -                       uint16_t att_handle, struct os_mbuf **om)
   +                           uint16_t att_handle, struct os_mbuf **om)
    {
        struct ble_gatt_attr attr[proc->read_mult.num_handles];
        int rc;
   @@ -3334,7 +3334,7 @@
        memset(attr, 0, sizeof(*attr));
    
        offset = 0;
   -    for(i = 0; i < proc->read_mult.num_handles; i++ ) {
   +    for (i = 0; i < proc->read_mult.num_handles; i++) {
            attr[i].handle = proc->read_mult.handles[i];
            attr[i].offset = 0;
            if (om == NULL || OS_MBUF_PKTLEN(*om) == 0) {
   @@ -3347,7 +3347,7 @@
                break;
            }
    
   -        offset =+ 2;
   +        offset = +2;
    
            if (attr_len > BLE_ATT_ATTR_MAX_LEN) {
                /*TODO Figure out what to do here */
   @@ -3370,7 +3370,7 @@
        }
    
        /*FIXME Testing assert */
   -    assert(i ==  proc->read_mult.num_handles);
   +    assert(i == proc->read_mult.num_handles);
    
        proc->read_mult.cb_mult(proc->conn_handle,
                        ble_gattc_error(status, att_handle), &attr[0],
   @@ -3474,9 +3474,9 @@
    
    static int
    ble_gattc_read_mult_internal(uint16_t conn_handle, const uint16_t *handles,
   -                    uint8_t num_handles, bool variable, ble_gatt_attr_fn *cb,
   -                    ble_gatt_attr_mult_fn *cb_mult,
   -                    void *cb_arg)
   +                             uint8_t num_handles, bool variable, ble_gatt_attr_fn *cb,
   +                             ble_gatt_attr_mult_fn *cb_mult,
   +                             void *cb_arg)
    {
    #if !MYNEWT_VAL(BLE_GATT_READ_MULT)
        return BLE_HS_ENOTSUP;
   @@ -3539,8 +3539,8 @@
    
    int
    ble_gattc_read_mult_var(uint16_t conn_handle, const uint16_t *handles,
   -                    uint8_t num_handles, ble_gatt_attr_mult_fn *cb,
   -                    void *cb_arg)
   +                        uint8_t num_handles, ble_gatt_attr_mult_fn *cb,
   +                        void *cb_arg)
    {
    #if MYNEWT_VAL(BLE_GATT_READ_MULT_VAR)
        return ble_gattc_read_mult_internal(conn_handle, handles, num_handles,
   @@ -3551,8 +3551,8 @@
    }
    
    /*****************************************************************************
   - * $write no response                                                        *
   - *****************************************************************************/
   +* $write no response                                                        *
   +*****************************************************************************/
    
    int
    ble_gattc_write_no_rsp(uint16_t conn_handle, uint16_t attr_handle,
   @@ -3860,7 +3860,7 @@
         */
        if (proc->write_long.attr.offset > 0 &&
            proc->write_long.attr.offset <
   -            OS_MBUF_PKTLEN(proc->write_long.attr.om)) {
   +        OS_MBUF_PKTLEN(proc->write_long.attr.om)) {
    
            ble_att_clt_tx_exec_write(proc->conn_handle, proc->cid,
                                      BLE_ATT_EXEC_WRITE_F_CANCEL);
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_clt_test.c
   <details>
   
   ```diff
   @@ -380,7 +372,7 @@
        conn_handle = ble_att_clt_test_misc_init();
    
        /*** Success. */
   -    rc = ble_att_clt_tx_read_mult(conn_handle, BLE_L2CAP_CID_ATT, ((uint16_t[]){ 1, 2 }), 2, false);
   +    rc = ble_att_clt_tx_read_mult(conn_handle, BLE_L2CAP_CID_ATT, ((uint16_t[]) { 1, 2 }), 2, false);
        TEST_ASSERT(rc == 0);
    
        om = ble_hs_test_util_prev_tx_dequeue_pullup();
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_write_test.c
   <details>
   
   ```diff
   @@ -129,7 +129,7 @@
    
        ble_gatt_write_test_init();
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
    
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
   @@ -185,7 +185,7 @@
    
        ble_gatt_write_test_init();
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
    
   @@ -313,7 +312,7 @@
                                            flat_attrs + num_attrs);
        }
    
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        mtu = ble_att_mtu(2, BLE_L2CAP_CID_ATT);
    
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600068620
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -239,7 +239,7 @@
                              const struct ble_gatt_error *error,
                              struct ble_gatt_attr *attr, void *arg)
    {
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
            return 0;
        }
   @@ -256,7 +256,7 @@
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
            return 0;
        }
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -56,21 +56,24 @@
            .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_SERVER_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_srv_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ,
   -        }, {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_cl_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   -        }, {
   -            0, /* No more characteristics in this service. */
   -        } },
   +                                                             .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_SERVER_SUPPORTED_FEAT_UUID16),
   +                                                             .access_cb = ble_svc_gatt_srv_sup_feat_access,
   +                                                             .flags = BLE_GATT_CHR_F_READ,
   +                                                         }, {
   +                                                             .uuid = BLE_UUID16_DECLARE(
   +                    BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   +                                                             .access_cb = ble_svc_gatt_cl_sup_feat_access,
   +                                                             .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   +                                                         }, {
   +                                                             0, /* No more characteristics in this service. */
   +                                                         } },
        },
    
        {
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_priv.h
   <details>
   
   ```diff
   @@ -210,7 +210,7 @@
    int ble_att_svr_rx_notify(uint16_t conn_handle, uint16_t cid,
                              struct os_mbuf **rxom);
    int ble_att_svr_rx_notify_multi(uint16_t conn_handle, uint16_t cid,
   -                          struct os_mbuf **rxom);
   +                                struct os_mbuf **rxom);
    int ble_att_svr_rx_indicate(uint16_t conn_handle, uint16_t cid,
                                struct os_mbuf **rxom);
    void ble_att_svr_prep_clear(struct ble_att_prep_entry_list *prep_list);
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc.c
   <details>
   
   ```diff
   @@ -3335,7 +3335,7 @@
        memset(attr, 0, sizeof(*attr));
    
        offset = 0;
   -    for(i = 0; i < proc->read_mult.num_handles; i++) {
   +    for (i = 0; i < proc->read_mult.num_handles; i++) {
            attr[i].handle = proc->read_mult.handles[i];
            attr[i].offset = 0;
            if (om == NULL || OS_MBUF_PKTLEN(*om) == 0) {
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600228339
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status != 0 && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600147077
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -239,7 +239,7 @@
                              const struct ble_gatt_error *error,
                              struct ble_gatt_attr *attr, void *arg)
    {
   -    if (error == NULL || (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
            return 0;
        }
   @@ -256,7 +256,7 @@
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
            return 0;
        }
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status != 0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -74,7 +74,8 @@
                },
                {
                    0, /* No more characteristics in this service. */
   -            } },
   +            }
   +        },
        },
    
        {
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on issue #773: nimble: [WIP] Eatt initial implementation
URL: https://github.com/apache/mynewt-nimble/pull/773#issuecomment-600068620
 
 
   
   <!-- 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_eatt.c
   <details>
   
   ```diff
   @@ -239,7 +239,7 @@
                              const struct ble_gatt_error *error,
                              struct ble_gatt_attr *attr, void *arg)
    {
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot write to Client Supported features on peer device\n");
            return 0;
        }
   @@ -256,7 +256,7 @@
        uint8_t client_supported_feat;
        int rc;
    
   -    if (error == NULL || (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Client Supported features on peer device\n");
            return 0;
        }
   @@ -282,7 +282,7 @@
        uint8_t supported_features;
        int rc;
    
   -    if (error == NULL ||  (error->status !=0  && error->status != BLE_HS_EDONE)) {
   +    if (error == NULL || (error->status != 0 && error->status != BLE_HS_EDONE)) {
            BLE_EATT_LOG_DEBUG("eatt: Cannot find Server Supported features on peer device\n");
            return 0;
        }
   ```
   
   </details>
   
   #### nimble/host/services/gatt/src/ble_svc_gatt.c
   <details>
   
   ```diff
   @@ -56,21 +56,24 @@
            .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_SERVER_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_srv_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ,
   -        }, {
   -            .uuid = BLE_UUID16_DECLARE(BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   -            .access_cb = ble_svc_gatt_cl_sup_feat_access,
   -            .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   -        }, {
   -            0, /* No more characteristics in this service. */
   -        } },
   +                                                             .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_SERVER_SUPPORTED_FEAT_UUID16),
   +                                                             .access_cb = ble_svc_gatt_srv_sup_feat_access,
   +                                                             .flags = BLE_GATT_CHR_F_READ,
   +                                                         }, {
   +                                                             .uuid = BLE_UUID16_DECLARE(
   +                    BLE_SVC_GATT_CHR_CLIENT_SUPPORTED_FEAT_UUID16),
   +                                                             .access_cb = ble_svc_gatt_cl_sup_feat_access,
   +                                                             .flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE,
   +                                                         }, {
   +                                                             0, /* No more characteristics in this service. */
   +                                                         } },
        },
    
        {
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_clt.c
   <details>
   
   ```diff
   @@ -27,8 +27,8 @@
    #include "ble_hs_priv.h"
    
    /*****************************************************************************
   - * $error response                                                           *
   - *****************************************************************************/
   +* $error response                                                           *
   +*****************************************************************************/
    
    int
    ble_att_clt_rx_error(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom)
   @@ -147,8 +147,8 @@
    }
    
    /*****************************************************************************
   - * $find information                                                         *
   - *****************************************************************************/
   +* $find information                                                         *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_find_info(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -355,8 +354,8 @@
    }
    
    /*****************************************************************************
   - * $read by type                                                             *
   - *****************************************************************************/
   +* $read by type                                                             *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_type(uint16_t conn_handle, uint16_t cid, uint16_t start_handle,
   @@ -442,8 +441,8 @@
    }
    
    /*****************************************************************************
   - * $read                                                                     *
   - *****************************************************************************/
   +* $read                                                                     *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read(uint16_t conn_handle, uint16_t cid, uint16_t handle)
   @@ -488,8 +487,8 @@
    }
    
    /*****************************************************************************
   - * $read blob                                                                *
   - *****************************************************************************/
   +* $read blob                                                                *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_blob(uint16_t conn_handle, uint16_t cid, uint16_t handle, uint16_t offset)
   @@ -535,8 +534,8 @@
    }
    
    /*****************************************************************************
   - * $read multiple                                                            *
   - *****************************************************************************/
   +* $read multiple                                                            *
   +*****************************************************************************/
    int
    ble_att_clt_tx_read_mult(uint16_t conn_handle, uint16_t cid, const uint16_t *handles,
                             int num_handles, bool variable)
   @@ -595,8 +594,8 @@
    }
    
    /*****************************************************************************
   - * $read by group type                                                       *
   - *****************************************************************************/
   +* $read by group type                                                       *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_read_group_type(uint16_t conn_handle, uint16_t cid,
   @@ -693,8 +691,8 @@
    }
    
    /*****************************************************************************
   - * $write                                                                    *
   - *****************************************************************************/
   +* $write                                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_write_req(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -769,8 +767,8 @@
    }
    
    /*****************************************************************************
   - * $prepare write request                                                    *
   - *****************************************************************************/
   +* $prepare write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_prep_write(uint16_t conn_handle, uint16_t cid, uint16_t handle,
   @@ -852,8 +850,8 @@
    }
    
    /*****************************************************************************
   - * $execute write request                                                    *
   - *****************************************************************************/
   +* $execute write request                                                    *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_exec_write(uint16_t conn_handle, uint16_t cid, uint8_t flags)
   @@ -932,8 +930,8 @@
    }
    
    /*****************************************************************************
   - * $handle value indication                                                  *
   - *****************************************************************************/
   +* $handle value indication                                                  *
   +*****************************************************************************/
    
    int
    ble_att_clt_tx_indicate(uint16_t conn_handle,
   ```
   
   </details>
   
   #### nimble/host/src/ble_att_priv.h
   <details>
   
   ```diff
   @@ -210,7 +210,7 @@
    int ble_att_svr_rx_notify(uint16_t conn_handle, uint16_t cid,
                              struct os_mbuf **rxom);
    int ble_att_svr_rx_notify_multi(uint16_t conn_handle, uint16_t cid,
   -                          struct os_mbuf **rxom);
   +                                struct os_mbuf **rxom);
    int ble_att_svr_rx_indicate(uint16_t conn_handle, uint16_t cid,
                                struct os_mbuf **rxom);
    void ble_att_svr_prep_clear(struct ble_att_prep_entry_list *prep_list);
   ```
   
   </details>
   
   #### nimble/host/src/ble_gattc.c
   <details>
   
   ```diff
   @@ -3335,7 +3335,7 @@
        memset(attr, 0, sizeof(*attr));
    
        offset = 0;
   -    for(i = 0; i < proc->read_mult.num_handles; i++) {
   +    for (i = 0; i < proc->read_mult.num_handles; i++) {
            attr[i].handle = proc->read_mult.handles[i];
            attr[i].offset = 0;
            if (om == NULL || OS_MBUF_PKTLEN(*om) == 0) {
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_att_svr_test.c
   <details>
   
   ```diff
   @@ -1204,31 +1200,34 @@
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle1,
   -            .uuid = BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
   -        }, {
   -            .handle = handle2,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle1,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
   +            15),
   +                                                      }, {
   +                                                          .handle = handle2,
   +                                                          .uuid =
   +                                                              BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
   +            16),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        /*** Remaining 16-bit entry requested. */
        rc = ble_hs_test_util_rx_att_find_info_req(conn_handle, BLE_L2CAP_CID_ATT, handle3, handle3);
        TEST_ASSERT(rc == 0);
        ble_hs_test_util_verify_tx_find_info_rsp(
            ((struct ble_hs_test_util_att_info_entry[]) { {
   -            .handle = handle3,
   -            .uuid = BLE_UUID16_DECLARE(0x000f),
   -        }, {
   -            .handle = 0,
   -        } }));
   +                                                          .handle = handle3,
   +                                                          .uuid = BLE_UUID16_DECLARE(0x000f),
   +                                                      }, {
   +                                                          .handle = 0,
   +                                                      } }));
    
        ble_att_svr_test_assert_mbufs_freed();
    }
    
   -TEST_CASE_SELF(ble_att_svr_test_find_type_value)
   -{
   +TEST_CASE_SELF(ble_att_svr_test_find_type_value) {
        uint16_t conn_handle;
        uint16_t handle1;
        uint16_t handle2;
   ```
   
   </details>
   
   #### nimble/host/test/src/ble_gatt_find_s_test.c
   <details>
   
   ```diff
   @@ -250,103 +249,113 @@
        }
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_1)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_1) {
        /* Two 16-bit UUID services; one response. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 5, 10,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 6,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 9,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 6,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 9,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* One 128-bit UUID service; two responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 128-bit UUID service; four responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 34, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        /* Two 16-bit UUID; three 128-bit UUID; seven responses. */
        ble_gatt_find_s_test_misc_init();
   -    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}),
   +    ble_hs_test_util_create_conn(2, ((uint8_t[]) {2,3,4,5,6,7,8,9}),
                                     NULL, NULL);
        ble_gatt_find_s_test_misc_find_inc(2, BLE_L2CAP_CID_ATT, 1, 100,
   -        ((struct ble_gatt_find_s_test_entry[]) { {
   -            .inc_handle = 36,
   -            .start_handle = 403,
   -            .end_handle = 859,
   -            .uuid = BLE_UUID128_DECLARE(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),
   -        }, {
   -            .inc_handle = 37,
   -            .start_handle = 35,
   -            .end_handle = 49,
   -            .uuid = BLE_UUID16_DECLARE(0x5155),
   -        }, {
   -            .inc_handle = 38,
   -            .start_handle = 543,
   -            .end_handle = 870,
   -            .uuid = BLE_UUID16_DECLARE(0x1122),
   -        }, {
   -            .inc_handle = 39,
   -            .start_handle = 900,
   -            .end_handle = 932,
   -            .uuid = BLE_UUID128_DECLARE(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17),
   -        }, {
   -            .inc_handle = 40,
   -            .start_handle = 940,
   -            .end_handle = 950,
   -            .uuid = BLE_UUID128_DECLARE(3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18),
   -        }, {
   -            0,
   -        } })
   -    );
   +                                       ((struct ble_gatt_find_s_test_entry[]) { {
   +                                                                                    .inc_handle = 36,
   +                                                                                    .start_handle = 403,
   +                                                                                    .end_handle = 859,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(1,2,3,4,5,
   +            6,7,8,9,10,11,12,13,14,15,16),
   +                                                                                }, {
   +                                                                                    .inc_handle = 37,
   +                                                                                    .start_handle = 35,
   +                                                                                    .end_handle = 49,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x5155),
   +                                                                                }, {
   +                                                                                    .inc_handle = 38,
   +                                                                                    .start_handle = 543,
   +                                                                                    .end_handle = 870,
   +                                                                                    .uuid = BLE_UUID16_DECLARE(0x1122),
   +                                                                                }, {
   +                                                                                    .inc_handle = 39,
   +                                                                                    .start_handle = 900,
   +                                                                                    .end_handle = 932,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(2,3,4,5,6,
   +            7,8,9,10,11,12,13,14,15,16,17),
   +                                                                                }, {
   +                                                                                    .inc_handle = 40,
   +                                                                                    .start_handle = 940,
   +                                                                                    .end_handle = 950,
   +                                                                                    .uuid =
   +                                                                                        BLE_UUID128_DECLARE(3,4,5,6,7,
   +            8,9,10,11,12,13,14,15,16,17,18),
   +                                                                                }, {
   +                                                                                    0,
   +                                                                                } })
   +                                       );
    
        ble_hs_test_util_assert_mbufs_freed(NULL);
    }
    
   -TEST_CASE_SELF(ble_gatt_find_s_test_oom)
   -{
   +TEST_CASE_SELF(ble_gatt_find_s_test_oom) {
    
        struct ble_gatt_find_s_test_entry incs[] = {
            {
   ```
   
   </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:
users@infra.apache.org


With regards,
Apache Git Services