Hi,
I am implementing a client (using Java DSK) discovering resources via
IoTivity cloud.
After a successful sing-in to the cloud, I manage to discover the resources
from the cloud. However, a* second attempt to perform the resource
discovery* from the cloud - always results in *UNAUTHORIZED_REQ* exception.
*Is it by design? Is there a requirement to peform sign-in before every
resource discovery request?*
More details about the issue...
I use version 1.3.1 with Java SDK.
The flow of my code: (trying to mimic the aircon_controller.cpp sample)
private final String cloudEndPoint = "coap+tcp://[myipaddr]:[myport]";
accountManager =
OcPlatform.constructAccountManagerObject(cloudEndPoint,
EnumSet.of(OcConnectivityType.CT_ADAPTER_TCP));
accountManager.signIn(sid, token, new
OcAccountManager.OnPostListener() // I get a success callback
// The 1st call to findResource always succeeds
OcPlatform.findResource(
cloudEndPoint,
"/oic/res",
EnumSet.of(OcConnectivityType.CT_ADAPTER_TCP,
OcConnectivityType.CT_IP_USE_V4),
new OcPlatform.OnResourceFoundListener() ) // getting a
success at the 1st call
*// Problem: from here, every time I repeat the call to
OcPlatform.findResource() - it fails with exception UNAUTHORIZED_REQ*
I would appreciate an input on how to resolv this issue in the right way.
Thanks in advance
Max
--
Max Kholmyansky
Software Architect - SURE Universal Ltd.
http://www.sureuniversal.com
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev