<commit_before>
![](img.png)

----


# Awa LightweightM2M.

## Example: Create a client application on a gateway device using the Awa API.

### Application overview.

![](Awa_client_tutorial_application_positioning.png)

This example shows how to:

* Compile and install Awa LightweightM2M   
* Create the application *client-tutorial* which:
    * Initiates a client session
    * Defines an object
    * Defines a resource within the object
    * Instantiates the defined object within the client
    * closes the client session
    * Exits
* Enhance the initial application with the addition of another resource to the existing object
* Create a server side application which uses the same object model


The client-tutorial application makes use of the Awa API to define objects and resources and to register these with the client daemon:

![](client-tutorial.png)



## Awa LightweightM2M installation.

Firstly, Awa LWM2M must be compiled and installed, using the commands below to build and install Awa LWM2M to the  *./build/install* directory:

```
~/AwaLWM2M$ make
~/AwaLWM2M$ cd build
~/AwaLWM2M/build$ cmake DESTDIR=./install install<commit_msg>Update example_app.md<commit_after>
![](img.png)

----


# Awa LightweightM2M.

## Example: Create a client application on a gateway device using the Awa API.

### Application overview.

![](Awa_client_tutorial_application_positioning.png)

This example shows how to:

* Compile and install Awa LightweightM2M   
* Create the application *client-tutorial* which:
    * Initiates a client session
    * Defines an object
    * Defines a resource within the object
    * Instantiates the defined object within the client
    * closes the client session
    * Exits
* Enhance the initial application with the addition of another resource to the existing object
* Create a server side application which uses the same object model


The client-tutorial application makes use of the Awa API to define objects and resources and to register these with the client daemon:

![](client-tutorial.png)



## Awa LightweightM2M installation.

Use the commands below to build and install Awa LightweightM2M to the  *./build/install* directory:

```
~/AwaLWM2M$ make
~/AwaLWM2M$ cd build
~/AwaLWM2M/build$ cmake DESTDIR=./install install
{'fraction_non_alphanumeric': 0.0697980684811238, 'fraction_numerical': 0.006584723441615452, 'mean_word_length': 4.144469525959368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3992066', 'n_tokens_mistral': 684, 'n_tokens_neox': 637, 'n_words': 276}