This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC2541: cc2541 is not advertising when it should be.

Part Number: CC2541

Tool/software: TI C/C++ Compiler

Hi,everyone,

    My applicaton is based on peripheral,and the protocol stack is  1.4.2.

     I found the following questions.

     1. The cc2541 will advertise after the phone is disconnected in normal working scene.

     2. The cc2541 is not  advertising sometimes when the phone is disconnected and reconnected  frequently.( 20+ times)               In this state,   gapRole_state = GAPROLE_ADVERTISING in peripheral.c  

    3.  The cc2541 will return to work after resetting it.

 How can i solve this  problem?

  • You can use a periodic event to check if device is disconnected and doesn't doing advertising, you restart advertising from the event.
  • Hi,YK Chen
    Thanks for your answer.
    My question is how can i detect that it doesn't advertising actually?
    What is the state of the device is based gapRole_state value which is in peripheral.c . And the gapRole_state tell me that it is advertising,but it not actually.
    Is there any other way to view the status of the device?

    Best wish for your answer.
  • Using SimpleBLEPeripheral as example, you can check cases in peripheralStateNotificationCB. If it is not one of GAPROLE_ADVERTISING, GAPROLE_ADVERTISING_NONCONN, GAPROLE_CONNECTED, and GAPROLE_CONNECTED_ADV, you can try to restart advertising.
  • Hi,YK Chen
    Thanks for your answer.
    In peripheralStateNotificationCB, the newState value is the gapRole_state value ,and i have try it. It is the same.
    the newState value is GAPROLE_ADVERTISING,but it isn't advertising actually.
    For this problem, i am very confuse.

    (I‘m waiting for mass production)

    Best wish for your answer.