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.

LAUNCHXL-CC2640R2: How to use the Scan Request Report ?

Part Number: LAUNCHXL-CC2640R2

Hi,

im working with the LP-CC2640R2 and simple_broadcaster example(blestack). I want to stop advertising after recieving a scan request from an observer(active scan).

So far i have just enabled the scan request report in the simpleboadcaster_init function: 

HCI_EXT_ScanReqRptCmd(HCI_EXT_ENABLE_SCAN_REQUEST_REPORT);

**
 * @brief       Enable/disable Scan Request Reports.
 *
 *				Enables or disables scan request reports. The default system value
 *				for this feature is disabled. When enabled, a received Scan Reuqest
 *				from a peer device during Advertising will result in a Scan Request
 *				Report sent from the controller of type @ref hciEvt_BLEScanReqReport_t.
 *
 * @par			Note
 *				There is no duplicate filtering associated with this command, although
 *				the Advertising Filter Policy still applies. <br>
 *				There is only one event type and this is always 0
 *
 * @par 		Note
 *				This command requires the following define in the stack .opt file:
 * > -DEXTRA_ADV_FEAT=SCAN_REQ_RPT_CFG
 *
 * @par			Usage
 *				1. Configure the Bluetooth low energy protocol stack to return the event
 * @code{.c}
 *				HCI_EXT_ScanReqRptCmd(HCI_EXT_ENABLE_SCAN_REQUEST_REPORT);
 * @endcode
 *				2. Check for and receive these events in the stack message processing function.
 *				The following example is from SimplePeripheral_processStackMsg(); //
 * @code{.c}
 *  			switch (pMsg->event)
 *  			{
 *  			  case HCI_GAP_EVENT_EVENT:
 *  			    {
 *  			      // Process HCI message
 *  			      switch(pMsg->status)
 *  			      {
 *  			        case HCI_LE_EVENT_CODE:
 *  			          {
 *  			            hciEvt_BLEScanReqReport_t* scanRequestReport = (hciEvt_BLEScanReqReport_t*)pMsg;
 *  			            if (scanRequestReport->BLEEventCode == HCI_BLE_SCAN_REQ_REPORT_EVENT)
 *  			            {
 *  			              // process ScanRequestReport here
 *  			            }
 *  			          }
 *  			          break;
 *
 * @endcode
 *
 *
 * @param       mode - @ref Scan_req
 *
 * @return      hciStatus_t
 * @return		@ref HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS : invalid mode
 */
extern hciStatus_t HCI_EXT_ScanReqRptCmd( uint8 mode );

1.Question:

How do i use this function? I have checked my SimpleBroadcaster_processStackMsg() function but it never reaches this point.

2.Question:

Is it possible to turn off the Scan Response in the last if-condition in the declaration.

Thank you

Aurel