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);
61 std::map<jobject, std::pair<JniProvisionResultListner*, int>> resultMap;
62 std::mutex resultMapLock;
63 std::shared_ptr<OCSecureResource> m_sharedSecureResource;
66 /* DO NOT EDIT THIS FILE BEYOND THIS LINE - it is machine generated */
72 * Class: org_iotivity_base_OcSecureResource
73 * Method: doOwnershipTransfer
74 * Signature: (Lorg/iotivity/base/OcSecureResource/DoOwnershipTransferListener;)V
76 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_doOwnershipTransfer
77 (JNIEnv *, jobject, jobject);
80 * Class: org_iotivity_base_OcSecureResource
81 * Method: removeDevice
82 * Signature: (ILorg/iotivity/base/OcSecureResource/RemoveDeviceListener;)V
84 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_removeDevice
85 (JNIEnv *, jobject, jint, jobject);
88 * Class: org_iotivity_base_OcSecureResource
89 * Method: unlinkDevices
90 * Signature: (Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/UnlinkDevicesListener;)V
92 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_unlinkDevices
93 (JNIEnv *, jobject, jobject, jobject);
96 * Class: org_iotivity_base_OcSecureResource
97 * Method: provisionCredentials1
98 * Signature: (IILjava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionCredentialsListener;)V
100 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionCredentials1
101 (JNIEnv *, jobject, jint, jint, jobject, jobject);
104 * Class: org_iotivity_base_OcSecureResource
105 * Method: provisionACL
106 * Signature: (Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionAclListener;)V
108 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionACL
109 (JNIEnv *, jobject, jobject, jobject);
112 * Class: org_iotivity_base_OcSecureResource
113 * Method: provisionPairwiseDevices1
114 * Signature: (IILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lorg/iotivity/base/OcSecureResource/ProvisionPairwiseDevicesListener;)V
116 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_provisionPairwiseDevices1
117 (JNIEnv *, jobject, jint, jint, jobject, jobject, jobject, jobject);
120 * Class: org_iotivity_base_OcSecureResource
121 * Method: getLinkedDevices
122 * Signature: ()Ljava/util/List;
124 JNIEXPORT jobject JNICALL Java_org_iotivity_base_OcSecureResource_getLinkedDevices
128 * Class: org_iotivity_base_OcSecureResource
130 * Signature: ()Ljava/lang/String;
132 JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcSecureResource_getIpAddr
136 * Class: org_iotivity_base_OcSecureResource
137 * Method: getDeviceID
138 * Signature: ()Ljava/lang/String;
140 JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcSecureResource_getDeviceID
144 * Class: org_iotivity_base_OcSecureResource
145 * Method: deviceStatus
148 JNIEXPORT jint JNICALL Java_org_iotivity_base_OcSecureResource_deviceStatus
152 * Class: org_iotivity_base_OcSecureResource
153 * Method: ownedStatus
156 JNIEXPORT jint JNICALL Java_org_iotivity_base_OcSecureResource_ownedStatus
160 * Class: org_iotivity_base_OcSecureResource
164 JNIEXPORT void JNICALL Java_org_iotivity_base_OcSecureResource_dispose