Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / service / simulator / inc / simulator_client_types.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_CLIENT_TYPES_H_
22 #define SIMULATOR_CLIENT_TYPES_H_
23
24 #include <iostream>
25 #include <functional>
26 #include <memory>
27 #include "simulator_error_codes.h"
28
29 enum class ObserveType
30 {
31     OBSERVE,
32     OBSERVE_ALL
33 };
34
35 enum class RequestType
36 {
37     RQ_TYPE_UNKNOWN,
38     RQ_TYPE_GET,
39     RQ_TYPE_PUT,
40     RQ_TYPE_POST,
41     RQ_TYPE_DELETE
42 };
43
44 typedef struct
45 {
46     bool isVerified;
47     SimulatorResult errorCode;
48 } ValidationStatus;
49
50 typedef enum
51 {
52     OP_START,
53     OP_COMPLETE,
54     OP_ABORT
55 } OperationState;
56
57 typedef enum
58 {
59     /** use when defaults are ok. */
60     SIMULATOR_CT_DEFAULT = 0,
61
62     /** IPv4 and IPv6, including 6LoWPAN.*/
63     SIMULATOR_CT_ADAPTER_IP           = (1 << 16),
64
65     /** GATT over Bluetooth LE.*/
66     SIMULATOR_CT_ADAPTER_GATT_BTLE    = (1 << 17),
67
68     /** RFCOMM over Bluetooth EDR.*/
69     SIMULATOR_CT_ADAPTER_RFCOMM_BTEDR = (1 << 18),
70
71 #ifdef RA_ADAPTER
72     /** Remote Access over XMPP.*/
73     SIMULATOR_CT_ADAPTER_REMOTE_ACCESS = (1 << 19),
74 #endif
75
76     /** Insecure transport is the default (subject to change).*/
77
78     /** secure the transport path.*/
79     SIMULATOR_CT_FLAG_SECURE     = (1 << 4),
80
81     /** IPv4 & IPv6 autoselection is the default.*/
82
83     /** IP adapter only.*/
84     SIMULATOR_CT_IP_USE_V6       = (1 << 5),
85
86     /** IP adapter only.*/
87     SIMULATOR_CT_IP_USE_V4       = (1 << 6),
88
89     /** Link-Local multicast is the default multicast scope for IPv6.
90      * These are placed here to correspond to the IPv6 address bits.*/
91
92     /** IPv6 Interface-Local scope(loopback).*/
93     SIMULATOR_CT_SCOPE_INTERFACE = 0x1,
94
95     /** IPv6 Link-Local scope (default).*/
96     SIMULATOR_CT_SCOPE_LINK      = 0x2,
97
98     /** IPv6 Realm-Local scope.*/
99     SIMULATOR_CT_SCOPE_REALM     = 0x3,
100
101     /** IPv6 Admin-Local scope.*/
102     SIMULATOR_CT_SCOPE_ADMIN     = 0x4,
103
104     /** IPv6 Site-Local scope.*/
105     SIMULATOR_CT_SCOPE_SITE      = 0x5,
106
107     /** IPv6 Organization-Local scope.*/
108     SIMULATOR_CT_SCOPE_ORG       = 0x8,
109
110     /** IPv6 Global scope.*/
111     SIMULATOR_CT_SCOPE_GLOBAL    = 0xE,
112 } SimulatorConnectivityType;
113
114 class SimulatorRemoteResource;
115 typedef std::function<void(std::shared_ptr<SimulatorRemoteResource>)>
116 ResourceFindCallback;
117
118 #endif