diff --git a/examples/c++/nrf8001-broadcast.cxx b/examples/c++/nrf8001-broadcast.cxx index 2ddfa8f8..444f6a58 100644 --- a/examples/c++/nrf8001-broadcast.cxx +++ b/examples/c++/nrf8001-broadcast.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef SERVICES_PIPE_TYPE_MAPPING_CONTENT static services_pipe_type_mapping_t @@ -77,11 +78,11 @@ init_aci_setup () { /** * Point ACI data structures to the the setup data that the nRFgo studio generated for the nRF8001 */ - if (NULL != services_pipe_type_mapping) { - aci_state.aci_setup_info.services_pipe_type_mapping = &services_pipe_type_mapping[0]; - } else { - aci_state.aci_setup_info.services_pipe_type_mapping = NULL; - } + // abort if this is NULL + assert(services_pipe_type_mapping != NULL); + + aci_state.aci_setup_info.services_pipe_type_mapping = + &services_pipe_type_mapping[0]; aci_state.aci_setup_info.number_of_pipes = NUMBER_OF_PIPES; aci_state.aci_setup_info.setup_msgs = setup_msgs; diff --git a/examples/c++/nrf8001-helloworld.cxx b/examples/c++/nrf8001-helloworld.cxx index 1c63002b..6b25ecd2 100644 --- a/examples/c++/nrf8001-helloworld.cxx +++ b/examples/c++/nrf8001-helloworld.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include "uart_over_ble.h" /* @@ -95,11 +96,11 @@ init_aci_setup () { /** * Point ACI data structures to the the setup data that the nRFgo studio generated for the nRF8001 */ - if (NULL != services_pipe_type_mapping) { - aci_state.aci_setup_info.services_pipe_type_mapping = &services_pipe_type_mapping[0]; - } else { - aci_state.aci_setup_info.services_pipe_type_mapping = NULL; - } + // abort if this is NULL + assert(services_pipe_type_mapping != NULL); + + aci_state.aci_setup_info.services_pipe_type_mapping = + &services_pipe_type_mapping[0]; aci_state.aci_setup_info.number_of_pipes = NUMBER_OF_PIPES; aci_state.aci_setup_info.setup_msgs = setup_msgs;