aaf6a75a93e8b84af616be5703e2cbaf41e13305
[platform/upstream/iotivity.git] / service / simulator / java / jni / simulator_resource_jni.h
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20
21 #ifndef SIMULATOR_RESOURCE_JNI_H_
22 #define SIMULATOR_RESOURCE_JNI_H_
23
24 #include <jni.h>
25 #include "simulator_resource.h"
26
27 class JniSimulatorResource
28 {
29     public:
30         JniSimulatorResource(SimulatorResourcePtr &resource);
31
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);
38     private:
39         SimulatorResourcePtr m_sharedResource;
40 };
41
42
43 #ifdef __cplusplus
44 extern "C" {
45
46 JNIEXPORT jobject JNICALL
47 Java_org_iotivity_simulator_SimulatorResourceServer_getModel
48 (JNIEnv *, jobject);
49
50 JNIEXPORT void JNICALL
51 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeFromAllowedValues
52 (JNIEnv *, jobject, jstring, jint);
53
54 JNIEXPORT void JNICALL
55 Java_org_iotivity_simulator_SimulatorResourceServer_setRange
56 (JNIEnv *, jobject, jstring, jint, jint);
57
58 JNIEXPORT void JNICALL
59 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeInteger
60 (JNIEnv *, jobject, jstring, jint);
61
62 JNIEXPORT void JNICALL
63 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeDouble
64 (JNIEnv *, jobject, jstring, jdouble);
65
66 JNIEXPORT void JNICALL
67 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeBoolean
68 (JNIEnv *, jobject, jstring, jboolean);
69
70 JNIEXPORT void JNICALL
71 Java_org_iotivity_simulator_SimulatorResourceServer_addAttributeStringN
72 (JNIEnv *, jobject, jstring, jstring);
73
74 JNIEXPORT void JNICALL
75 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeInteger
76 (JNIEnv *, jobject, jstring, jint);
77
78 JNIEXPORT void JNICALL
79 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeDouble
80 (JNIEnv *, jobject, jstring, jdouble);
81
82 JNIEXPORT void JNICALL
83 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeBoolean
84 (JNIEnv *, jobject, jstring, jboolean);
85
86 JNIEXPORT void JNICALL
87 Java_org_iotivity_simulator_SimulatorResourceServer_updateAttributeStringN
88 (JNIEnv *, jobject, jstring, jstring);
89
90 JNIEXPORT void JNICALL
91 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesInteger
92 (JNIEnv *, jobject, jstring, jobject);
93
94 JNIEXPORT void JNICALL
95 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesDouble
96 (JNIEnv *, jobject, jstring, jobject);
97
98 JNIEXPORT void JNICALL
99 Java_org_iotivity_simulator_SimulatorResourceServer_setAllowedValuesStringN
100 (JNIEnv *, jobject, jstring, jobject);
101
102 JNIEXPORT jint JNICALL
103 Java_org_iotivity_simulator_SimulatorResourceServer_startResourceAutomation
104 (JNIEnv *, jobject);
105
106 JNIEXPORT jint JNICALL
107 Java_org_iotivity_simulator_SimulatorResourceServer_startAttributeAutomation
108 (JNIEnv *, jobject, jstring);
109
110 JNIEXPORT void JNICALL
111 Java_org_iotivity_simulator_SimulatorResourceServer_startAutomation
112 (JNIEnv *, jobject, jint);
113
114 JNIEXPORT void JNICALL
115 Java_org_iotivity_simulator_SimulatorResourceServer_removeAttribute
116 (JNIEnv *, jobject, jstring);
117
118 JNIEXPORT void JNICALL
119 Java_org_iotivity_simulator_SimulatorResourceServer_dispose
120 (JNIEnv *, jobject);
121
122 }
123 #endif
124 #endif //SIMULATOR_RESOURCE_JNI_H_