How to broadcast raw data in beacon mode?

Hello,

             I am using PCA10040 DK for the programming with ble_app_beacon_pca10040_s132 example code. I want to broadcast my 20 bytes of data with my 0xFFE0 UUID.

In this example, I am trying to modify the m_beacon_info[] buffer with my custom data and want to broadcast directly raw data, But could not able to do that if I change any in m_beacon_info[] buffer code does not work, ble_advdata_encode() function does not initialise properly? I don't want to use any service, just want to transmit 20 bytes directly. Is this possible?

Can anyone tell me if yes? how to do that?

Thanks in advance!!

Parents
  • Hello Ashish,

    You can add ''Debug'' in your preprocessor definition.  

     

    One thing is you have to uncomment the APP_ERROR_CHECK(err_code) from the code. It needs in the code so that developer can recognize what function does not execute properly.

    For example, if we comment out APP_ERROR_CHECK(err_code) after

    err_code= sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params); it will not crash but the advertisement will not be set according to configuration.

    Because we do not know whether NRF_SUCCESS (==0) or some error. then the following line of codes will not work properly.

    if(err_code == NRF_SUCCESS)
    {
    NRF_LOG_INFO("sd_ble_gap_adv_set_configure init successful !");
    }else
    {
    NRF_LOG_INFO("sd_ble_gap_adv_set_configure init failed !");
    }

    You can see the consequence after doing these changes in your application and let us know.

    Hope it helps. Have a nice weekend.

    Best Regards,

    Kazi Afroza Sultana

Reply
  • Hello Ashish,

    You can add ''Debug'' in your preprocessor definition.  

     

    One thing is you have to uncomment the APP_ERROR_CHECK(err_code) from the code. It needs in the code so that developer can recognize what function does not execute properly.

    For example, if we comment out APP_ERROR_CHECK(err_code) after

    err_code= sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params); it will not crash but the advertisement will not be set according to configuration.

    Because we do not know whether NRF_SUCCESS (==0) or some error. then the following line of codes will not work properly.

    if(err_code == NRF_SUCCESS)
    {
    NRF_LOG_INFO("sd_ble_gap_adv_set_configure init successful !");
    }else
    {
    NRF_LOG_INFO("sd_ble_gap_adv_set_configure init failed !");
    }

    You can see the consequence after doing these changes in your application and let us know.

    Hope it helps. Have a nice weekend.

    Best Regards,

    Kazi Afroza Sultana

Children
No Data
Related