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

How to read thingy's sensor data on nRF52840?

Hi.

I want to read thingy's sensor data. I'm using nRF52840 DK.

I have tried using ble_app_multi_link_multi_role example, but there are only read button state.

How can I get the other sensor?

Is the way to get other sensor like this code?

Thank you for reading.

 if (p_ble_evt->evt.gattc_evt.params.hvx.handle == p_ble_thingy_uis_c->peer_thingy_uis_db.button_handle)
    {
        if (p_ble_evt->evt.gattc_evt.params.hvx.len == 1)
        {
            ble_thingy_uis_c_evt_t ble_thingy_uis_c_evt;
            ble_thingy_uis_c_evt.evt_type                   = BLE_THINGY_UIS_C_EVT_BUTTON_NOTIFICATION;
            ble_thingy_uis_c_evt.conn_handle                = p_ble_thingy_uis_c->conn_handle;
            ble_thingy_uis_c_evt.params.button.button_state = p_ble_evt->evt.gattc_evt.params.hvx.data[0];
            p_ble_thingy_uis_c->evt_handler(p_ble_thingy_uis_c, &ble_thingy_uis_c_evt);
        }
    }

Related