Ethan if I’m understanding right, you basically want to “do something” in the Server’s application layer, when the Server receives as discovery request (multicast to /oic/res).
If that’s right, I think you’ll need to modify the stack… I don’t know of any way to “hook” the in-stack “entity handler” (the request endpoint) for /oic/res. Your alternate Resource approach is more in keeping with the Specification (since side-effects on Discovery aren’t really a thing, AFAIK), but if that doesn’t work for your use case, then I think you’re looking at editing IoTivity code. Shouldn’t be too hard really but just make sure you are careful to not create side effects that change the Device/Resource state from an OCF perspective… that would be out of line with RESTful nature of the OCF Reource interfaces… make sense? Thanks, Nathan From: [email protected] [mailto:[email protected]] On Behalf Of Gregg Reynolds Sent: Tuesday, April 24, 2018 2:50 PM To: Wright, Ethan J <[email protected]> Cc: iotivity-dev <[email protected]> Subject: Re: [dev] oic/res entity handler On Tue, Apr 24, 2018, 4:26 PM Wright, Ethan J <[email protected]<mailto:[email protected]>> wrote: Sorry I didn't want to obfuscate the problem by providing too specific of information: I want to be able to kick off a gather devices request to a separate process, such as gathering the devices list from a hue bridge and registering any new lights as resources. Sorry, not at all clear to me. You need to make a clear distinction between what happens on the server and the client. I don't know what "kick off a gather devices request to a separate process" means. I just need to be able to catch when a discovery request is made to oic/res so I can build out the logic. AFAIK multicast discovery requests are handled by the stack, not the application. What do you mean by "build out the logic"? I've implemented it currently by building a resource "/bridge/oic/res" and then adding an entity handler for get requests but this feels like a hacked work around. /oic/res is an OCF-defined resource. You do not need to write a handler for discovery requests. Sorry, I'm still not quite grokking. Hopefully this clears things up a little, Ethan ________________________________ From: Gregg Reynolds <[email protected]<mailto:[email protected]>> Sent: Tuesday, April 24, 2018 3:14 PM To: Wright, Ethan J Cc: iotivity-dev Subject: Re: [dev] oic/res entity handler On Tue, Apr 24, 2018, 4:08 PM Wright, Ethan J <[email protected]<mailto:[email protected]>> wrote: Hi All, I've been reading through the documentation and have been having trouble finding a way to attach an entity handler to the default iotivity server interface oic/res. I'm hoping to expose oic/res so that my server can do extra things when hit with a discovery request. Please be more specific. What exactly are you trying to do, and what exactly is the problem you're having? What does "extra things" mean? Anyone have any clue where I would look to implement this? Thanks, Ethan Wright
_______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev
