Updated discovery response when filter query does not match.
authorSachin Agrawal <sachin.agrawal@intel.com>
Wed, 22 Jul 2015 21:20:30 +0000 (14:20 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 23 Jul 2015 22:58:03 +0000 (22:58 +0000)
commit4ae05e44593957fc8ef1ae964f71b2378413b5bd
treeef2d234a8a1e2dcb5b73fb62a089d50e06ea60fd
parentb0b3f73c5bf04c9568681feef88194d5ac302942
Updated discovery response when filter query does not match.

Iotivity should respond to discovery requests in below manner:
If query filter matching fails (or if Server does not have
any DISCOVERABLE resources) and discovery request is multicast,
it should NOT send any response.
But, if the discovery request is unicast in above scenario,
it should send an error(RESOURCE_NOT_FOUND - 404) response with
empty payload.

Currently, Iotivity stack sends a response in all error scenarios
with return code as OC_EH_OK (along with some payload) which has
various drawbacks, such as, causes un-necessary traffic in the network
and also wastes power on constrained devices.

Change-Id: Ibb3bedc7b8ae67b708b89e9ad747c031ab552cae
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1766
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp
resource/csdk/stack/src/ocresource.c