Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add getRssi() and Rssi related callback #153

Closed
hathach opened this issue May 12, 2018 · 9 comments
Closed

add getRssi() and Rssi related callback #153

hathach opened this issue May 12, 2018 · 9 comments

Comments

@hathach
Copy link
Member

hathach commented May 12, 2018

No description provided.

@baramuse
Copy link

baramuse commented Sep 5, 2018

Totally in for this one !
Still a bit new to the BT stack, will it give us the possibility to "measure" the distance between the devices ?
Is that a big job ?

@hathach
Copy link
Member Author

hathach commented Sep 5, 2018

not a big job, but I couldn't find time to work on this lib just now. You can find my hint here in the forum meanwhile

https://forums.adafruit.com/viewtopic.php?f=53&t=139645&p=691943&hilit=nrf52+rssi#p691943

@baramuse
Copy link

baramuse commented Sep 5, 2018

I actually started digging in the code and found the sd_ble_gap_rssi_start which I'm calling.
Now I've read the eventHandler code in BLEGap.cpp and it does not handle the BLE_GAP_EVT_RSSI_CHANGED event.
Is there a way to have an (sub?) eventHandler (like void BLEGap::_eventHandler(ble_evt_t* evt) in the sketch so I can catch those events ?

(oh and thanks for the answer :) )

@hathach
Copy link
Member Author

hathach commented Sep 5, 2018

you must call it within connection callback, I guess it must be called asap. Nordic docs doesn't mention this, I have been confusing like you before.

@baramuse
Copy link

baramuse commented Sep 5, 2018

Thanks for the tip, i'll start when connected then.
Any tips for hooking an event listener instead of constantly reading the last sample value ?

@hathach
Copy link
Member Author

hathach commented Sep 5, 2018

no we current doesn't have something like setBleEventCallback(), but may add it later on for user to work on unimplemented features. Much nicer than modifying the bsp code, which is a horrible lengthy code.

Update: #181

@baramuse
Copy link

baramuse commented Sep 5, 2018

Ok at least i know :)
I'll start by reading frequently the rssi value, then I'll see if I implement the event callback !

Thanks again !

(btw is that a good way to detect the proximity of an object ? I want to set leds depending on the proximity of a remote - an iPhone in this case)

@hathach
Copy link
Member Author

hathach commented Sep 5, 2018

proximity requires some processing filter and math calculation stuff, there is an example written by Kevin in the example/projects folder. He has more exp than me in this field. You may want to check that out.

hathach added a commit that referenced this issue Jan 22, 2019
@hathach hathach closed this as completed Feb 1, 2019
@hathach
Copy link
Member Author

hathach commented Feb 1, 2019

implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants