Hi Ashwini,
You are right about findResource not working for unicast Get as the response
will not match the expected ?discovery? response.
My bad !!
The alternative way is to use constructResourceObject API, such as:
OCResource::Ptr aclResource =
constructResourceObject(?coap://192.168.1.10:6298?, "/oic/sec/acl", OC_IPV4,
false, {"oic.sec.acl"}, {"oic.mi.def"});
QueryParamsMap test;
aclResource->get(test, <GETCallback>);
This should work but currently there is an issue in the JSON payload formation
of ACL object. Currently it does not conform to the format of OIC resource
representation.
Unfortunately, until that issue is Fixed, it will be hard to retrieve ACL info
from C++ SDK layer.
I will update this list once we have added Fix for above issue.
Thanks
Sachin
503-264-8071
From: ak.ashwini1981 [mailto:[email protected]]
Sent: Thursday, June 11, 2015 12:44 AM
To: iotivity-dev at lists.iotivity.org; Agrawal, Sachin
Subject: RE: [dev] Get ACL from secure ACL resource
Hi Sachin,
Thanks for your inputs.
FindResource from android or c++ api is same.
Issue is when findResource is done on /oic/sec/acl, the request lands at acl
entityhandler as a GET request. Which inturn replies with json data and not the
expected discovery reply.
On client side it fails to create the OCResource object from this json.
Hence the call fails.
I guess either the ACL should be made discoverable so that oc/core replies or
ACL should be able to understand a discover call or GET call, which practically
i think is not feasible.
Waiting to hear from you.
Thanks,
Ashwini
On 11 Jun 2015 11:15, "Agrawal, Sachin" <sachin.agrawal at intel.com> wrote:
Ashwini,
I am NOT familiar with android-api.
But, with C++ API, you can perform a Get Unicast on /oic/sec/acl like this:
OCPlatform::findResource("", "coap://a.b.c.d:6298/oic/sec/acl", OC_IPV4,
&foundResource);
Let us know if it helps.
Sachin
From: iotivity-dev-bounces at lists.iotivity.org
[mailto:[email protected]] On Behalf Of ak.ashwini1981
Sent: Tuesday, June 09, 2015 10:03 PM
To: iotivity-dev at lists.iotivity.org
Subject: [dev] Get ACL from secure ACL resource
Hi List,
I am working on an android app where in i want to get the ACL of the selected
device.
I am using android-api for the purpose. ACL resource is not discoverable
resource.
AFAIK to do GET on a resource from android app i would need to have an object
of OCResource, generally which is returned as an argument in dicoveryCallback
function. Is there a way so that i can do unicast GET request on /oic/sec/acl
from android-api without the ACL rsource being discovered in discovery.
May be by creating OCResource from app and doing it?
Thanks.
Ashwini
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150616/18f3a50e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7768 bytes
Desc: not available
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150616/18f3a50e/attachment.p7s>