Skip to content

Commit

Permalink
Merge pull request #5 from ARMmbed/release-1.2.0-lite
Browse files Browse the repository at this point in the history
pelion-client-lite 1.2.0-lite
  • Loading branch information
teetak01 authored Aug 19, 2020
2 parents 95862c3 + 5d3d6d8 commit cdee2d4
Show file tree
Hide file tree
Showing 93 changed files with 4,804 additions and 4,623 deletions.
1 change: 1 addition & 0 deletions .mbedignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_modules/*
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog for Pelion Device Management Client Lite

### Release 1.2.0-lite (19.08.2020)

* Fixed an issue where Client Lite would trigger sleep-callback during the bootstrapping process.
* Changed the notification handler to send a notification only when crossing the "less than" or "greater than" notification threshold values.

### Release 1.1.1-lite (05.06.2020)

Client Lite 1.1.0 sends an additional component update object (/14) as part of its registration message even though the client does not support it yet. The update service has changed recently to handle the client differently, so there is no backward compatibility. Client Lite 1.1.0 cannot successfully update firmware. As part of this patch release, component update is behind a feature flag that is disabled in Client Lite release.
Expand Down
45 changes: 45 additions & 0 deletions DOXYGEN_FRONTPAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,48 @@ These APIs enable you to:
- Provide functionality to update the devices over the air remotely controlled from the service side.

The API (C code) allows quick application development and portability.

## Running the Device Management client

Client Lite runs on top of event loop, originating from project called Nanostack. This event handler is sometimes referred as `ns_hal` and sometimes as `eventOS`, so any functions prefixed with those, are part of the same eventing system.
See \ref nanostack-eventloop for its API description.

To use the Client Lite, we must first create an event handler, by calling following function:

```c
int8_t eventOS_event_handler_create(void (*handler_func_ptr)(arm_event_t *), uint8_t init_event_type);
```
The `handler_func_ptr` is our callback function, and the return value of the call is our event handler's identifier. First parameter to our callback is event structure, that usually contain just some 8-bit type number to notify which event happened, but might carry other data as well. When creating the event handler, the event loop issues a call to the given function with type set to match `init_event_type`.
Now that the even loop is initialized, we may initialise the Client Lite and give our callbacks ID for it that we received from the event loop.
```c
pdmc_connect_init(my_event_id);
```

When the client is running, all the actions happen through events that are coming to our callback. The event handler that we gave for the client, might look like this:

```c
void pdmc_event_handler(arm_event_t *event)
{
if (event->event_type == 0 && event->event_id == 0) {
// Ignore the initial event.
return;
}

if (event->event_id == LWM2M_INTERFACE_OBSERVER_EVENT_BOOTSTRAP_DONE) {
printf("Client bootstrapped\n");
} else if (event->event_id == M2M_CLIENT_EVENT_SETUP_COMPLETED) {
pdmc_connect_register(get_network_interface());
}
}
```
Final step for the application is then to start the even loop, which usually is just:
```c
eventOS_scheduler_run();
```

Please refer to [Device Management Client Lite Developer Guide](https://www.pelion.com/docs/pelion-client-lite/latest/developer-guide/index.html) for in depth tutorials how to use the client.
Also, see any of the given example applications for full OS specific applications. Code snippets in this page are simplified and uncomplete.
Loading

0 comments on commit cdee2d4

Please sign in to comment.