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/07/06 11:32:15 UTC

[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #826: host/mesh/src/prov.c fixes

apache-mynewt-bot commented on pull request #826:
URL: https://github.com/apache/mynewt-nimble/pull/826#issuecomment-654178074


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### nimble/host/mesh/src/prov.c
   <details>
   
   ```diff
   @@ -126,7 +126,7 @@
        struct bt_mesh_node *node;
        u16_t addr;
        u16_t net_idx;
   -    u8_t  attention_duration;
   +    u8_t attention_duration;
    };
    
    struct prov_link {
   @@ -136,31 +136,31 @@
    #endif
        struct provisioner_link provisioner[PROVISIONER_LINK];
    
   -    u8_t  dhkey[32];         /* Calculated DHKey */
   -    u8_t  expect;            /* Next expected PDU */
   -
   -    u8_t  oob_method;
   -    u8_t  oob_action;
   -    u8_t  oob_size;
   -
   -    u8_t  conf[16];          /* Remote Confirmation */
   -    u8_t  rand[16];          /* Local Random */
   -    u8_t  auth[16];          /* Authentication Value */
   -
   -    u8_t  conf_salt[16];     /* ConfirmationSalt */
   -    u8_t  conf_key[16];      /* ConfirmationKey */
   -    u8_t  conf_inputs[145];  /* ConfirmationInputs */
   -    u8_t  prov_salt[16];     /* Provisioning Salt */
   +    u8_t dhkey[32];          /* Calculated DHKey */
   +    u8_t expect;             /* Next expected PDU */
   +
   +    u8_t oob_method;
   +    u8_t oob_action;
   +    u8_t oob_size;
   +
   +    u8_t conf[16];           /* Remote Confirmation */
   +    u8_t rand[16];           /* Local Random */
   +    u8_t auth[16];           /* Authentication Value */
   +
   +    u8_t conf_salt[16];      /* ConfirmationSalt */
   +    u8_t conf_key[16];       /* ConfirmationKey */
   +    u8_t conf_inputs[145];   /* ConfirmationInputs */
   +    u8_t prov_salt[16];      /* Provisioning Salt */
    
    #if (MYNEWT_VAL(BLE_MESH_PB_ADV))
        u32_t id;                /* Link ID */
    
        struct {
   -        u8_t  id;        /* Transaction ID */
   -        u8_t  prev_id;   /* Previous Transaction ID */
   -        u8_t  seg;       /* Bit-field of unreceived segments */
   -        u8_t  last_seg;  /* Last segment (to check length) */
   -        u8_t  fcs;       /* Expected FCS value */
   +        u8_t id;         /* Transaction ID */
   +        u8_t prev_id;    /* Previous Transaction ID */
   +        u8_t seg;        /* Bit-field of unreceived segments */
   +        u8_t last_seg;   /* Last segment (to check length) */
   +        u8_t fcs;        /* Expected FCS value */
            struct os_mbuf *buf;
        } rx;
    
   @@ -184,8 +184,8 @@
    
    struct prov_rx {
        u32_t link_id;
   -    u8_t  xact_id;
   -    u8_t  gpc;
   +    u8_t xact_id;
   +    u8_t gpc;
    };
    
    #define RETRANSMIT_TIMEOUT   K_MSEC(500)
   @@ -313,7 +313,7 @@
    static void
    reset_adv_link(void)
    {
   -          prov_clear_tx();
   +    prov_clear_tx();
    
        if (prov->link_close) {
            prov->link_close(BT_MESH_PROV_ADV);
   @@ -834,7 +834,7 @@
                return prov->output_string((char *)str);
            } else {
                u32_t div[8] = { 10, 100, 1000, 10000, 100000,
   -                        1000000, 10000000, 100000000 };
   +                             1000000, 10000000, 100000000 };
                u32_t num;
    
                bt_rand(&num, sizeof(num));
   @@ -1725,7 +1725,7 @@
            u8_t expect_len;
    
            expect_len = (link.rx.buf->om_len - 20 -
   -                  ((link.rx.last_seg - 1) * 23));
   +                      ((link.rx.last_seg - 1) * 23));
            if (expect_len != buf->om_len) {
                BT_ERR("Incorrect last seg len: %u != %u",
                       expect_len, buf->om_len);
   @@ -1794,7 +1794,7 @@
        trailing_space = OS_MBUF_TRAILINGSPACE(link.rx.buf);
    
        link.rx.buf->om_len = net_buf_simple_pull_be16(buf);
   -    link.rx.id  = rx->xact_id;
   +    link.rx.id = rx->xact_id;
        link.rx.fcs = net_buf_simple_pull_u8(buf);
    
        BT_DBG("len %u last_seg %u total_len %u fcs 0x%02x", buf->om_len,
   ```
   
   </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