I use nrf51822 sdk130 (central device) and nrf51822 sdk110(peripheral device). I want to get rssi value of the peripheral device using the central device without connection. Is it possible to read rssi value of peripheral device without connection?
I use nrf51822 sdk130 (central device) and nrf51822 sdk110(peripheral device). I want to get rssi value of the peripheral device using the central device without connection. Is it possible to read rssi value of peripheral device without connection?
Normally process going like this;
static void button_handler(uint8_t pin_no, uint8_t button_action)
{
if(button_action == APP_BUTTON_PUSH || button_action == BSP_BUTTON_ACTION_LONG_PUSH || BSP_BUTTON_ACTION_RELEASE)
{
switch(pin_no)
{
case BUTTON_1:
scan_start();
break;
default:
break;
}
}
}
THEN
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
uint32_t err_code;
const ble_gap_evt_t * p_gap_evt = &p_ble_evt->evt.gap_evt;
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_ADV_REPORT:
.
.
case BLE_GAP_EVT_CONNECTED:
.
.
Yes, looks good.
But I want to do this;
scan_start();
Get Rssi value
If Rssi value > some_value
Connect automatically device without press the button (without button_handler function)
I want to continuously get rssi value of the peripheral device using the central device without connection. Normally I start the scan_start function using button_handler function. Then connection establish occurs. But I dont want to do that. I want to Connect automatically device without press the button (without button_handler function). And I want the device not to reconnect until it leaves the bluetooth signal range.(think like KEYLESS GO - Mercedes). Is it possible?
Well you must then have something wrong in the code because if you scan only no connection is established, you will be just getting BLE_GAP_EVT_ADV_REPORT events. You can parse event data to get RSSI value out of it. Once you like it just simply call connect function which you normally call in button press handler. Don't see a problem, sorry.