Hi
I have done multilink with uart and getting data from multiple ble_uart peripheral. now i have to read data from only one peripheral . what will do for that.
I am using nrf52832
SDK15.0
Regards
Hi
I have done multilink with uart and getting data from multiple ble_uart peripheral. now i have to read data from only one peripheral . what will do for that.
I am using nrf52832
SDK15.0
Regards
This must be very simple to implement, but why would you connect to many peripherals if you only want to listen to one?
If you have any usecase to do it in this way, your app could then compare the incoming event connection handle with the connection handle you saved for the peripheral you want to listen to. Ignore the incoming data from any other peripheral.
This must be very simple to implement, but why would you connect to many peripherals if you only want to listen to one?
If you have any usecase to do it in this way, your app could then compare the incoming event connection handle with the connection handle you saved for the peripheral you want to listen to. Ignore the incoming data from any other peripheral.
Hi,
I connected two peripheral to central device. Both peripheral send data to central. central also print received data from both peripheral into terminal. But i want to select data from one specified peripheral and print only that data.
You save the connection handle of the peripheral that you want to listen in BLE_GAP_EVT_CONNECTED something like below
case BLE_GAP_EVT_CONNECTED: m_whitelist_peripheral_conn_handle = p_gap_evt->conn_handle;
and when you get the gatt event, you just compare the incoming event connection handle with this one before processing the data.
For example, if you are listening through notifications, then you will have something like below
static void on_hvx(ble_hrs_c_t * p_ble_hrs_c, const ble_evt_t * p_ble_evt) { if (m_whitelist_peripheral_conn_handle == p_ble_evt->evt.gattc_evt.conn_handle) { process_your_data(); // in your case, send this to UART } // if not, just ignore the incoming data from others. }