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 // Utility function to return the string equivalent of OCStackResult for the given int value
24 std::string getOCStackResultStringFromInt(int result)
31 ocresultstr = "OC_STACK_OK";
34 ocresultstr = "OC_STACK_RESOURCE_CREATED";
37 ocresultstr = "OC_STACK_RESOURCE_DELETED";
40 ocresultstr = "OC_STACK_CONTINUE";
43 ocresultstr = "OC_STACK_INVALID_URI";
46 ocresultstr = "OC_STACK_INVALID_QUERY";
49 ocresultstr = "OC_STACK_INVALID_QUERY";
52 ocresultstr = "OC_STACK_INVALID_PORT";
55 ocresultstr = "OC_STACK_INVALID_CALLBACK";
58 ocresultstr = "OC_STACK_INVALID_METHOD";
61 ocresultstr = "OC_STACK_INVALID_PARAM";
64 ocresultstr = "OC_STACK_INVALID_OBSERVE_PARAM";
67 ocresultstr = "OC_STACK_NO_MEMORY";
70 ocresultstr = "OC_STACK_COMM_ERROR";
73 ocresultstr = "OC_STACK_NOTIMPL";
76 ocresultstr = "OC_STACK_NO_RESOURCE";
79 ocresultstr = "OC_STACK_RESOURCE_ERROR";
82 ocresultstr = "OC_STACK_SLOW_RESOURCE";
85 ocresultstr = "OC_STACK_DUPLICATE_REQUEST";
88 ocresultstr = "OC_STACK_NO_OBSERVERS";
91 ocresultstr = "OC_STACK_OBSERVER_NOT_FOUND";
94 ocresultstr = "OC_STACK_VIRTUAL_DO_NOT_HANDLE";
97 ocresultstr = "OC_STACK_INVALID_OPTION";
100 ocresultstr = "OC_STACK_MALFORMED_RESPONSE";
103 ocresultstr = "OC_STACK_PERSISTENT_BUFFER_REQUIRED";
106 ocresultstr = "OC_STACK_INVALID_REQUEST_HANDLE";
109 ocresultstr = "OC_STACK_INVALID_DEVICE_INFO";
112 ocresultstr = "OC_STACK_INVALID_JSON";
115 ocresultstr = "OC_STACK_PRESENCE_STOPPED";
118 ocresultstr = "OC_STACK_PRESENCE_TIMEOUT";
121 ocresultstr = "OC_STACK_PRESENCE_DO_NOT_HANDLE";
124 ocresultstr = "OC_STACK_ERROR";
127 ocresultstr = "OC_STACK_ERROR";