Hi,
There is a method in OcPlatform class that does exactly what you want to do: 
?public static OcResourceHandle registerResource(OcResource ocResource)?.
Regarding the second issue: there is a patch submitted and merged that 
addresses this. Make sure you have the latest IoTivity sources and look for 
?registerResource1? in ?android/android_api/base/jni/JniOcPlatform.cpp?. 
Registering a resource with a NULL entity handler is now allowed for Android 
too.
Best Regards,
Cosmin

From: iotivity-dev-bounces at lists.iotivity.org 
[mailto:[email protected]] On Behalf Of ???
Sent: Friday, September 18, 2015 3:49 PM
To: Kourt, Tim A
Cc: iotivity-dev at lists.iotivity.org
Subject: [dev] OcPlatform.registerResource function with NULL entity handler as 
a parameter for Android platform


Hi. Tim.



While I'm trying to implement a sample application for group action feature, I 
found that there is no OcPlatform.registerResource() with 2 parameters in 
android APIs.



In Linux platform, we're using the registerResource function to register a 
remote resource which is found in a network.(Please see foundResources function 
in groupserver.cpp file in things-manager folder.)

The prototype looks like below:

        OCStackResult registerResource(OCResourceHandle& resourceHandle, const 
std::shared_ptr< OCResource > resource) defined in OCPlatform.cpp

The problem is that this function is not supported for Android platform.



For Android, there is only one registerResource function like below:

  public static OcResourceHandle registerResource(
            String resourceUri,
            String resourceTypeName,
            String resourceInterface,
            EntityHandler entityHandler,
            EnumSet<ResourceProperty> resourcePropertySet)



To solve the problem, we tried to use this function with a NULL entityHandler 
parameter, but an exception after NULL checking was returned.



Please look into this problem.



Thank you in advance.



BR, Jihun Ha.



?????. ??? ??.



Best Regards,



Jihun Ha (???/???, Ph.D.)

IoT, IoTivity, OIC | IoT Solution Lab

Software R&D Center | Samsung Electronics Co., Ltd

Mobile +82 10 2533 7947

jihun.ha at samsung.com | jhha85 at gmail.com



[cid:image001.gif at 01D0F237.815AF7D0]

[http://ext.samsung.net/mailcheck/SeenTimeChecker?do=d34f4c7541b8737e1626878d52020bffb2893888e0e0ac55a9b245bbf05ab6f693b88b5cdcaca3638c238075770efdd88a3bd3da7f658eba62e1ac75b522795a07805447a154a46fcf878f9a26ce15a0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150918/5e7044c9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 13168 bytes
Desc: image001.gif
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150918/5e7044c9/attachment.gif>

Reply via email to