This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[BLE]Active Observer problem with SCAN_REQ/RSP

Hello

I've been trying to create a simple BLE observer that outputs the nearby devices data onto the serial port using a PCA10001 board.

For this, I'm adapting the code for "nRF51-multi-role-conn-observer-advertiser" that can be found on the NordicS git: github.com/.../nRF51-multi-role-conn-observer-advertiser

Although the advertiser code is well documented, the observer is still in progress (19-08-14) as it is explained in the end of the page.

Anyway, I successfully compiled and uploaded the observer code onto the device. For testing purposes, I'm using a second BLE device that is constantly advertising, but only broadcasts the device's name when inquired with a SCAN_REQ packet.

The ADV_IND packets are well captured by the board but, even though I have the active scan enabled, no SCAN_RSP packets are ever received.

Looking at the code, after receiving a ADV_IND packet and "active scan" is enabled it sends a SCAN_REQ and waits for the response. As I'm trying to figure out if the REQ was ever sent I'm afraid that this feature is not fully implemented, as for the sending the SCAN_REQ packet only this code is available.

static void m_state_send_scan_req_entry (void)
{
  memcpy(&m_tx_buf[9], &m_rx_buf[3], 6);
  radio_buffer_configure (&m_tx_buf[0]);
  radio_tx_prepare ();
  
  m_scanner.state = SCANNER_STATE_SEND_REQ;
}

And is sent immediately after the arriving ADV_INI packet (shouldn't it wait 150us, as the core specification mandates?)

The timeout callback "ll_scan_timeout_cb()" is called with the state SCANNER_STATE_RECEIVE_SCAN_RSP showing that a SCAN_RSP packet never arrived during the timeout period.

My guess is that there is a problem with the SCAN_REQ code, but I'm not sure.

I've only been working with this nordic device for a few weeks now so I don't fully understand everything and it is possible that I'm missing something.

Any help is appreciated, if you need any more information, please let me know.

Thank you very much Manuel

Parents Reply Children
No Data
Related