1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
21 #ifndef SIMULATOR_RESOURCE_JNI_H_
22 #define SIMULATOR_RESOURCE_JNI_H_
25 #include "simulator_resource.h"
27 class JniSimulatorResource
30 JniSimulatorResource(SimulatorResourcePtr &resource);
32 static jobject toJava(JNIEnv *env, jlong resource);
33 static void setUri(JNIEnv *env, jobject jobj, const std::string &uri);
34 static void setResourceType(JNIEnv *env, jobject jobj, const std::string &resourceType);
35 static void setResourceName(JNIEnv *env, jobject jobj, const std::string &name);
36 static void setInterfaceType(JNIEnv *env, jobject jobject, const std::string &interfaceType);
37 static SimulatorResourcePtr getJniSimulatorResourcePtr(JNIEnv *env, jobject thiz);
39 SimulatorResourcePtr m_sharedResource;
46 JNIEXPORT jobject JNICALL
47 Java_org_iotivity_simulator_SimulatorResourceServer_getModel
50 JNIEXPORT void JNICALL
51 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeFromAllowedValues
52 (JNIEnv *, jobject, jstring, jint);
54 JNIEXPORT void JNICALL
55 Java_org_iotivity_simulator_SimulatorResourceServer_setRange
56 (JNIEnv *, jobject, jstring, jint, jint);
58 JNIEXPORT void JNICALL
59 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeInteger
60 (JNIEnv *, jobject, jstring, jint);
62 JNIEXPORT void JNICALL
63 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeDouble
64 (JNIEnv *, jobject, jstring, jdouble);
66 JNIEXPORT void JNICALL
67 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeBoolean
68 (JNIEnv *, jobject, jstring, jboolean);
70 JNIEXPORT void JNICALL
71 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeStringN
72 (JNIEnv *, jobject, jstring, jstring);
74 JNIEXPORT void JNICALL
75 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeInteger
76 (JNIEnv *, jobject, jstring, jint);
78 JNIEXPORT void JNICALL
79 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeDouble
80 (JNIEnv *, jobject, jstring, jdouble);
82 JNIEXPORT void JNICALL
83 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeBoolean
84 (JNIEnv *, jobject, jstring, jboolean);
86 JNIEXPORT void JNICALL
87 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeStringN
88 (JNIEnv *, jobject, jstring, jstring);
90 JNIEXPORT void JNICALL
91 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesInteger
92 (JNIEnv *, jobject, jstring, jobject);
94 JNIEXPORT void JNICALL
95 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesDouble
96 (JNIEnv *, jobject, jstring, jobject);
98 JNIEXPORT void JNICALL
99 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesStringN
100 (JNIEnv *, jobject, jstring, jobject);
102 JNIEXPORT jint JNICALL
103 Java_org_iotivity_simulator_SimulatorResourceServer_startResourceAutomation
106 JNIEXPORT jint JNICALL
107 Java_org_iotivity_simulator_SimulatorResourceServer_startAttributeAutomation
108 (JNIEnv *, jobject, jstring);
110 JNIEXPORT void JNICALL
111 Java_org_iotivity_simulator_SimulatorResourceServer_startAutomation
112 (JNIEnv *, jobject, jint);
114 JNIEXPORT void JNICALL
115 Java_org_iotivity_simulator_SimulatorResourceServer_removeAttribute
116 (JNIEnv *, jobject, jstring);
118 JNIEXPORT void JNICALL
119 Java_org_iotivity_simulator_SimulatorResourceServer_dispose
124 #endif //SIMULATOR_RESOURCE_JNI_H_