Using the API vs. using dedicated libraries

Currently Lhings offers two ways of connecting devices to it. You can use the HTTP API or one of the libraries that support specific hardware. Each method has its pros and cons. The following table gives an overview of what you have and lack with each approach, so that you understand better when to use them.

Feature With API With libraries
Device lifecycle management O O
Automatic lifecycle management - O
Descriptor uploading O O
Automatic descriptor generation - O
Device management O -
Rule management O -
Data storage O -
Device remote control - O
On demand status retrieval - O

The API provides more features, but in turn the libraries allow you to avoid taking care of fine grained details like device lifecycle management or the generation of the descriptor file, which are automatically managed by the libraries.

Furthermore, the API has a big drawback and it is that currently you cannot create a device that can be controlled remotely using the API. This can only be done using the libraries. The cause behind this limitation is that using only HTTP you cannot push requests to your devices. This limitation will disappear in the near future.

The API is the only way to build applications that manage sets of devices, because all the device and rule management can only be done programatically using it.

The obvious drawback of the libraries is that they only support some devices, but you can take full advantage of the platform. In environments like Java you can make API calls from your Java code, so you can access some features only available through the API, like storing data.

Back to top