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

No observe event #7

Closed
ghost opened this issue Apr 3, 2018 · 2 comments
Closed

No observe event #7

ghost opened this issue Apr 3, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 3, 2018

Hello,

I am using coap-node to emulate a lwm2m client.
I noticed that when observe events are received by the COAP stack, they are not forwarded to my application (see extract below)
Anything wrong with what I am doing ?
Thanks for helping

coapnode.register(Lwm2m_Host,Lwm2m_Port,function(err,rsp) {
         if (rsp.status == '2.01')  {
            nb_registered++;
            Devices[d_index].registered=1;
            coapNode[d_index]=coapnode;
            d_index++;
            if (d_index <= last_index) {
               setTimeout(next_reg,Reg_Timer_ms,d_index);
            }
         }
      });
      coapnode.on('registered',function() {
         if (verbose==1)
            console.log("Registration of "+Devices[d_index].Name+" done");
      });
      coapnode.on('observe',((mydev_index) => {return(req) => {
         console.log("Observe for "+Devices[mydev_index].Name+" received: ",req);
         Devices[mydev_index].observed=1;
         nb_observed++;
      };})(d_index));
@ghost
Copy link
Author

ghost commented Apr 4, 2018

OK,, I modified components/reqHandler.js so that it sends the observe event, works fine.

@ghost ghost closed this as completed Apr 4, 2018
@PeterEB
Copy link
Owner

PeterEB commented Apr 9, 2018

Hi @luclecocq ,

Thanks for your feedback, I will add observe event at the latest version.

This issue was closed.
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

1 participant