2 * //******************************************************************
4 * // Copyright 2015 Samsung Electronics All Rights Reserved.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 #include "JniOcStack.h"
24 #include "JniProvisionResultListner.h"
25 #include "OCProvisioningManager.h"
28 #ifndef _Included_org_iotivity_base_OcSecureResource
29 #define _Included_org_iotivity_base_OcSecureResource
33 class JniOcSecureResource
36 JniOcSecureResource(std::shared_ptr<OCSecureResource> secureresource);
37 ~JniOcSecureResource();
39 static JniOcSecureResource* getJniOcSecureResourcePtr(JNIEnv *env, jobject thiz);
40 std::string getDeviceID(void);
41 std::string getIpAddr(void);
42 int getDeviceStatus(void);
43 bool getOwnedStatus(void);
44 OCSecureResource* getDevicePtr();
46 JniProvisionResultListner* AddProvisionResultListener(JNIEnv* env, jobject jListener);
47 void RemoveProvisionResultListener(JNIEnv* env, jobject jListener);
49 OCStackResult doOwnershipTransfer(JNIEnv* env, jobject jListener);
50 OCStackResult getLinkedDevices(JNIEnv *env, UuidList_t &uuidList);
51 OCStackResult provisionACL(JNIEnv* env, jobject acl, jobject jListener);
52 OCStackResult provisionPairwiseDevices(JNIEnv* env, jint type, jint keySize,
53 jobject acl1, jobject device2, jobject acl2, jobject jListener);
54 OCStackResult provisionCredentials(JNIEnv* env, jint type, jint keySize,
55 jobject device2, jobject jListener);
56 OCStackResult unlinkDevices(JNIEnv* env, jobject device2, jobject jListener);
57 OCStackResult removeDevice(JNIEnv* env, jint timeout, jobject jListener);
58 OCStackResult provisionDirectPairing(JNIEnv* env, jobjectArray jpdacls,jobject jListener,
59 std::string pin, std::vector<int> prms, int edp);
62 std::map<jobject, std::pair<JniProvisionResultListner*, int>> resultMap;
63 std::mutex resultMapLock;
64 std::shared_ptr<OCSecureResource> m_sharedSecureResource;
67 /* DO NOT EDIT THIS FILE BEYOND THIS LINE - it is machine generated */
73 * Class: org_iotivity_base_OcSecureResource
74 * Method: doOwnershipTransfer
75 * Signature: (Lorg/iotivity/base/OcSecureResource/DoOwnershipTransferListener;)V
77 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_doOwnershipTransfer
78 (JNIEnv *, jobject, jobject);
81 * Class: org_iotivity_base_OcSecureResource
82 * Method: removeDevice
83 * Signature: (ILorg/iotivity/base/OcSecureResource/RemoveDeviceListener;)V
85 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_removeDevice
86 (JNIEnv *, jobject, jint, jobject);
89 * Class: org_iotivity_base_OcSecureResource
90 * Method: unlinkDevices
91 * Signature: (Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/UnlinkDevicesListener;)V
93 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_unlinkDevices
94 (JNIEnv *, jobject, jobject, jobject);
97 * Class: org_iotivity_base_OcSecureResource
98 * Method: provisionCredentials1
99 * Signature: (IILjava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionCredentialsListener;)V
101 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionCredentials1
102 (JNIEnv *, jobject, jint, jint, jobject, jobject);
105 * Class: org_iotivity_base_OcSecureResource
106 * Method: provisionACL
107 * Signature: (Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionAclListener;)V
109 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionACL
110 (JNIEnv *, jobject, jobject, jobject);
113 * Class: org_iotivity_base_OcSecureResource
114 * Method: provisionPairwiseDevices1
115 * Signature: (IILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionPairwiseDevicesListener;)V
117 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionPairwiseDevices1
118 (JNIEnv *, jobject, jint, jint, jobject, jobject, jobject, jobject);
121 * Class: org_iotivity_base_OcSecureResource
122 * Method: provisionDirectPairing
123 * Signature: (Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionDirectPairingListener;)V
125 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionDirectPairing
126 (JNIEnv *, jobject, jstring, jobjectArray, jintArray, jint, jobject);
129 * Class: org_iotivity_base_OcSecureResource
130 * Method: getLinkedDevices
131 * Signature: ()Ljava/util/List;
133 JNIEXPORT jobject JNICALL Java_org_iotivity_base_OcSecureResource_getLinkedDevices
137 * Class: org_iotivity_base_OcSecureResource
139 * Signature: ()Ljava/lang/String;
141 JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcSecureResource_getIpAddr
145 * Class: org_iotivity_base_OcSecureResource
146 * Method: getDeviceID
147 * Signature: ()Ljava/lang/String;
149 JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcSecureResource_getDeviceID
153 * Class: org_iotivity_base_OcSecureResource
154 * Method: deviceStatus
157 JNIEXPORT jint JNICALL Java_org_iotivity_base_OcSecureResource_deviceStatus
161 * Class: org_iotivity_base_OcSecureResource
162 * Method: ownedStatus
165 JNIEXPORT jint JNICALL Java_org_iotivity_base_OcSecureResource_ownedStatus
169 * Class: org_iotivity_base_OcSecureResource
173 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_dispose