Closed qiuzhong closed 7 years ago
Since we no longer specify whether the stack is to run in client mode or whether it is to run in server mode, I have no choice but to start the lowlevel stack with OCInit(null, 0, OC_CLIENT_SERVER)
. This means that even if you just start a client, there will be a server on the network, that will have some default resources. When you then call findResources()
the client discovers the resources it itself exposes.
I guess in client mode we'd expect to have an object without the server
and platform
properties.
I propose adding an init(mode)
and a stop()
function.
Why not a parameter to require
?
ocf
object may be attached to a global object.
For iotivity-node-1.2.0-2, when there is no OCF server running,
findResources
still gets 4 resources with the href:For iotivity-node-1.1.1-3, it will return just []
These resources can still be discovered if there are any other OCF servers running. Not sure if this change comply the spec.