iotivity 0.9.0
[platform/upstream/iotivity.git] / resource / examples / ocicuc / README
1
2 OCICUC is a light framework for rapidly building OIC test/demo/example applications. It provides pre-built
3 entry points and handling for things like command line parameters and modularlizes resources, so that
4 adding new features or building a new test application is a lightweight undertaking.
5
6 .
7 ├── client.cpp                            - a multi-resource client, similar to simpleclient
8 ├── demo_client.hpp                       - client code, shared between client and multiprocess programs
9 ├── driver.cpp                            - ocicuc base driver program
10 ├── exec.hpp                              - header for binding with the driver
11 ├── light_resource.cpp            - example resource
12 ├── light_resource.hpp            - example resource
13 ├── monoprocess.cpp                       - client and server in a single process
14 ├── server.cpp                            - a multi-resource server, similar to simpleserver
15 ├── small_example.cpp             - a near-minimal example program
16 ├── utility.cpp                           - utility functions for the demo programs
17 └── utility.hpp                           - utility functions
18
19 You can extend the existing programs to add new resource types, etc.. Refer to the help screen for each program
20 for further details. For instance, to start a server with 5 resources and then test it with a separate client,
21 you could run:
22
23         ./server --nres=5
24
25 ...and, in another shell:
26
27         ./client --nres=5
28
29 To build a new program that hooks into the ocicuc driver program, you just need to define the functions in "exec.hpp",
30 for example:
31
32 namespace Intel { namespace OCDemo {
33
34 int exec(const boost::program_options::variables_map& vm);
35
36 auto make_description()
37     -> boost::program_options::options_description;
38
39 }} // namespace Intel::OCDemo
40
41 You can see an example of a skeleton program in small_example.cpp.
42
43 To run a program with default parameters, use "--", for example:
44
45 ./monoprocess --
46
47 Have fun!
48
49