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.

CC2640R2F: multi-role

Part Number: CC2640R2F

Dear All,

I am trying to add multi-role function to my simple-peripheral project.

Now I have encountered a problem. My device can't scan other sensors.

Here is my scan function code :

#define INVALIDPARAMETER 0x02 //!< Invalid Parameter


Status=GAPRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,
DEFAULT_DISCOVERY_ACTIVE_SCAN, DEFAULT_DISCOVERY_WHITE_LIST);
/INVALIDPARAMETER

Display_printf(dispHandle, 23, 0, "\r\n ,Discovering status: %d...\r\n",Status);

Discovering status: 2...


My question are:

1.Do I have to change device mode from peripheral to central.
If so, How to chagne it?

2. Why I received a INVALIDPARAMETER error code after doing the scan function.


Thanks.

  • Hi,

    If you would like to add scanning functionality to the simple_peripheral project, then I would recommend simply switching over the multi_role project if possible. The multi_role project implements peripheral + central functionality out of the box and is a great starting point for central + peripheral projects. However, if you cannot switch over to multi-role , then to add multi_role functionality I would reference the multi_role project and modify the simple_peripheral project accordingly. 

    Make sure to also update the build_config.opt file as needed (present in the stack project within the tools folder). One of the most important modifications is to update the build_config.opt to use the proper BLE Host Build Configurations:

    If switching peripheral only to peripheral+central, then the proper define must be made (shown above).

    Best Regards,

    Jan