//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#ifndef _STRING_CONSTANTS_H_
-#define _STRING_CONSTANTS_H_
+#ifndef OC_STRING_CONSTANTS_H_
+#define OC_STRING_CONSTANTS_H_
#include <string>
namespace OC
{
+
+#if defined(_WIN32)
+/** @todo: Remove temporary hacks to solve error C2059: syntax error: 'constant'*/
+#ifdef NO_ERROR
+#undef NO_ERROR
+#endif
+#ifdef DELETE
+#undef DELETE
+#endif
+#endif
+
namespace InitException
{
static const char NO_ERROR[] = "No Error";
+ static const char INVALID_HOST[] = "Invalid Host";
static const char INVALID_URI[] = "Invalid URI";
static const char INVALID_PORT[] = "Invalid Port";
static const char INVALID_IP[] = "Invalid IP";
static const char UNKNOWN_ERROR[] = "Unknown Error";
static const char STACK_INIT_ERROR[] = "Error Initializing Stack";
+ static const char STACK_TERMINATE_ERROR[] = "Error Terminating Stack";
static const char NOT_CONFIGURED_AS_SERVER[] =
"Cannot static construct a Server when configured as a client";
static const char INVALID_PARAM[] = "Invalid Param";
static const char GENERAL_JSON_PARSE_FAILED[] = "JSON Parser Error";
static const char RESOURCE_UNREG_FAILED[] = "Unregistering resource failed";
static const char OPTION_ID_RANGE_INVALID[] =
- "Error: OptionID valid only from 2048 to 3000 inclusive.";
-
+ "Error: OptionID valid only If-Match(1), If-None-Match(5),"
+ "Location-Path(8), Location-Query(20),"
+ "and from 2048 to 3000 inclusive.";
static const char NO_ERROR[] = "No Error";
static const char RESOURCE_CREATED[] = "Resource Created";
+ static const char RESOURCE_CHANGED[] = "Resource Changed";
static const char RESOURCE_DELETED[] = "Resource Deleted";
static const char INVALID_URI[] = "Invalid URI";
static const char INVALID_IP[] = "Invalid IP";
static const char INVALID_OBESERVE[] = "Invalid Observe Param";
static const char NO_MEMORY[] = "No Memory";
static const char COMM_ERROR[] = "Communication Error";
+ static const char TIMEOUT[] = "Timeout";
+ static const char ADAPTER_NOT_ENABLED[] = "Adapter Not Enabled";
static const char NOT_IMPL[] = "Not Implemented";
static const char NOT_FOUND[] = "Resource Not Found";
static const char RESOURCE_ERROR[] = "Resource Error";
static const char PERSISTENT_BUFFER_REQUIRED[] = "Persistent response buffer required";
static const char STACK_CONTINUE[] = "Stack continue";
static const char INVALID_REQUEST_HANDLE[] = "Invalid request handle";
- static const char INVALID_DEVICE_INFO[] = "Invalid device info";
- static const char INVALID_JSON[] = "Invalid JSON";
static const char UNKNOWN_ERROR[] = "Unknown Error";
static const char INVALID_REPRESENTATION[] = "Invalid Payload JSON";
static const char INVALID_JSON_TYPE[] = "Unrecognized JSON Type ";
static const char INVALID_JSON_ARRAY_DEPTH[] = "Max JSON Array Depth exceeded";
static const char INVALID_JSON_TYPE_TAG[] = "Invalid JSON Type Tag";
static const char INVALID_ATTRIBUTE[] = "Invalid Attribute: ";
+ static const char INVALID_DEVICE_INFO[] = "Invalid Device Information";
+ static const char UNAUTHORIZED_REQUEST[] = "Unauthorized Request";
+ static const char TOO_LARGE_REQ[] = "Request Too Large";
+ static const char PDM_DB_NOT_INITIALIZED[] = "Provisioning DB is not initialized";
+ static const char DUPLICATE_UUID[] = "Duplicate UUID in DB";
+ static const char INCONSISTENT_DB[] = "Data in provisioning DB is inconsistent";
+ static const char SVR_DB_NOT_EXIST[] = "SVR DB file is not exist.";
+ static const char AUTHENTICATION_FAILURE[] = "Authentication failure";
+ static const char NOT_ALLOWED_OXM[] = "Not allowed ownership transfer method";
+ static const char USER_DENIED_REQ[] = "Request denied by User";
+ static const char NOT_ACCEPTABLE[] = "Request not acceptable";
+ static const char PUBLISH_RESOURCE_FAILED[] = "Publish Resource failure";
+ static const char FORBIDDEN_REQ[] = "Forbidden request";
+ static const char INTERNAL_SERVER_ERROR[] = "Internal server error";
+ static const char NOTIFY_ALL_OBSERVERS_FAILED[] = "notifyAllObservers failed";
+ static const char NOTIFY_LIST_OBSERVERS_FAILED[] = "notifyListOfObservers failed";
+ static const char METHOD_NOT_ALLOWED[] = "method not allowed";
+ static const char NOT_IMPLEMENTED[] = "not implemented";
+ static const char BAD_GATEWAY[] = "bad gateway";
+ static const char SERVICE_UNAVAILABLE[] = "service not available";
+ static const char GATEWAY_TIMEOUT[] = "gateway timeout";
+ static const char PROXY_NOT_SUPPORTED[] = "proxy not supported";
}
namespace Error
namespace PlatformCommands
{
- static const std::string GET = "GET";
- static const std::string PUT = "PUT";
- static const std::string POST = "POST";
- static const std::string DELETE = "DELETE";
+ static const std::string GET = "GET";
+ static const std::string PUT = "PUT";
+ static const std::string POST = "POST";
+ static const std::string DELETE = "DELETE";
}
namespace Key
{
- static const std::string OCKEY = "oc";
- static const std::string URIKEY = "href";
- static const std::string OBSERVABLEKEY = "obs";
- static const std::string RESOURCETYPESKEY = "rt";
- static const std::string INTERFACESKEY = "if";
- static const std::string PROPERTYKEY = "prop";
- static const std::string REPKEY = "rep";
- static const std::string SECUREKEY = "sec";
- static const std::string PORTKEY = "port";
- }
+ static const std::string OCKEY = "oic";
+ static const std::string URIKEY = "href";
+ static const std::string POLICYKEY = "p";
+ static const std::string BMKEY = "bm";
+ static const std::string RESOURCETYPESKEY = "rt";
+ static const std::string INTERFACESKEY = "if";
+ static const std::string PROPERTYKEY = "prop";
+ static const std::string REPKEY = "rep";
+ static const std::string SECUREKEY = "sec";
+ static const std::string PORTKEY = "port";
+ static const std::string DEVICEIDKEY = "di";
+ static const std::string LINKS = "links";
+
+ }
}
-#endif // _STRING_CONSTANTS_H_
+#endif // OC_STRING_CONSTANTS_H_
+