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/04/08 11:23:30 UTC

[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on issue #794: Apps: add peripheral

apache-mynewt-bot removed a comment on issue #794: Apps: add peripheral
URL: https://github.com/apache/mynewt-nimble/pull/794#issuecomment-610880529
 
 
   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/peripheral/src/main.c
   <details>
   
   ```diff
   @@ -53,14 +53,13 @@
                /* Connection failed; resume advertising */
                advertise();
                conn_handle = 0;
   -        }
   -        else {
   +        } else   {
                conn_handle = event->connect.conn_handle;
            }
            break;
        case BLE_GAP_EVENT_CONN_UPDATE_REQ:
            /* connected device requests update of connection parameters,
   -        and these are being filled in - NULL sets default values */
   +           and these are being filled in - NULL sets default values */
            MODLOG_DFLT(INFO, "updating conncetion parameters...\n");
            event->conn_update_req.conn_handle = conn_handle;
            event->conn_update_req.peer_params = NULL;
   @@ -71,18 +70,18 @@
            event->disconnect.reason);
    
            /* reset conn_handle */
   -        conn_handle = BLE_HS_CONN_HANDLE_NONE; 
   +        conn_handle = BLE_HS_CONN_HANDLE_NONE;
    
            /* Connection terminated; resume advertising */
            advertise();
   -        break; 
   +        break;
        default:
            MODLOG_DFLT(ERROR, "Advertising event not handled,"
                        "event code: %u\n", event->type);
   -    break;
   +        break;
        }
        return 0;
   -}                                                                                                                                 
   +}
    
    static void
    advertise(void)
   @@ -93,8 +92,8 @@
        struct ble_gap_adv_params adv_params;
        struct ble_hs_adv_fields fields;
        /* advertising payload is split into advertising data and advertising
   -    response, because all data cannot fit into single packet; name of device
   -    is sent as response to scan request */
   +       response, because all data cannot fit into single packet; name of device
   +       is sent as response to scan request */
        struct ble_hs_adv_fields rsp_fields;
    
        /*fill all fields and parameters with zeros*/
   @@ -103,7 +102,7 @@
        memset(&rsp_fields, 0, sizeof(rsp_fields));
    
        adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
   -    adv_params.disc_mode =  BLE_GAP_DISC_MODE_GEN;
   +    adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
    
        fields.flags = BLE_HS_ADV_F_DISC_GEN |
                       BLE_HS_ADV_F_BREDR_UNSUP;
   @@ -117,7 +116,7 @@
        rsp_fields.name = (uint8_t *)device_name;
        rsp_fields.name_len = strlen(device_name);
        rsp_fields.name_is_complete = 1;
   -    
   +
        rc = ble_gap_adv_set_fields(&fields);
        assert(rc == 0);
    
   @@ -130,7 +129,7 @@
        assert(rc == 0);
    }
    
   -static void 
   +static void
    on_sync(void)
    {
        int rc;
   @@ -150,10 +149,11 @@
        MODLOG_DFLT(INFO, "Resetting state; reason=%d\n", reason);
    }
    
   -int main(int argc, char **argv)
   +int
   +main(int argc, char **argv)
    {
        int rc;
   -    
   +
        /* Initialize all packages. */
        sysinit();
    
   ```
   
   </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