OpenThread_app
Loading...
Searching...
No Matches
SRP Client Wrapper

Manages Service Registration Protocol (SRP) for network discoverability. More...

Macros

#define OTAPP_DNS_LEASE_TASK_DELAY   300
#define OTAPP_DNS_LEASE_TIME   7200
#define OTAPP_DNS_LEASE_GUARD   (4 * OTAPP_DNS_LEASE_TASK_DELAY)
#define OTAPP_DNS_M_KEY_LEASE_TIME   86400

Functions

void otapp_srpClientUpdateHostAddress (otInstance *instance)
 Updates the registered Host Address on the SRP Server.
void otapp_srpInit ()
 Initializes the SRP Client and starts the registration process.

Detailed Description

Manages Service Registration Protocol (SRP) for network discoverability.

This module handles the registration of the device's Host Name, IP Address, and Services on the Thread Network's SRP Server (usually the Border Router). Purpose: Without SRP registration, other devices cannot resolve this device's name to an IP address using DNS-SD (DNS Service Discovery), effectively making this device invisible for pairing. Key Functions:

  • Registers the device hostname (e.g., device_type_EUI64).
  • Registers the _coap._udp service.
  • Manages Lease Renewals automatically via OpenThread Auto-Start mode.
    Version
    0.1
    Date
    06-09-2025
    Author
    Jan Łukaszewicz (plhar.nosp@m.eo@g.nosp@m.mail..nosp@m.com)

Macro Definition Documentation

◆ OTAPP_DNS_LEASE_GUARD

#define OTAPP_DNS_LEASE_GUARD   (4 * OTAPP_DNS_LEASE_TASK_DELAY)

◆ OTAPP_DNS_LEASE_TASK_DELAY

#define OTAPP_DNS_LEASE_TASK_DELAY   300

◆ OTAPP_DNS_LEASE_TIME

#define OTAPP_DNS_LEASE_TIME   7200

◆ OTAPP_DNS_M_KEY_LEASE_TIME

#define OTAPP_DNS_M_KEY_LEASE_TIME   86400

Function Documentation

◆ otapp_srpClientUpdateHostAddress()

void otapp_srpClientUpdateHostAddress ( otInstance * instance)

Updates the registered Host Address on the SRP Server.

This function should be called when the device's Mesh-Local EID (RLOC/ML-EID) changes. It ensures the DNS server points to the current, valid IPv6 address of this device.

Parameters
instancePointer to the OpenThread instance.

◆ otapp_srpInit()

void otapp_srpInit ( )

Initializes the SRP Client and starts the registration process.

This function:

  1. Sets the device host name (from Device Naming).
  2. Enables the OpenThread SRP Client Auto-Start mode.
  3. Registers the default services.
    Returns
    int8_t Result of the operation (typically 0/OK).