Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Orru <[email protected]>
  • Loading branch information
sorru94 committed Jul 18, 2024
1 parent 6a6aa1e commit 70709f4
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.. Astarte device SDKs documentation master file.
.. toctree::
:maxdepth: 2
:caption: Contents:

###################
Astarte device SDKs
###################
Expand Down Expand Up @@ -177,6 +181,41 @@ UUID generation.
device_id = UUID.uuid5(namespace_uuid, payload, :raw)
|> Astarte.Core.Device.encode_device_id()
.. toctree::
:maxdepth: 2
:caption: Contents:
==============================
Automatic Registration (Agent)
==============================

You can refer to the
`Astarte API for device registration <https://docs.astarte-platform.org/astarte/latest/api/index.html?urls.primaryName=Pairing%20API#/agent/registerDevice>`_
for more details.

.. tabs::

.. group-tab:: C

C (ESP32):

.. code-block:: C
astarte_pairing_config cfg =
{
.base_url = &base_astarte_url;
.jwt = &jwt_token;
.realm = &realm;
.hw_id = &device_id;
.credentials_secret = &credentials_secret;
};
astarte_err_t err = astarte_pairing_register_device(&astarte_pairing_config);
.. group-tab:: C++

C++ (Qt5): registration is done on device instantiation, see the next section.

.. group-tab:: Elixir

Elixir:

.. code-block:: Elixir
{:ok, %{body: %{"data" => %{"credentials_secret" => credentials_secret}}}} = Agent.register_device(client, device_id)

0 comments on commit 70709f4

Please sign in to comment.