|
| 1 | +.. _knx_iot_migration: |
| 2 | + |
| 3 | +|addon| migration guide |
| 4 | +####################### |
| 5 | + |
| 6 | +.. contents:: |
| 7 | + :local: |
| 8 | + :depth: 3 |
| 9 | + |
| 10 | +This page describes the changes required to migrate your application between |addon| versions. |
| 11 | + |
| 12 | +Updating from |addon| v0.1.0 |
| 13 | +**************************** |
| 14 | + |
| 15 | +Stack API changes |
| 16 | +================= |
| 17 | + |
| 18 | +Applications that call the `KNX IoT Point API Stack`_ directly must review the following changes: |
| 19 | + |
| 20 | +* ``oc_core_set_device()`` was replaced by individual identity and version setters. |
| 21 | + Version setters now take a pointer to an ``oc_knx_version_info_t`` structure. |
| 22 | +* ``oc_core_set_device_res()`` must be called explicitly after the basic device identity is set and before the remaining device setup. |
| 23 | + It initializes the KNX resources and connectivity. |
| 24 | +* ``app_get_precalculated_spake_data()`` is required for the v1.1.0 SPAKE2+ verifier. |
| 25 | + A generated record must match the password, salt, and iteration count used by the application. |
| 26 | +* ``oc_device_info_t.serialnumber`` is a ``const char *`` rather than an ``oc_string_t``. |
| 27 | + Remove ``oc_string()`` wrappers around it. |
| 28 | +* Include port-layer headers such as ``oc_clock.h``, ``oc_connectivity.h``, ``oc_storage.h``, and ``dns-sd.h`` with the ``port/`` prefix. |
| 29 | +* ``knx_publish_service()`` was renamed to ``knx_dns_sd_update_service()``. |
| 30 | + |
| 31 | +Kconfig changes |
| 32 | +=============== |
| 33 | + |
| 34 | +Remove legacy stack settings that are no longer exposed: |
| 35 | + |
| 36 | +* ``KNXIOT_SPAKE2P_PSA`` |
| 37 | +* ``KNXIOT_SPAKE2P_MBEDTLS`` |
| 38 | +* ``KNXIOT_LIB_DEMO_APPS`` |
| 39 | +* ``LIB_KNX_LOG_LEVEL`` |
| 40 | +* ``OC_PRINT_ENABLED`` |
| 41 | +* ``OC_USE_KNX_PORT_LAYER_ENABLED`` |
| 42 | +* ``OC_REPLAY_PROTECTION_ENABLED`` |
| 43 | +* ``KNX_LOG_TO_ZEPHYR`` |
| 44 | + |
| 45 | +Also remove ``MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS`` from application configuration files. |
| 46 | +The SPAKE2+ implementation now handles the required Mbed TLS declarations internally. |
| 47 | + |
| 48 | +For logging, use ``KNXIOT_DEBUG`` to compile the stack's debug code and ``KNXIOT_LOG_LEVEL`` to select the stack log level. |
| 49 | +``KNX_THREAD_STACK_SIZE`` remains available and now controls the add-on's stack event-loop thread. |
| 50 | + |
| 51 | +Add-on API changes |
| 52 | +================== |
| 53 | + |
| 54 | +Datapoint method flags |
| 55 | +---------------------- |
| 56 | + |
| 57 | +The ``methods`` member of ``knx_datapoint_t`` now uses add-on flags: |
| 58 | + |
| 59 | +.. code-block:: c |
| 60 | +
|
| 61 | + .methods = KNX_DP_GET | KNX_DP_PUT, |
| 62 | +
|
| 63 | +Replace old uses of ``OC_GET`` and ``OC_PUT`` in datapoint definitions with ``KNX_DP_GET`` and ``KNX_DP_PUT``. |
| 64 | + |
| 65 | +Programming mode and persisted state |
| 66 | +------------------------------------ |
| 67 | + |
| 68 | +Programming mode is runtime-only in the v1.1.0 integration and does not survive a restart. |
| 69 | +Applications must not rely on the stack restoring it from storage. |
0 commit comments