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.

CC2652R7: Simple peripheral advertising mode setup.

Part Number: CC2652R7
Other Parts Discussed in Thread: SYSCONFIG, SYSBIOS

Hi,

I am unable to figure out under which function the mode of operation for the peripheral device like non-connectable, connectable etc are being set up in simple peripheral project. I understand we can change the mode of operation using simpleperipheral.syscfg file but I want to build a project of my own and want my device to work in non-connectable mode and for that I want to see the code of how to setup the device in a particular mode.

If I am choosing a particular mode in syscfg file where is the callback function for that?

Thanks,

Garvit

  • Hi Garvit,

    When developing on the CC13XX CC26XX SDK, it is highly recommended to import the example project that has the closest functionality to your desired use-case. Afterwards, modifications should be made to the sysconfig, application code, profiles, etc until the desired use-case is made.

    In this case, if you start with the simple_peripheral, then you may change the address mode through the SysConfig GUI as shown in the image below:

    Best Regards,

    Jan

  • Hi Jan,

    Thanks for the reply. I was looking for the function in the code where we are setting up the mode of operation of device like scannable, non connectable etc. I am not able to locate that in the simple peripheral code.

    Thanks,

    Garvit 

  • Hi,

    Understood, my apologies! When you update the address mode in SysConfig, it updates the DEFAULT_ADDRESS_MODE define which is used to initialize the addrMode variable shown below:

    This variable is then used in the GAP_DeviceInit() call to specify what address mode will be used. Afterwards, the stack handles everything to enable the address mode in the desired mode.

    Best Regards,

    Jan

  • Hi Jan,

    Apologies if I am using some wrong terminology or if I am missing some point here. 

    I want to know about the function or part of the code which is assigning the mode of operation a peripheral device will work in like connectable and scannable mode. I am not sure if it is linked to the addressing mode we are using.

    What I want to know is when I am setting the "Legacy Event Properties Options = Connectable and Scannable" under advertising parameters of broadcaster configuration in .syscfg file of simple peripheral project, where is the piece of code which is dealing with it in simple peripheral project.

    Thanks,

    Garvit

  • Hi Garvit,

    My sincerest apologies, I misunderstood your original question. Any changes made through SysConfig are identified in the Generated Files tab that may be opened by clicking on the following symbol:

    Afterwards, you will see the following:

    In the previous screenshot, you can see all of the files that are part of the SysConfig file generation. If any changes are made to the SysConfig while this window is opened, you will be able to see the exact difference the change made. For example, if we change the legacy event properties of the advertising parameter field for the first advertising set in simple_peripheral to Scannable Undirected (from Connectable Scannable undirected), we can see that the symbol next to the ti_ble_config.c, ti_sysbios_config.c and simple_peripheral.syscfg files changes. This denotes that these files were updated due to the change.

    If we click on the ti_ble_config.c file, then we will see the following: 

    We can see that the eventProps field of the advParams1 was changed and we can search for that variable in the simple_peripheral.c file. We can see that the variable is used during the creation and configuration of the advertising set in the next code snippet below:

    Specifically, the GapAdv_create() is the one that takes the advertising parameters and uses it to create the advertising set. It does all the necessary setup and processing in the background to ensure the advertising set is created properly and works as specified. To learn more about how the scanning and advertising parameters may be modified or changed, then I suggest referencing the Bluetooth LE Scanning and Advertising SLA.

    Best Regards,

    Jan