RSSI + MIT APP INVENTOR + BLE - Nordic Q&A

文章推薦指數: 80 %
投票人數:10人

Hello,. I'm using an nrf52dk board and I am trying to get the RSSI value, and it works fine with the nrfconnect app, except that the the transfer doesn't ... NordicQ&A Guides Blog OnlinePowerProfiler Home  >  NordicQ&A State NotAnswered Replies 1reply Subscribers 24subscribers Views 200views Users 0membersarehere development software bluetooth5 nrf52832 Attachments(0) NordicCaseInfo CaseID: 278815 Options Share More Cancel RSSI+MITAPPINVENTOR+BLE Hello, I'musingannrf52dkboardandIamtryingtogettheRSSIvalue,anditworksfinewiththenrfconnectapp,exceptthatthethetransferdoesn'tstartatthefirstconnectbutjustwhenIconnect,disconnectandreconnectthedevices(nrf52dkandnrfconnectonandroidtablet). MymainproblemisthatwhenitrytomakethesamethingwiththeMIT appinventorapplication,itdoesn'tworkatall. Idon'tgetanyrssieventchangeanymoreandIwaswonderingifsomeonecouldgivemesomeadvicehowtosolvethisproblemoranotherwaytoseeifthedistancebetweenthetwodevicesisgettingbigger? GreetinsfromSwitzerland Ale staticvoidble_evt_handler(ble_evt_tconst*p_ble_evt,void*p_context) { ret_code_terr_code=NRF_SUCCESS; switch(p_ble_evt->header.evt_id) { caseBLE_GAP_EVT_DISCONNECTED: NRF_LOG_INFO("Disconnected."); //LEDindicationwillbechangedwhenadvertisingstarts. break; caseBLE_GAP_EVT_CONNECTED: NRF_LOG_INFO("Connected."); err_code=bsp_indication_set(BSP_INDICATE_CONNECTED); APP_ERROR_CHECK(err_code); sd_ble_gap_rssi_start(m_conn_handle,1,0); m_conn_handle=p_ble_evt->evt.gap_evt.conn_handle; err_code=nrf_ble_qwr_conn_handle_assign(&m_qwr,m_conn_handle); APP_ERROR_CHECK(err_code); break; caseBLE_GAP_EVT_PHY_UPDATE_REQUEST: { NRF_LOG_DEBUG("PHYupdaterequest."); ble_gap_phys_tconstphys= { .rx_phys=BLE_GAP_PHY_AUTO, .tx_phys=BLE_GAP_PHY_AUTO, }; err_code=sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle,&phys); APP_ERROR_CHECK(err_code); }break; caseBLE_GATTC_EVT_TIMEOUT: //DisconnectonGATTClienttimeoutevent. NRF_LOG_DEBUG("GATTClientTimeout."); err_code=sd_ble_gap_disconnect(p_ble_evt->evt.gattc_evt.conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); APP_ERROR_CHECK(err_code); break; caseBLE_GATTS_EVT_TIMEOUT: //DisconnectonGATTServertimeoutevent. NRF_LOG_DEBUG("GATTServerTimeout."); err_code=sd_ble_gap_disconnect(p_ble_evt->evt.gatts_evt.conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); APP_ERROR_CHECK(err_code); break; caseBLE_GAP_EVT_RSSI_CHANGED: rssi=p_ble_evt->evt.gap_evt.params.rssi_changed.rssi; NRF_LOG_INFO("RSSI:%d",rssi); break; caseBLE_GAP_EVT_ADV_REPORT: NRF_LOG_INFO("RSSI:%d",p_ble_evt->evt.gap_evt.params.adv_report.rssi); APP_ERROR_CHECK(err_code); break; default: //Noimplementationneeded. break; } } Parents 0 4monthsago Jared 8488 pts. Hi, Strange,Idon'tseeanyreasonsforittonotstartuponthefirstconnectionunlesstheconnectionisn'tsuccessfulthefirsttimeyoutry?CouldyoutrysettingabreakpointattheCONNECTEDeventandseeiftheprogramentersitonthefirsttime?CouldyoudoasimilarapproachandsetabreakpointattheRSSI_CHANGED?  regards Jared  Cancel Up 0 Down Reply VerifyAnswer Cancel Reply 0 4monthsago Jared 8488 pts. Hi, Strange,Idon'tseeanyreasonsforittonotstartuponthefirstconnectionunlesstheconnectionisn'tsuccessfulthefirsttimeyoutry?CouldyoutrysettingabreakpointattheCONNECTEDeventandseeiftheprogramentersitonthefirsttime?CouldyoudoasimilarapproachandsetabreakpointattheRSSI_CHANGED?  regards Jared  Cancel Up 0 Down Reply VerifyAnswer Cancel Children NoData Related



請為這篇文章評分?