X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=android%2Fandroid_api%2Fbase%2Fsrc%2Fmain%2Fjava%2Forg%2Fiotivity%2Fbase%2FOcProvisioning.java;h=395021f443e5e56aa1260a8ff5bb3f714d7cb12d;hb=refs%2Ftags%2Ftizen_4.0.m2_release;hp=8cb282b0cbbcfe40372f58df3f0216433519d123;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/android/android_api/base/src/main/java/org/iotivity/base/OcProvisioning.java b/android/android_api/base/src/main/java/org/iotivity/base/OcProvisioning.java index 8cb282b..395021f 100644 --- a/android/android_api/base/src/main/java/org/iotivity/base/OcProvisioning.java +++ b/android/android_api/base/src/main/java/org/iotivity/base/OcProvisioning.java @@ -25,6 +25,7 @@ package org.iotivity.base; import java.util.List; import java.util.Arrays; import java.util.Map; +import java.util.EnumSet; /** * OcProvisionig represents functions corresponding to the provisioing of @@ -101,6 +102,68 @@ public class OcProvisioning { } /** + * API to Set callback for displaying verifNum in verified Just-Works. + * + *@param DisplayNumListener callback Listener to be registered for + displaying VerifyNUm. + *@throws OcException + */ + public static native void setDisplayNumListener( + DisplayNumListener displayNumListener) throws OcException; + + public static interface DisplayNumListener { + public int displayNumListener(String verifyNum); + } + + /** + * API to unregister DisplayNumListener Listener + * + *@return 0 on success, 1 on failure + *@throws OcException + */ + public static native int unsetDisplayNumListener() throws OcException; + + /** + * API to Set callback for getting user confirmation in verified + * Just-Works + * + *@param ConfirmNumListener callback Listener to be registered for getting user confirmation. + *@throws OcException + */ + public static native void setConfirmNumListener(ConfirmNumListener + confirmNumListener) throws OcException; + + public static interface ConfirmNumListener { + public int confirmNumListener(); + } + + /** + * API to unregister ConfirmMutualVerifyNum Listener + * + *@return 0 on success, 1 on failure + *@throws OcException + */ + public static native int unsetConfirmNumListener() throws OcException; + + /** + * API to set options for Mutual Verified Just-works + * Default is for both screen PIN display and get user confirmation. + * + */ + public static int setMVJustWorksOptions(EnumSet optionMask) throws OcException { + + int optionMaskInt = 0; + + for (MVJustWorksOptionMask ops : MVJustWorksOptionMask.values()) { + if (optionMask.contains(ops)) + optionMaskInt |= ops.getValue(); + } + return setMVJustWorksOptions0(optionMaskInt); + } + + private static native int setMVJustWorksOptions0(int optionsMask) throws OcException; + + /** * Method to get Array of owned and un-owned devices in the current subnet. * * @param timeout timeout in sec for the API to return. @@ -125,4 +188,50 @@ public class OcProvisioning { } private static native int saveTrustCertChain1(byte[] trustCertChain, int encodingType) throws OcException; + + /** + * Method to save pin type. + * + * @param pinSize Byte Len of Random pin. + * @param pinType Enumset of pin, see PinType for enums + * @throws OcException + */ + public static int setPinType(int pinSize, EnumSet pinType) throws OcException { + + int pinTypeInt = 0; + + for (PinType ops : PinType.values()) { + if (pinType.contains(ops)) + pinTypeInt |= ops.getValue(); + } + return setPinType0(pinSize, pinTypeInt); + } + private static native int setPinType0(int pinSize, int pinType) throws OcException; + + /** + * Method to save the seed value to generate device UUID + * + * @param seed buffer of seed value + * @throws OcException + */ + public static int setDeviceIdSeed(byte[] seed) throws OcException { + return setDeviceIdSeed1(seed); + } + private static native int setDeviceIdSeed1(byte[] seed) + throws OcException; + + /** + * API to save ACL, having multiple ACE's + * + *@param acl object + *@throws OcException + */ + public static native void saveACL(Object acl) throws OcException; + + /** + * API to do self ownership transfer. + * + *@throws OcException + */ + public static native void doSelfOwnershiptransfer() throws OcException; }