2 ****************************************************************************
3 Release date: Sept 30th, 2014.
4 OS: Ubuntu 12.0.4 and above
5 Requires boost version 1.55 to build.
6 Code buildable in gcc 4.6.3 and above.
7 NOTE: Boost is not distributed but should be installed in the Ubuntu machine.
8 *****************************************************************************
12 --------------------------------------------
13 Class OCPlatform (Header file: OCPlatform.h)
14 --------------------------------------------
17 setDefaultDeviceEntityHandler API
20 This new API allows the server side app developer to provide a default device entity handler.
21 If server receives a request in which the resource URI does not match any of the existing
22 resource URIs, base will invoke this default entity handler. It is app developer's responsibility
23 to handle the implementation of default device entity handler accordingly.
24 If the default device entity handler is not configured and the URI in the request does not match
25 any of the existing resource URIs, server will return OC_STACK_NO_RESOURCE.
28 NOTE: This applies to server side functionality.
30 --------------------------------------------
31 Class OCResource (Header file: OCResource.h)
32 --------------------------------------------
38 This new API allows the client to perform POST operation on a resource.
40 NOTE: This applies to client side functionality.
42 --------------------------------------------
43 Class OCRepresentation (Header file: OCApi.h)
44 --------------------------------------------
46 OCRepresentation has modifications which provides
47 - Ability to get/set OCRepresenation (JSON object) in the OCRepresentation.
48 - Ability to get/set vector of strings, booleans, double, integers, null.
49 - Has additional functions
54 This removes an attribute from the representation
59 This sets given attribute to null
64 This returns true if the given attribute is null
69 This returns true if the attribute exists in the representation
72 numberOfAttributes API
74 This returns the number of attributes in the representation
76 --------------------------------------------
77 Header file: OCStack.h (in base)
78 --------------------------------------------
81 OCSetDefaultDeviceEntityHandler API
84 This new API allows the server side app developer to provide a default device entity handler.
85 If server receives a request in which the resource URI does not match any of the existing
86 resource URIs, base will invoke this default entity handler. It is app developer's responsibility
87 to handle the implementation of default device entity handler accordingly.
88 If the default device entity handler is not configured and the URI in the request does not match
89 any of the existing resource URIs, server will return OC_STACK_NO_RESOURCE.
91 NOTE: This applies to server side functionality only.
97 Security model is still open.
98 APIs have OCStackResult as return type. This is will indicate success or failure for the API operation.
100 Maximum length of URI supported is 64 bytes (sent from the client)
101 Maximum length of query supported is 64 bytes (sent from the client)
102 Maximum length of request and response from server for Ardunio is is 256 bytes
103 Maximum length of request and response from server for non-Ardunio is is 1024 bytes
105 OIC base now supports Arduino WiFi shield.
106 This support has been tested with Arduino Mega 2560 and with Arduino 1.0.5 WiFi library.
107 Please refer to oic-resource/csdk/README file for building OIC base with WiFi support.
114 1. POST operation does not create new resources
115 2. Header options from client to server and vice-versa is not available.
116 3. Setting CON/NON-CON option is possible only during initialization configuration.
121 REFER https://oic-review.01.org/gerrit for more details on getting oic-resource repo.
122 If the code is not cloned:
123 Clone the oic-resource repo using this command: git clone oic:oic-resource
124 Clone the oic-utilities repo using this command: git clone oic:oic-utilities
126 NOTE: If the repo is already cloned, use 'git pull' inside oic-resource folder to get the latest code.
128 In repo oic-core, root folder ccf-opensource consists of 'OIC' folder. Inside OIC folder there is a Makefile.
130 Before building, make sure to have contents from oic-utilities repo at the folder level where oic-resource is.
132 Inside oic-resource directory, use 'make'to build the entire OIC code. This would build the C++ SDK, core(i.e base) and samples.
134 Use 'make BUILD=debug' to build the entire OIC code in debug mode. This would build the C++ SDK, core(i.e base) and samples. All the executables for debug build
135 are in 'oic-resource/debug'.
142 oic-resource/examples/garageclient.cpp
143 oic-resource/examples/garageserver.cpp
145 Garage samples provide usage of OCRepresentation, get/set attribute values
147 oic-resource/examples/fridgeclient.cpp
148 oic-resource/examples/fridgeserver.cpp
150 Fridge samples provide usage of constructResourceObject API, std bind (for mapping request and responses) and default
151 device entity handler
153 After building the code in oic-resource, executables for samples are in directory named 'oic-resource/samples/release'.
154 After building the code in oic-resource, executables are in directory named 'oic-resource/release'.
155 A sample for hosting a resource on a server and a sample for client for discovering resources are provided in the following paths:
157 Server sample location: oic-resource/examples/simpleserver.cpp
158 Client sample location: oic-resource/examples/simpleclient.cpp
159 Server and client mode (mode type both) location: oic-resource/examples/simpleclientserver.cpp
161 Sample with basic presence feature for server side: oic-resource/examples/presenceserver.cpp
162 Sample with basic presence feature for client side: oic-resource/examples/presenceclient.cpp