iotivity 0.9.0
[platform/upstream/iotivity.git] / android / Base / app / src / main / java / org / iotivity / base / PlatformConfig.java
1 //******************************************************************
2 //
3 // Copyright 2014 MediaTek 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 package org.iotivity.base;
22
23 public class PlatformConfig extends NativeInstance
24 {
25     final private static String TAG = "PlatformConfig";
26     static {
27         System.loadLibrary("ocstack-jni");
28     }
29
30     // ENUM definition. Need to match with OCApi.h
31     public class ServiceType
32     {
33         static final public int INPROC  = 0;
34         static final public int OUTPROC = 1;
35     };
36
37     public class ModeType
38     {
39         static final public int SERVER = 0;
40         static final public int CLIENT = 1;
41         static final public int BOTH   = 2;
42
43     };
44
45     public class QualityOfService
46     {
47         static final public int LO_QOS  = 0;
48         static final public int ME_QOS  = 1;
49         static final public int HI_QOS  = 2;
50         static final public int NA_QOS  = 3;
51     }
52
53     public PlatformConfig(int serviceType,
54                           int mode,
55                           String ipAddress,
56                           int port,
57                           int QoS)
58     {
59         super.nativeHandle = createNativeInstance(serviceType, mode, ipAddress, port, QoS);
60     }
61    
62
63     protected native long createNativeInstance(int serviceType,
64              int mode,
65              String ipAddress,
66              int port,
67              int QoS);
68 }