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.

BLE Peripheral+Broadcaster multiple role

Other Parts Discussed in Thread: CC2541

Hi,

I'm developing a simple application based on simpleBLEPeripheral to use peripheral/broadcaster multiple roles..

I excluded peripheral.c and peripheral.h from build, and included peripheralBroadcaster.c and peripheralBroadcaster.h. (as mentioned in the software developer's guide)

And furthermore, I defined PLUS_BROADCASTER in the processor symbols.

Finally, I changed gapRole_profileRole value in the peripheralBroadcaster.c as below.

    gapRole_profileRole = (GAP_PROFILE_PERIPHERAL);


I used a SmartRF EB to establish connection and scanned by using BTool to receive advertising data during connection.

But, as a result, I cannot receive any advertising data.

Do I have something wrong?

  • Hello,

    i download the "PeripheralBroadcaster - Peripheral device sending out advertisements while connected. "  form wiki web side.

    but i can not success for advering  while connected.

    Any one can help check it?

    thansk

  • Hi,

    Just press the left button :).

    If you using packet sniffer, don't "connect" to the initiator.

    Hope that helps...

  • Hi,

    I have the same problem here!

    I am using the TI BLE SDK 1.3.2

    As "In order to use this multi-role functionality, the files peripheral.c and peripheral.h should be excluded from the build, and the files peripheralBroadcaster.c and peripheralBroadcaster.h should be included. In addition, the preprocessor value PLUS_BROADCASTER should be defined when using the peripheral / broadcaster multi-role profile."

    I did all these things above, but It doesn't advertising data at all.  

    So I can not connect the BLE module either.

    Are there something wrong with the BLE SDK?

    Jeff

  • Hello,

    I am also having this issue. After following the same directions, the project failed to compile. I got the project to compile by changing line 45 in peripheralBroadcaster.c from: #include "hci.h"   to: #include "hci_tl.h"

    Still, the device does not advertise, nothing shows up on the sniffer.

    Have you solved this problem yet? I will be working on fixing it this week...

    Seth

  • Just an update,

    I noticed that the OSAL task: GAPRole_ProcessEvent is not being executed... ever.

    I also noticed that GAP_DeviceInit function in gap.c does not support a case for profileRole == (GAP_PROFILE_PERIPHERAL | GAP_PROFILE_BROADCASTER).

    This causes the variable, stat, to be INVALIDPARAMETER, so the the functions: GAP_PeriDevMgrInit and SM_ResponderInit do not get called.

    So I tried working around this by creating a case for (GAP_PROFILE_PERIPHERAL | GAP_PROFILE_BROADCASTER). Now, those 2 functions, GAP_PeriDevMgrInit and SM_ResponderInit, do get called during GAP_DeviceInit. Also, GAPRole_ProcessEvent is now being executed.

    The problem I am running into now, in GAPRole_ProcessEvent, is the GAP_MakeDiscoverable function. It does not execute properly and returns the error: bleNotReady.

    I included the colors to avoid confusion with all of the different functions that I am referencing.

    Regards,

    Seth

  • Same problem.  Please help.  GAP_MakeDiscoverable returning error. 

    Sam

  • I believe I have solved this.

    Here are my steps to getting the TI provided SimpleBLEPeripheral to work as a Peripheral + Broadcaster Role:

    1) Follow the TI instructions (enable PLUS_BROADCASTER, exclude peripheral.c, include peripheralBroadcaster.c)

    {Steps 2 through 6 are all done in peripheralBroadcaster.c}

    2) Change line 45: #include "hci.h" to: #include "hci_tl.h"

    <<Now the Project Compiles>>

    3) Change line 641: (GAP_PROFILE_PERIPHERAL | GAP_PROFILE_BROADCASTER) to GAP_PROFILE_PERIPHERAL

    <<Now the device will  advertise>>

    4) In peripheralBroadcaster.c: After line 970: insert this line: VOID osal_set_event( gapRole_TaskID, START_ADVERTISING_EVT );

    <<Now the device continues to advertise after it has connected to a central device>>

    5) Change line 927: comment out: //gapRole_AdvEnabled = FALSE;

    6) After line 927: insert this line: VOID osal_start_timerEx( gapRole_TaskID, START_ADVERTISING_EVT, 1000 );

    <<Now, after disconnecting from central device, the device will resume advertising (after 1000 ms)>>


    This worked for me. Hope it helps!

  • I tried the steps outlined by Seth and it sort of works on the 1.4 stack. However peripheralStateNotificationCB() is reporting GAPROLE_ERROR's periodically when I am connected to a host.

    I really wish TI would support this properly. The fact that none of the projects compile without changing the hci include file indicates that TI is certainly not testing this.

  • Things are much different in the 1.4 release vis a vis PLUS_BROADCASTER. See http://processors.wiki.ti.com/index.php/LPRF_BLE_Porting_Projects .

  • Hi Elliot,

    I'm trying to compile The SimpleBlePeripheral PLUS_BROADCASTER using BLE 1.4 but, during the connection the device stop to advertise and it is impossible to scan it. Seems that the PLUS_BROADCASTER doesn't work in BLE 1.4 or I'm missing something.

    I need that my device sends the advertise and respond to the scan request when it is connected to a client device.

    Any suggestion regarding this topic ?

    Thanks,

    Vittorio

  • That does work in stack 1.3.2 with cc2541

    But the peripheral + broadcaster has become very slow when the central (the app: BLE Scanner of android ) is connecting, and try to discover its services.

    it costs about 5~7 seconds, for SimplePeripheral of stack 1.3.2.

    It still be slightly slow in discovering characteristics and read data, but the speed is acceptable.

    Is there anyway to speed up the discovering service time on peripheral + broadcaster mixed mode?

    Thank you lots.