File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -411,17 +411,19 @@ void assert_nrf_callback (uint16_t line_num, uint8_t const * p_file_name)
411411// Process BLE event from SD
412412uint32_t proc_ble (void )
413413{
414- __ALIGN (4 ) uint8_t ev_buf [ BLE_EVT_LEN_MAX (BLEGATT_ATT_MTU_MAX ) ] = { 0 } ;
414+ __ALIGN (4 ) uint8_t ev_buf [ BLE_EVT_LEN_MAX (BLEGATT_ATT_MTU_MAX ) ];
415415 uint16_t ev_len = BLE_EVT_LEN_MAX (BLEGATT_ATT_MTU_MAX );
416416
417+ // Init header
418+ ble_evt_t * evt = (ble_evt_t * ) ev_buf ;
419+ evt -> header .evt_id = 0 ;
420+
417421 // Get BLE Event
418422 uint32_t err = sd_ble_evt_get (ev_buf , & ev_len );
419423
420424 // Handle valid event, ignore error
421425 if ( NRF_SUCCESS == err )
422426 {
423- ble_evt_t * evt = (ble_evt_t * ) ev_buf ;
424-
425427 switch (evt -> header .evt_id )
426428 {
427429 case BLE_GAP_EVT_CONNECTED :
You can’t perform that action at this time.
0 commit comments