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 ******************************************************************/
23 * This file contains the declaration of Group Manager APIs
24 * for JNI implementation.
27 #ifndef JNI_GROUP_MANAGER_H_
28 #define JNI_GROUP_MANAGER_H_
34 #include <jni_string.h>
41 * API for discoverying candidate resources.
43 * @param resourceTypes - required resource types(called "candidate")
44 * @param waitSec - Delay time in seconds to add before starting to find the resources in network.
46 * @return OCStackResult - return value of this API.
47 * It returns OC_STACK_OK if success.
49 * NOTE: OCStackResult is defined in ocstack.h.
51 JNIEXPORT jint JNICALL JNIGroupManagerFindCandidateResource
52 (JNIEnv *env, jobject interfaceObject, jobject resourceTypes, jint waitSec);
55 * API for subscribing child's state.
57 * @param resource - collection resource for subscribing presence of all child resources.
59 * @return OCStackResult - return value of this API.
60 * It returns OC_STACK_OK if success.
62 * NOTE: OCStackResult is defined in ocstack.h.
64 JNIEXPORT jint JNICALL JNIGroupManagerSubscribeCollectionPresence
65 (JNIEnv *env, jobject interfaceObject, jobject resource);
69 * API for register and bind resource to group.
71 * @param resource - resource for register and bind to group. It has all data.
72 * @param collectionHandle - collection resource handle. It will be added child resource.
74 * @return childHandle - child resource handle.
76 * NOTE: OCStackResult is defined in ocstack.h.
78 JNIEXPORT jobject JNICALL JNIGroupManagerBindResourceToGroup
79 (JNIEnv *env, jobject interfaceObject, jobject resource, jobject collectionHandle);
82 * API for adding an Action Set.
84 * @param resource - resource type representing the target group
85 * @param newActionSet - list of Action Set to be added
87 * @return OCStackResult - return value of this API.
88 * It returns OC_STACK_OK if success.
90 * NOTE: OCStackResult is defined in ocstack.h.
93 JNIEXPORT jint JNICALL JNIGroupManagerAddActionSet
94 (JNIEnv *env, jobject interfaceObject, jobject resource, jobject newActionSet);
97 * API for executing the Action Set.
99 * @param resource - resource type representing the target group
100 * @param actionSetName - Action Set name for executing the Action set
102 * @return OCStackResult - return value of this API.
103 * It returns OC_STACK_OK if success.
105 * NOTE: OCStackResult is defined in ocstack.h.
107 JNIEXPORT jint JNICALL JNIGroupManagerExecuteActionSet
108 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
111 * API for executing the Action Set.
113 * @param resource - resource type representing the target group
114 * @param actionSetName - Action Set name for executing the Action set
115 * @param delay - waiting time for until action set run.
117 * @return OCStackResult - return value of this API.
118 * It returns OC_STACK_OK if success.
120 * NOTE: OCStackResult is defined in ocstack.h.
122 JNIEXPORT jint JNICALL JNIGroupManagerExecuteActionSetWithDelay
123 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName, jlong delay);
126 * API for cancelling the Action Set.
128 * @param resource - resource type representing the target group
129 * @param actionSetName - Action Set name for cancelling the Action set
131 * @return OCStackResult - return value of this API.
132 * It returns OC_STACK_OK if success.
134 * NOTE: OCStackResult is defined in ocstack.h.
136 JNIEXPORT jint JNICALL JNIGroupManagerCancelActionSet
137 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
141 * API for reading the Action Set.
143 * @param resource - resource type representing the target group
144 * @param actionSetName - Action Set name for reading the Action set
146 * @return OCStackResult - return value of this API.
147 * It returns OC_STACK_OK if success.
149 * NOTE: OCStackResult is defined in ocstack.h.
151 JNIEXPORT jint JNICALL JNIGroupManagerGetActionSet
152 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
155 * API for removing the Action Set.
157 * @param resource - resource type representing the target group
158 * @param actionSetName - Action Set name for removing the Action set
160 * @return OCStackResult - return value of this API.
161 * It returns OC_STACK_OK if success.
163 * NOTE: OCStackResult is defined in ocstack.h.
165 JNIEXPORT jint JNICALL JNIGroupManagerDeleteActionSet
166 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
171 #endif //JNI_GROUP_MANAGER_H_