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.

CCS/CC1352R: Bluetooth® forum

Part Number: CC1352R

Tool/software: Code Composer Studio

Hi All,

I am working with MULTIROLE code in CC1352R. I wanted to know how switching is done from central to peripheral and from peripheral to central.And how to code flow goes on when I press right button and  left button.

Thanks&Regards

NIHARIKA

  • There is no dedicated document for this. You can refer to e2e.ti.com/.../bluetooth-low-energy-multi-role-demystified and study source code by yourself.
  • Hi YK Chen,

    I observed in example code of multi role that scanning of devices,read/write,disconnection takes through key pressed.But I want my code in such a way that when default it should advertises (Peripheral) which function is related to this
    and to start communication it should be like central.
    I want how switching process takes

    Thanks&Regards
    NIHARIKA
  • Hi Naharika,

    The example is written to act as a central and peripheral simultaneously.

    From what you write, it sounds like you want the application to advertise non-connectable, and stop advertising and start scanning/initiate a connection. You can re-write the application to your needs.

    You can read more about how the application works in the readme file.
  • Hi Marie,

    I have added my advertisement data and checked it is advertising or not with BTOOL. It is advertising.
    Now my idea is to switch to central and start discovering of that device So, firstly I disabled data advertising . In multi_role_advertInit(); function I have commented status=GapAdv_enable(advHandleLegacy,Gap_ADV_ENABLE_OPTIONS_USE_MAX,0);
    and instead of that I changed like this status=GapAdv_disable(advHandleLegacy);
    and called function for discovering devices function.

    My question is that this is only change for switching from peripheral to central or anything else I need to disable/enable .please let me know.

    Thanks&Regards,
    NIHARIKA
  • Hi Niharika,

    I guess you should add some BLE central functionality?
  • Hi Marie,

    1 . what is that some BLE central functionality which is to be added???
    2. Actually the default example code works based on buttons. But I wanted it should work automatically .what are the changes and
    where I need to do in code????
    3. I wanted multi role code should work in such a way that when I required it should work as peripheral and when required to work as
    central it should work like that.How do I make this possible????
    4. Till date I have coded like I had disabled the advertisement data and started discovering of devices.so, that it starts scanning of
    devices and completely functions as central but I wanted to know is that way I am going is correct if I wanted to do in way that I have
    mentioned in 3. question

    Thanks&Regards
    NIHARIKA
  • Hi Niharika,

    1. You don't need to add anything if you're happy with how the default multi_role application works.
    2. You should remove the hole menu system then (multi_role_menu.c/h and two_button_menu.c/h). Button presses are handled in multi_role_handleKeys(). You would have to move this functionality into wherever you find suitable in the application.
    3. You already achieved this?
    4. Yes this sounds correct.