This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sd_ble_gap_rssi_get channel

I want to get the RSSI of a connected device. The sequence will be as follows:

int8_t *p_rssi;

uint8_t *p_ch_index;

sd_ble_gap_rssi_start (m_conn_handle, BLE_GAP_RSSI_THRESHOLD_INVALID, 0x00);

sd_ble_gap_rssi_get(m_conn_handle, p_rssi, p_ch_index);

sd_ble_gap_rssi_stop (m_conn_handle);

The device is configured as a hid device connected to a smart phone.

Nordic Infocenter says p_ch_index is the pointer to the location where Channel Index for the RSSI measurement shall be stored.

I have only one connected phone. I wonder what the Channel Index has to do with this?

Besides, when I tried to get the rssi by implementing this function in a 2 second timer  I can no longer pair the device using the example ble_app_hid_mouse.

Parents
  • Hi,

    I have only one connected phone. I wonder what the Channel Index has to do with this?

    The channel index here lets you know which of the 40 BLE channels the measurement applies for. (BLE is always frequency hopping, using a number of channels, so this is not related to how many connections you have.)

    Besides, when I tried to get the rssi by implementing this function in a 2 second timer  I can no longer pair the device using the example ble_app_hid_mouse.

    I assume some error occurs since you observe this. Have you debugged to see what is going on? The easiest way to start is observe the logg. Then information about any detected errors will be printed in the log. UART logging is enabled by default in most examples, alternatively, you can enable RTT logging.

  • I'm using SDK V15 and enabled UART logging.

    I can see the following output to the hyperterminal that happened when I tried to pair:

    <info> app: CONNECTED <error> app: Fatal error <warning> app: System reset

    It looks like that doesn't give enough info. Please advise.

Reply Children
Related