Creating Ble Service with Nrf connect

I have a problem to advertise a service. When I include a header file, an extra service is automatically created. It seems like that the service will be advertised twice. Everything in the main code is running once and everything in the header file is running two times. Do you know the problem? Below you can see all the codes.

5050.main_mwe.cpp

8182.blewrap.cpp

Parents
  • Hi Mark,

    Thank you for contacting DevZone at NordicSemi. 

    Based on the information you have provided; I have created the project including these files and settings.

    I changed few settings as per my DK (NRF52840DK). I could build, flash, and see the output from this project.

    Here is the output as seen on the NRF Terminal:

    Do you see the same output?

    What do you mean by "everything in the header file is running two times". What specifically you mean by this? You have a class defination and few functions defined in the header file.

    Can you please elaborate more on it (with example / output etc.)? Also, with is the expected output / behavior and what actually is happening.

    Regards,

    Naeem

  • Thank you for youre response. I have the same output as you. The problem is when I connect the device ( which called "Foo 000003") in de NRF connect app I will see two times a "Environmental Sensing". But I only make it once. I have test a code with only a "#include "blewrapper.h". Then i see 3 times a  "Environmental Sensing" in the NRF connect app. So it looked like something is going wrong with the includes. Do you know the solution for this?

Reply
  • Thank you for youre response. I have the same output as you. The problem is when I connect the device ( which called "Foo 000003") in de NRF connect app I will see two times a "Environmental Sensing". But I only make it once. I have test a code with only a "#include "blewrapper.h". Then i see 3 times a  "Environmental Sensing" in the NRF connect app. So it looked like something is going wrong with the includes. Do you know the solution for this?

Children
Related