1.1 --- a/docs/wiki/Clients Sun Apr 26 18:25:12 2020 +0200
1.2 +++ b/docs/wiki/Clients Sun Apr 26 22:58:32 2020 +0200
1.3 @@ -49,6 +49,13 @@
1.4 #include "calc_client.h"
1.5 }}}
1.6
1.7 +To obtain references to components via the L4Re environment, the following
1.8 +include statement is required:
1.9 +
1.10 +{{{
1.11 +#include <l4/re/env.h>
1.12 +}}}
1.13 +
1.14 == C Language Clients ==
1.15
1.16 An object representing the component will have the `Calc` type. This
1.17 @@ -120,3 +127,31 @@
1.18
1.19 Since a common base class is used to declare the interface, local and remote
1.20 components are interchangeable.
1.21 +
1.22 +== Accessing Component Servers ==
1.23 +
1.24 +In L4Re, components can be made available to programs via capabilities
1.25 +provided in the program environment. Given the presence of such a capability,
1.26 +registered with the name of `server` and associated with a component server,
1.27 +access to the remote component can be obtained as follows:
1.28 +
1.29 +{{{
1.30 +l4_cap_idx_t server = l4re_env_get_cap("server");
1.31 +}}}
1.32 +
1.33 +Thereafter, the techniques described above should be sufficient to communicate
1.34 +with and invoke the operations of the component.
1.35 +
1.36 +== Example Code ==
1.37 +
1.38 +The `pkg/idl4re-examples` directory contains some example packages for L4Re
1.39 +that feature some of the above code and demonstrate the techniques involved.
1.40 +The `idl4re-examples` directory can be copied into the L4Re distribution's
1.41 +`pkg` directory and built as follows:
1.42 +
1.43 +{{{
1.44 +make O=mybuild S=pkg/idl4re-examples
1.45 +}}}
1.46 +
1.47 +The `mybuild` directory name should be adjusted to match your own choice of
1.48 +build output directory.