-
Notifications
You must be signed in to change notification settings - Fork 44
device.onrequest not implemented #22
Comments
Sakari, The onrequest is part of the OicServer object as per the spec ? interface OicServer: EventTarget { // enable/disable presence (discovery, state changes) for this device and its resources I thought the example wasn't correct. Or did I misunderstood? |
The The example is from the spec so it should be correct, @zolkis can you confirm. The |
Or is it so that the spec example is wrong and should be : |
Using |
@zolkis , I is it device.onrequest or resource.onrequest in the example? I assumed that the example was incorrect on the spec. |
You are right, the example is incorrect there: |
@zolkis Thanks for clarifying. |
When looking into it, it seems that I got confused in my previous comment because I've been working on developing a simpler API. With the current JS API, the example was actually (almost) right. The model is that a device has an address, so you can make requests to a device, but you include a resource id as well. The client, and server interface is on the device. So the example was correct in that the request handler has to be installed on the device. Moreover, on a given device there is one request handler function, and all resource specific code needs to integrate there. In the example we have one resource, so this is not very visible. Perhaps I should add another resource there to make this clear. We can also choose to break up this model, but Sakari quickly pointed out that we would run into different problems. Let's talk about this on the next meeting. I will anyway make a PR soon. |
According to the spec the following should work but it does not:
The onrequest is newer called and you need to use:
The text was updated successfully, but these errors were encountered: