-
Notifications
You must be signed in to change notification settings - Fork 57
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
Shawn Radio: Unregister message callback #8
Comments
I was checking this issue and I'm stuck on it as I am unable to find the function which would unregister the receiver. |
Hi There is no receiver unregistration from what I know. You could limit you can check the protocol class that works like that and the register/unregister functions in here Kostas On 12 February 2013 12:11, Shubham Somani [email protected] wrote:
|
Looks good, but
Kostas On 14 February 2013 20:16, Shubham Somani [email protected] wrote:
|
Thanks Kostas. |
Thanks :) |
also watch out this node_id indexing you do. I use 2byte random id's in my unless you do it with a nice pstl vector and u just push back... On 14 February 2013 20:33, Shubham Somani [email protected] wrote:
|
I get your point. I'll change the array to a pstl vector... |
@kostas |
Yes you can (any datatype actually) also see at the examples I gave you in Kostas On 14 February 2013 21:15, Shubham Somani [email protected] wrote:
|
Revised code with pstl vectors. Please point out any errors left. http://pastebin.com/qMiTs8LQ. Thanks. |
seems correct but you shouldn't use the node id as an id for a registered If you have a protocol A that registers for callbacks and a protocol B that
Also its better to make typedef struct s, so that the Protocol that something like that would be cleaner i guess. typedef typename Radio::s s; radio().register(s) flag is useless unless you want to finetune enable/disable functionality oh and reciever should be receiver :P Kostas ps. good job On 14 February 2013 22:34, Shubham Somani [email protected] wrote:
|
Thanks Kostas for seeing the revision and giving a better viewpoint. Umm (from what i understand) you want me to change the struct to typedefed type so that it can be instantiated and I should change my register and unregister functions so that they accept this struct as a parameter. right? What I don't understand is since node ID's can be duplicated...what should i use to compare with the vector list while unregistering? |
Hi again, On 16 February 2013 11:59, Shubham Somani [email protected] wrote:
This is also how shawn works similarly to other wsn nodes people use in Now the struct s parameter could be a reference to keep things more light.
something like this for instance
|
Thanks for helping again.
|
Hi, i took a step back to understand your general rationale.
Cause all my answers so far are more focused to a solution for (3). if it's On 16 February 2013 20:03, Shubham Somani [email protected] wrote:
|
Thanks Kostas for replying again. You have really been very helpful. I think i've implemented (3) correctly http://pastebin.com/jrR8Wn9h
|
the 2nd point of my comment is regarding unregister functionality to this specific radio in |
Implement the method unreg_recv_callback, currently it is:
int unreg_recv_callback( int idx )
{ return ERR_NOTIMPL; }
The text was updated successfully, but these errors were encountered: